From b2df1192d46d7e20ea5c676493bed15a1176dabf Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 12:29:19 +0200 Subject: [PATCH 1/5] Do not compile with `nasm` by default --- crates/store/re_video/Cargo.toml | 1 + crates/store/re_video/src/decode/av1.rs | 8 -------- crates/top/rerun-cli/Cargo.toml | 1 + crates/top/rerun/Cargo.toml | 1 + pixi.toml | 8 ++++---- rerun_py/Cargo.toml | 3 ++- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/crates/store/re_video/Cargo.toml b/crates/store/re_video/Cargo.toml index 2dcad53f341a..0ac6ab7ff2a3 100644 --- a/crates/store/re_video/Cargo.toml +++ b/crates/store/re_video/Cargo.toml @@ -31,6 +31,7 @@ av1 = ["dep:dav1d"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. +## TODO(#7671): there is a bug that makes this incompatible with arch linux nasm = ["dav1d?/default"] # The default feature set of dav1d has asm enabled [dependencies] diff --git a/crates/store/re_video/src/decode/av1.rs b/crates/store/re_video/src/decode/av1.rs index d4e69276a96e..320d523535ea 100644 --- a/crates/store/re_video/src/decode/av1.rs +++ b/crates/store/re_video/src/decode/av1.rs @@ -16,14 +16,6 @@ impl SyncDav1dDecoder { pub fn new() -> Result { re_tracing::profile_function!(); - if !cfg!(feature = "nasm") { - re_log::warn_once!( - "NOTE: native AV1 video decoder is running extra slowly. \ - Speed it up by compiling Rerun with the `nasm` feature enabled. \ - You'll need to also install nasm: https://nasm.us/" - ); - } - // See https://videolan.videolan.me/dav1d/structDav1dSettings.html for settings docs let mut settings = dav1d::Settings::new(); diff --git a/crates/top/rerun-cli/Cargo.toml b/crates/top/rerun-cli/Cargo.toml index 405e07cb176d..0ba251cfa4b4 100644 --- a/crates/top/rerun-cli/Cargo.toml +++ b/crates/top/rerun-cli/Cargo.toml @@ -43,6 +43,7 @@ default = ["native_viewer", "web_viewer"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. +## TODO(#7671): there is a bug that makes this incompatible with arch linux nasm = ["rerun/nasm"] ## Support spawning a native viewer. diff --git a/crates/top/rerun/Cargo.toml b/crates/top/rerun/Cargo.toml index 4a3c6adf6dd5..2073e61cdec2 100644 --- a/crates/top/rerun/Cargo.toml +++ b/crates/top/rerun/Cargo.toml @@ -73,6 +73,7 @@ log = ["dep:env_logger", "dep:log"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. +## TODO(#7671): there is a bug that makes this incompatible with arch linux nasm = ["re_video/nasm"] ## Support spawning a native viewer. diff --git a/pixi.toml b/pixi.toml index 56ab2208126c..c9301c804cf0 100644 --- a/pixi.toml +++ b/pixi.toml @@ -122,18 +122,18 @@ man = "cargo --quiet run --package rerun-cli --all-features -- man > docs/conten # Compile and run the rerun viewer. # # You can also give an argument for what to view (e.g. an .rrd file). -rerun = "cargo run --package rerun-cli --no-default-features --features native_viewer,nasm --" +rerun = "cargo run --package rerun-cli --no-default-features --features native_viewer --" # Compile `rerun-cli` without the web-viewer. -rerun-build = "cargo build --package rerun-cli --no-default-features --features native_viewer,nasm" +rerun-build = "cargo build --package rerun-cli --no-default-features --features native_viewer" # Compile `rerun-cli` without the web-viewer. -rerun-build-release = "cargo build --package rerun-cli --release --no-default-features --features native_viewer,nasm" +rerun-build-release = "cargo build --package rerun-cli --release --no-default-features --features native_viewer" # Compile and run the rerun viewer with --release. # # You can also give an argument for what to view (e.g. an .rrd file). -rerun-release = "cargo run --package rerun-cli --no-default-features --features native_viewer,nasm --release --" +rerun-release = "cargo run --package rerun-cli --no-default-features --features native_viewer --release --" # Compile and run the web-viewer via rerun-cli. # diff --git a/rerun_py/Cargo.toml b/rerun_py/Cargo.toml index 2b5994ab5de9..7105211cedfe 100644 --- a/rerun_py/Cargo.toml +++ b/rerun_py/Cargo.toml @@ -19,7 +19,7 @@ default = ["extension-module"] ## The features we turn on when building the `rerun-sdk` PyPi package ## for . -pypi = ["extension-module", "nasm", "web_viewer"] +pypi = ["extension-module", "web_viewer"] ## We need to enable the `pyo3/extension-module` when building the SDK, ## but we cannot enable it when building tests and benchmarks, so we @@ -30,6 +30,7 @@ extension-module = ["pyo3/extension-module"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. +## TODO(#7671): there is a bug that makes this incompatible with arch linux nasm = ["re_video/nasm"] ## Support serving a web viewer over HTTP with `serve()`. From d7754493623a65e3566cd2da4e0806cc63aaf6ae Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 12:46:58 +0200 Subject: [PATCH 2/5] all of Linux --- crates/store/re_video/Cargo.toml | 2 +- crates/top/rerun-cli/Cargo.toml | 2 +- crates/top/rerun/Cargo.toml | 2 +- rerun_py/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/store/re_video/Cargo.toml b/crates/store/re_video/Cargo.toml index 0ac6ab7ff2a3..ea2ca4f2ae54 100644 --- a/crates/store/re_video/Cargo.toml +++ b/crates/store/re_video/Cargo.toml @@ -31,7 +31,7 @@ av1 = ["dep:dav1d"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with arch linux +## TODO(#7671): there is a bug that makes this incompatible with linux nasm = ["dav1d?/default"] # The default feature set of dav1d has asm enabled [dependencies] diff --git a/crates/top/rerun-cli/Cargo.toml b/crates/top/rerun-cli/Cargo.toml index 0ba251cfa4b4..4f452cf059b6 100644 --- a/crates/top/rerun-cli/Cargo.toml +++ b/crates/top/rerun-cli/Cargo.toml @@ -43,7 +43,7 @@ default = ["native_viewer", "web_viewer"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with arch linux +## TODO(#7671): there is a bug that makes this incompatible with linux nasm = ["rerun/nasm"] ## Support spawning a native viewer. diff --git a/crates/top/rerun/Cargo.toml b/crates/top/rerun/Cargo.toml index 2073e61cdec2..f6a3055d8aae 100644 --- a/crates/top/rerun/Cargo.toml +++ b/crates/top/rerun/Cargo.toml @@ -73,7 +73,7 @@ log = ["dep:env_logger", "dep:log"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with arch linux +## TODO(#7671): there is a bug that makes this incompatible with linux nasm = ["re_video/nasm"] ## Support spawning a native viewer. diff --git a/rerun_py/Cargo.toml b/rerun_py/Cargo.toml index 7105211cedfe..5655b419e352 100644 --- a/rerun_py/Cargo.toml +++ b/rerun_py/Cargo.toml @@ -30,7 +30,7 @@ extension-module = ["pyo3/extension-module"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with arch linux +## TODO(#7671): there is a bug that makes this incompatible with linux nasm = ["re_video/nasm"] ## Support serving a web viewer over HTTP with `serve()`. From 74449099e0aef1b264a80cced4b8cc96fe04e111 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 12:51:40 +0200 Subject: [PATCH 3/5] Different fix: just make the `nasm` feature a noop --- crates/store/re_video/Cargo.toml | 5 +++-- crates/top/rerun-cli/Cargo.toml | 2 +- crates/top/rerun/Cargo.toml | 2 +- pixi.toml | 8 ++++---- rerun_py/Cargo.toml | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/crates/store/re_video/Cargo.toml b/crates/store/re_video/Cargo.toml index ea2ca4f2ae54..afc07c39dcd3 100644 --- a/crates/store/re_video/Cargo.toml +++ b/crates/store/re_video/Cargo.toml @@ -31,8 +31,9 @@ av1 = ["dep:dav1d"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with linux -nasm = ["dav1d?/default"] # The default feature set of dav1d has asm enabled +# TODO(#7671): this feature flag currently does nothing +# nasm = ["dav1d?/default"] # The default feature set of dav1d has asm enabled +nasm = [] ## TODO(#7671): fix Linux build [dependencies] re_log.workspace = true diff --git a/crates/top/rerun-cli/Cargo.toml b/crates/top/rerun-cli/Cargo.toml index 4f452cf059b6..1f0f0ef3c5b0 100644 --- a/crates/top/rerun-cli/Cargo.toml +++ b/crates/top/rerun-cli/Cargo.toml @@ -43,7 +43,7 @@ default = ["native_viewer", "web_viewer"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with linux +# TODO(#7671): this feature flag currently does nothing nasm = ["rerun/nasm"] ## Support spawning a native viewer. diff --git a/crates/top/rerun/Cargo.toml b/crates/top/rerun/Cargo.toml index f6a3055d8aae..dfc1e8bccdde 100644 --- a/crates/top/rerun/Cargo.toml +++ b/crates/top/rerun/Cargo.toml @@ -73,7 +73,7 @@ log = ["dep:env_logger", "dep:log"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with linux +# TODO(#7671): this feature flag currently does nothing nasm = ["re_video/nasm"] ## Support spawning a native viewer. diff --git a/pixi.toml b/pixi.toml index c9301c804cf0..56ab2208126c 100644 --- a/pixi.toml +++ b/pixi.toml @@ -122,18 +122,18 @@ man = "cargo --quiet run --package rerun-cli --all-features -- man > docs/conten # Compile and run the rerun viewer. # # You can also give an argument for what to view (e.g. an .rrd file). -rerun = "cargo run --package rerun-cli --no-default-features --features native_viewer --" +rerun = "cargo run --package rerun-cli --no-default-features --features native_viewer,nasm --" # Compile `rerun-cli` without the web-viewer. -rerun-build = "cargo build --package rerun-cli --no-default-features --features native_viewer" +rerun-build = "cargo build --package rerun-cli --no-default-features --features native_viewer,nasm" # Compile `rerun-cli` without the web-viewer. -rerun-build-release = "cargo build --package rerun-cli --release --no-default-features --features native_viewer" +rerun-build-release = "cargo build --package rerun-cli --release --no-default-features --features native_viewer,nasm" # Compile and run the rerun viewer with --release. # # You can also give an argument for what to view (e.g. an .rrd file). -rerun-release = "cargo run --package rerun-cli --no-default-features --features native_viewer --release --" +rerun-release = "cargo run --package rerun-cli --no-default-features --features native_viewer,nasm --release --" # Compile and run the web-viewer via rerun-cli. # diff --git a/rerun_py/Cargo.toml b/rerun_py/Cargo.toml index 5655b419e352..021a632313bf 100644 --- a/rerun_py/Cargo.toml +++ b/rerun_py/Cargo.toml @@ -19,7 +19,7 @@ default = ["extension-module"] ## The features we turn on when building the `rerun-sdk` PyPi package ## for . -pypi = ["extension-module", "web_viewer"] +pypi = ["extension-module", "nasm", "web_viewer"] ## We need to enable the `pyo3/extension-module` when building the SDK, ## but we cannot enable it when building tests and benchmarks, so we @@ -30,7 +30,7 @@ extension-module = ["pyo3/extension-module"] ## Enable faster native video decoding with assembly. ## You need to install [nasm](https://nasm.us/) to compile with this feature. -## TODO(#7671): there is a bug that makes this incompatible with linux +# TODO(#7671): this feature flag currently does nothing nasm = ["re_video/nasm"] ## Support serving a web viewer over HTTP with `serve()`. From edf4624b802120a2b604898cdcffe595af34baae Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 12:52:45 +0200 Subject: [PATCH 4/5] Add back code for the warning --- crates/store/re_video/src/decode/av1.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/store/re_video/src/decode/av1.rs b/crates/store/re_video/src/decode/av1.rs index 320d523535ea..b345fbfb209d 100644 --- a/crates/store/re_video/src/decode/av1.rs +++ b/crates/store/re_video/src/decode/av1.rs @@ -16,6 +16,15 @@ impl SyncDav1dDecoder { pub fn new() -> Result { re_tracing::profile_function!(); + // TODO(#7671): enable this check again when the `nasm` feature actually does something + if false && !cfg!(feature = "nasm") { + re_log::warn_once!( + "NOTE: native AV1 video decoder is running extra slowly. \ + Speed it up by compiling Rerun with the `nasm` feature enabled. \ + You'll need to also install nasm: https://nasm.us/" + ); + } + // See https://videolan.videolan.me/dav1d/structDav1dSettings.html for settings docs let mut settings = dav1d::Settings::new(); From 45d967fedadacfe5c8088113f6ffc67121e55806 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 12:54:10 +0200 Subject: [PATCH 5/5] silence clippy warning --- crates/store/re_video/src/decode/av1.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/store/re_video/src/decode/av1.rs b/crates/store/re_video/src/decode/av1.rs index b345fbfb209d..dea52895e2e7 100644 --- a/crates/store/re_video/src/decode/av1.rs +++ b/crates/store/re_video/src/decode/av1.rs @@ -16,7 +16,8 @@ impl SyncDav1dDecoder { pub fn new() -> Result { re_tracing::profile_function!(); - // TODO(#7671): enable this check again when the `nasm` feature actually does something + // TODO(#7671): enable this warning again when the `nasm` feature actually does something + #[allow(clippy::overly_complex_bool_expr)] if false && !cfg!(feature = "nasm") { re_log::warn_once!( "NOTE: native AV1 video decoder is running extra slowly. \