From d66754cd15c9ec1dfdccf942d0a85dc58554b438 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Mon, 29 Sep 2025 14:25:37 +0200 Subject: [PATCH 1/3] changed dependency to use static linking --- Cargo.toml | 19 ++++++++++++------- crates/slai-chat/Cargo.toml | 7 +++---- crates/slai-chat/README.md | 11 ++++++++++- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6abd8ab..e1af627 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,8 @@ [workspace] members = [ "crates/slai", -# "crates/slai-bench", + # "crates/slai-bench", "crates/slai-chat", - "crates/slai-chat" ] resolver = "2" @@ -19,7 +18,7 @@ encase = { version = "0.11.0", features = ["nalgebra"] } [workspace.lints] rust.unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(feature, values("dim2", "dim3"))' + 'cfg(feature, values("dim2", "dim3"))', ] } [profile.release] @@ -36,7 +35,13 @@ inherits = "dev" inherits = "dev" [patch.crates-io] -#slang-hal-derive = { path = "../slang-hal/crates/slang-hal-derive" } -#slang-hal = { path = "../slang-hal/crates/slang-hal" } -#minislang = { path = "../slang-hal/crates/minislang" } -#stensor = { path = "../stensor" } +# slang-hal-derive = { path = "../slang-hal/crates/slang-hal-derive" } +# slang-hal = { path = "../slang-hal/crates/slang-hal" } +# minislang = { path = "../slang-hal/crates/minislang" } +# stensor = { path = "../stensor" } +slang-hal-derive = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" } +slang-hal = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" } +minislang = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" } +shader-slang = { git = "https://github.com/Vrixyz/slang-rs.git", branch = "static-build", default-features = false, features = [ + "static", +] } diff --git a/crates/slai-chat/Cargo.toml b/crates/slai-chat/Cargo.toml index 52db9e3..edf2d10 100644 --- a/crates/slai-chat/Cargo.toml +++ b/crates/slai-chat/Cargo.toml @@ -11,12 +11,12 @@ default = ["web"] web = ["dioxus/web"] desktop = ["dioxus/desktop"] mobile = ["dioxus/mobile"] -cuda = [ "slai/cuda" ] -comptime_checks = [ "slai/comptime_checks" ] +cuda = ["slai/cuda"] +comptime_checks = ["slai/comptime_checks"] [dependencies] slang-hal = "0.1" -slai = { version = "0.1", path = "../slai" } +slai = { version = "0.1", path = "../slai" } nalgebra = "0.34" async-channel = "2" @@ -54,4 +54,3 @@ colored = "3.0.0" # web: [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen-futures = "0.4" - diff --git a/crates/slai-chat/README.md b/crates/slai-chat/README.md index cbac86f..9c6a939 100644 --- a/crates/slai-chat/README.md +++ b/crates/slai-chat/README.md @@ -1,21 +1,30 @@ # slai-chat This is a basic chat interface for testing **slai**. Currently only supports: + - Models of the Llama family. - Qwen 2. - Segment Anything. In order to compile and run `slai-chat`, be sure to define the `SLANG_DIR` environment variable: -1. Download the Slang compiler libraries for your platform: https://github.com/shader-slang/slang/releases/tag/v2025.16 + +1. Download the Slang compiler libraries for your platform: 2. Unzip the downloaded directory, and use its path as value to the `SLANG_DIR` environment variable: `SLANG_DIR=/path/to/slang`. Note that the variable must point to the root of the slang installation (i.e. the directory that contains `bin` and `lib`). +More environment variables are needed because we link statically slang and its dependencies: + +1. `SLANG_EXTERNAL_DIR`: typically set to '[](https://github.com/shader-slang/slang)/build/external' +2. `LIBSTDCPP_PATH`: to link with libstdc++. + To run the GUI natively: + ```bash dx run --release --features desktop ``` To run the CLI version natively (the CLI doesn’t support segment-anything currently): + ```bash cargo run --release --features desktop -- --headless --inspect '/path/to/model.gguf' ``` From e82153401cbe2b683b288a3869b68378b005c051 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Tue, 7 Oct 2025 16:08:23 +0200 Subject: [PATCH 2/3] remove useless patch now (it can't really be used because we rely on features --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e1af627..cfe0ee4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,3 @@ inherits = "dev" slang-hal-derive = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" } slang-hal = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" } minislang = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" } -shader-slang = { git = "https://github.com/Vrixyz/slang-rs.git", branch = "static-build", default-features = false, features = [ - "static", -] } From 794140096fbc60cd3d96bd430da98c4e4162365f Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Tue, 14 Oct 2025 20:16:03 +0200 Subject: [PATCH 3/3] update readme --- crates/slai-chat/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/slai-chat/README.md b/crates/slai-chat/README.md index 9c6a939..37d97a6 100644 --- a/crates/slai-chat/README.md +++ b/crates/slai-chat/README.md @@ -12,10 +12,9 @@ In order to compile and run `slai-chat`, be sure to define the `SLANG_DIR` envir 2. Unzip the downloaded directory, and use its path as value to the `SLANG_DIR` environment variable: `SLANG_DIR=/path/to/slang`. Note that the variable must point to the root of the slang installation (i.e. the directory that contains `bin` and `lib`). -More environment variables are needed because we link statically slang and its dependencies: +1 more environment variables is needed because we link statically slang and its dependencies: 1. `SLANG_EXTERNAL_DIR`: typically set to '[](https://github.com/shader-slang/slang)/build/external' -2. `LIBSTDCPP_PATH`: to link with libstdc++. To run the GUI natively: