From 00b3f55f881c429046d2e1badb7c461760d50a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Thu, 17 Sep 2026 10:07:27 +0200 Subject: [PATCH 1/3] Add a `cuda-oxide` feature (CUDA kernels compiled by cuda-oxide) --- Cargo.toml | 13 +++++++++---- vortx-shaders/Cargo.toml | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 69d852d..6d9171c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,9 @@ webgpu = [ "khal/webgpu" ] cpu = ["khal/cpu", "vortx-shaders/cpu"] cpu-parallel = ["cpu", "vortx-shaders/cpu-parallel"] cuda = ["khal/cuda", "khal-builder/cuda", "vortx-shaders/cuda"] +# Native CUDA with kernels compiled by cuda-oxide (`cargo oxide`) instead of +# rust-cuda's `cargo cuda`. Implies `cuda`. +cuda-oxide = ["cuda", "khal-builder/cuda-oxide", "vortx-shaders/cuda-oxide"] metal = ["khal/metal"] push_constants = ["khal/push_constants", "vortx-shaders/push_constants"] subgroup_ops = ["khal/subgroup_ops", "vortx-shaders/subgroup_ops"] @@ -62,8 +65,10 @@ khal-builder = "0.3" vortx-shaders = { version = "0.4", path = "./vortx-shaders" } [patch.crates-io] -#khal-builder = { path = "../khal/crates/khal-builder" } -#khal = { path = "../khal/crates/khal" } -#khal-std = { path = "../khal/crates/khal-std" } -#khal-derive = { path = "../khal/crates/khal-derive" } +# Local khal checkout: the `cuda-oxide` feature (and the cubin/PTX build +# fixes) are not on crates.io yet. +khal-builder = { path = "../khal/crates/khal-builder" } +khal = { path = "../khal/crates/khal" } +khal-std = { path = "../khal/crates/khal-std" } +khal-derive = { path = "../khal/crates/khal-derive" } #glamx = { git = "https://github.com/dimforge/glamx", branch = "bytemuck" } diff --git a/vortx-shaders/Cargo.toml b/vortx-shaders/Cargo.toml index 4891264..3ee4124 100644 --- a/vortx-shaders/Cargo.toml +++ b/vortx-shaders/Cargo.toml @@ -22,6 +22,9 @@ subgroup_ops = [] cpu = ["khal-std/cpu", "khal/cpu"] cpu-parallel = ["cpu", "khal-std/cpu-parallel"] cuda = ["khal-std/cuda", "khal/cuda"] +# Compile the CUDA kernels with the cuda-oxide backend (host-target unified +# interception) instead of rust-cuda. +cuda-oxide = ["cuda", "khal-std/cuda-oxide"] # Enables machine-learning (llm inference, reinforcement learning, etc.) operators. ml = [] From 75e8df6ee8310b69b4f6de1831bcaef67dcb034b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Thu, 24 Sep 2026 14:37:45 +0200 Subject: [PATCH 2/3] fix: do not forward the cuda-oxide feature to vortx-shaders on the host --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6d9171c..50578b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,10 @@ cpu-parallel = ["cpu", "vortx-shaders/cpu-parallel"] cuda = ["khal/cuda", "khal-builder/cuda", "vortx-shaders/cuda"] # Native CUDA with kernels compiled by cuda-oxide (`cargo oxide`) instead of # rust-cuda's `cargo cuda`. Implies `cuda`. -cuda-oxide = ["cuda", "khal-builder/cuda-oxide", "vortx-shaders/cuda-oxide"] +# Not forwarded to `vortx-shaders/cuda-oxide`: khal-builder enables that in its +# own `cargo oxide` build; in the host build it would break the CPU backend +# (GPU-only libdevice externs in khal-std's `Float`). +cuda-oxide = ["cuda", "khal-builder/cuda-oxide"] metal = ["khal/metal"] push_constants = ["khal/push_constants", "vortx-shaders/push_constants"] subgroup_ops = ["khal/subgroup_ops", "vortx-shaders/subgroup_ops"] From 46cc5f8fc959070a1c5115a546427004369cd361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Wed, 30 Sep 2026 19:20:46 +0200 Subject: [PATCH 3/3] chore: temporary switch to the github version of khal --- Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 50578b0..8759267 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,10 +68,10 @@ khal-builder = "0.3" vortx-shaders = { version = "0.4", path = "./vortx-shaders" } [patch.crates-io] -# Local khal checkout: the `cuda-oxide` feature (and the cubin/PTX build +# khal from GitHub: the `cuda-oxide` feature (and the cubin/PTX build # fixes) are not on crates.io yet. -khal-builder = { path = "../khal/crates/khal-builder" } -khal = { path = "../khal/crates/khal" } -khal-std = { path = "../khal/crates/khal-std" } -khal-derive = { path = "../khal/crates/khal-derive" } +khal-builder = { git = "https://github.com/dimforge/khal", branch = "main" } +khal = { git = "https://github.com/dimforge/khal", branch = "main" } +khal-std = { git = "https://github.com/dimforge/khal", branch = "main" } +khal-derive = { git = "https://github.com/dimforge/khal", branch = "main" } #glamx = { git = "https://github.com/dimforge/glamx", branch = "bytemuck" }