From d9f6bfb2e6d9f736a77d25ebfecf10a395d0391c Mon Sep 17 00:00:00 2001 From: Temo Tskipuri Date: Mon, 28 Sep 2026 21:27:27 +0400 Subject: [PATCH 1/2] build: add CUDA 13.4 and 13.x versions to default candidates Signed-off-by: Temo Tskipuri --- cuda-bindings/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cuda-bindings/build.rs b/cuda-bindings/build.rs index d2d567ed1c..e6ce99a720 100644 --- a/cuda-bindings/build.rs +++ b/cuda-bindings/build.rs @@ -225,13 +225,21 @@ fn default_cuda_toolkit_candidates() -> &'static [PathBuf] { CANDIDATES.get_or_init(|| { #[cfg(windows)] let candidates = [ + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.5", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4", r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3", r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0", ]; #[cfg(not(windows))] let candidates = [ + "/usr/local/cuda-13.5", + "/usr/local/cuda-13.4", "/usr/local/cuda-13.3", "/usr/local/cuda-13.2", + "/usr/local/cuda-13.1", + "/usr/local/cuda-13.0", "/usr/local/cuda-13", "/usr/local/cuda", "/opt/cuda", From 544b0f4bb13d19ed7f869ceea2da03afae622a05 Mon Sep 17 00:00:00 2001 From: Temo Tskipuri Date: Sat, 10 Oct 2026 18:15:33 +0400 Subject: [PATCH 2/2] build: keep the toolkit candidate mirrors in step with cuda-bindings cuda-core's multicast probe and `cargo oxide doctor` each carry a hand-maintained copy of cuda-bindings' default toolkit roots and must resolve the same toolkit the bindings were generated from. Give both the 13.5 through 13.0 entries added there, and update the two documents that list the roots. Signed-off-by: Temo Tskipuri Co-Authored-By: Claude Opus 5.5 --- cuda-bindings/README.md | 7 ++++--- cuda-core/build.rs | 8 ++++++++ cuda-oxide/crates/cargo-oxide/src/commands/doctor.rs | 12 ++++++++++-- .../cuda-oxide-book/getting-started/installation.md | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/cuda-bindings/README.md b/cuda-bindings/README.md index c989894a58..af8aa7ee8f 100644 --- a/cuda-bindings/README.md +++ b/cuda-bindings/README.md @@ -9,9 +9,10 @@ Use `cuda-core` for wrappers around these raw bindings. - The bindings are generated at build time from a CUDA 13.0+ toolkit. - The toolkit root is the first set variable among `CUDA_TOOLKIT_PATH` and `CUDA_HOME`; when neither is set, the build searches the standard install - locations (on Linux `/usr/local/cuda-13.3`, `/usr/local/cuda-13.2`, - `/usr/local/cuda-13`, `/usr/local/cuda`; on Windows - `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3` and `v13.2`). + locations (on Linux `/usr/local/cuda-13.5` down through + `/usr/local/cuda-13.0`, then `/usr/local/cuda-13`, `/usr/local/cuda`; on + Windows `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.5` down + through `v13.0`). - Within the toolkit, both the standard `include/` layout and the redistributable `targets//include/` layouts (Jetson/Tegra, sbsa, cross-builds, extracted redistributables) are probed for `cuda.h`. diff --git a/cuda-core/build.rs b/cuda-core/build.rs index 5e29f1cec7..3df81e2fb2 100644 --- a/cuda-core/build.rs +++ b/cuda-core/build.rs @@ -38,13 +38,21 @@ const TOOLKIT_TARGET_DIR_ENV: &str = "CUDA_TOOLKIT_TARGET_DIR"; /// `cuda.h` than the one the bindings were generated from. #[cfg(windows)] const DEFAULT_TOOLKIT_DIRS: &[&str] = &[ + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.5", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4", r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3", r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0", ]; #[cfg(not(windows))] const DEFAULT_TOOLKIT_DIRS: &[&str] = &[ + "/usr/local/cuda-13.5", + "/usr/local/cuda-13.4", "/usr/local/cuda-13.3", "/usr/local/cuda-13.2", + "/usr/local/cuda-13.1", + "/usr/local/cuda-13.0", "/usr/local/cuda-13", "/usr/local/cuda", ]; diff --git a/cuda-oxide/crates/cargo-oxide/src/commands/doctor.rs b/cuda-oxide/crates/cargo-oxide/src/commands/doctor.rs index 4af245bcb6..69887ef1db 100644 --- a/cuda-oxide/crates/cargo-oxide/src/commands/doctor.rs +++ b/cuda-oxide/crates/cargo-oxide/src/commands/doctor.rs @@ -817,16 +817,24 @@ const TOOLKIT_ENV_VARS: [&str; 2] = ["CUDA_TOOLKIT_PATH", "CUDA_HOME"]; /// preference list, not a version sort, and `/usr/local/cuda` is its *last* /// entry rather than the default. #[cfg(not(windows))] -pub(super) const DEFAULT_TOOLKIT_CANDIDATES: [&str; 4] = [ +pub(super) const DEFAULT_TOOLKIT_CANDIDATES: [&str; 8] = [ + "/usr/local/cuda-13.5", + "/usr/local/cuda-13.4", "/usr/local/cuda-13.3", "/usr/local/cuda-13.2", + "/usr/local/cuda-13.1", + "/usr/local/cuda-13.0", "/usr/local/cuda-13", "/usr/local/cuda", ]; #[cfg(windows)] -pub(super) const DEFAULT_TOOLKIT_CANDIDATES: [&str; 2] = [ +pub(super) const DEFAULT_TOOLKIT_CANDIDATES: [&str; 6] = [ + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.5", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4", r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3", r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1", + r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0", ]; /// The floor `cuda-bindings` enforces (`build.rs`, `MIN_CUDA_VERSION`): diff --git a/cuda-oxide/cuda-oxide-book/getting-started/installation.md b/cuda-oxide/cuda-oxide-book/getting-started/installation.md index 59ae7b28ae..34b6375fd6 100644 --- a/cuda-oxide/cuda-oxide-book/getting-started/installation.md +++ b/cuda-oxide/cuda-oxide-book/getting-started/installation.md @@ -128,7 +128,7 @@ nvcc --version ``` :::{tip} -If you installed CUDA to a non-default location, set `CUDA_TOOLKIT_PATH` to its root directory (the one containing `include/cuda.h`). If neither `CUDA_TOOLKIT_PATH` nor `CUDA_HOME` is set, these roots are tried in order and the first one holding a `cuda.h` of CUDA 13.0 or newer wins: `/usr/local/cuda-13.3`, `/usr/local/cuda-13.2`, `/usr/local/cuda-13`, `/usr/local/cuda`. With more than one toolkit installed, that order decides — not the highest version, and not the `/usr/local/cuda` symlink, which is last. `cargo oxide doctor` reports which root it resolved and why any earlier one was turned down. +If you installed CUDA to a non-default location, set `CUDA_TOOLKIT_PATH` to its root directory (the one containing `include/cuda.h`). If neither `CUDA_TOOLKIT_PATH` nor `CUDA_HOME` is set, these roots are tried in order and the first one holding a `cuda.h` of CUDA 13.0 or newer wins: `/usr/local/cuda-13.5`, `/usr/local/cuda-13.4`, `/usr/local/cuda-13.3`, `/usr/local/cuda-13.2`, `/usr/local/cuda-13.1`, `/usr/local/cuda-13.0`, `/usr/local/cuda-13`, `/usr/local/cuda`. With more than one toolkit installed, that order decides — not the highest version, and not the `/usr/local/cuda` symlink, which is last. `cargo oxide doctor` reports which root it resolved and why any earlier one was turned down. ::: (installation-toolkit-driver-compatibility)=