Repository navigation
Description
What happens
On an install where the CUDA toolkit is not on PATH — the layout doctor itself tells you to use — cargo oxide doctor reports the toolkit missing and exits non-zero, immediately after reporting four components of that same toolkit as found:
CUDA headers (cuda.h)... ✓ /home/.../cuda-13.3/include/cuda.h
CUDA toolkit (nvcc)... ✗ nvcc not found
libNVVM (libnvvm.so)... ✓ libNVVM 2.0
nvJitLink (libnvJitLink.so)... ✓ nvJitLink 13.3
libdevice (libdevice.10.bc)... ✓ /home/.../cuda-13.3/nvvm/libdevice/libdevice.10.bc
cuda-gdb (optional)... - not found (only needed for `cargo oxide debug`)
nvcc is present the whole time, at $CUDA_HOME/bin/nvcc, in the toolkit the four ✓ lines just resolved. cuda-gdb is reported missing by the same mechanism.
Why
doctor probes three CUDA toolkit executables, by two different mechanisms:
| tool | how doctor finds it |
how the command that uses it finds it |
|---|---|---|
compute-sanitizer |
find_cuda_toolkit_executable |
sanitize — same helper |
nvcc |
Command::new("nvcc") — PATH only |
(nothing else invokes it) |
cuda-gdb |
Command::new("cuda-gdb") — PATH only |
debug — find_cuda_toolkit_executable |
find_cuda_toolkit_executable tries PATH, then the root from CUDA_TOOLKIT_PATH / CUDA_HOME / cuda-oxide.toml, then the standard install roots. The two bare probes see only PATH.
Two consequences:
nvccis in the required tier, so this setsok = falseanddoctorexits 1. A working environment is reported as broken.cuda-gdbcontradictscargo oxide debug.codegen_debugresolves it withfind_cuda_toolkit_executable, sodebugfinds a cuda-gdb thatdoctor— whose whole job is predicting whetherdebugwill work — says is absent.
The toolkit-root contract is doctor's own stated model. Its cuda.h failure says so verbatim:
Set CUDA_TOOLKIT_PATH or CUDA_HOME to a CUDA Toolkit install root;
when neither is set, /usr/local/cuda is used.
So doctor tells you to configure the toolkit that way, and then ignores it for two of the three tools it looks for.
COMPUTE_SANITIZER_FALLBACK_PATHS records the intended rule in its own doc comment — "Shared by sanitize … and doctor so both use the same discovery order by construction." That helper arrived with the compute-sanitizer probe in #537; the older nvcc and cuda-gdb probes were never moved onto it.
Who this affects
Anyone whose CUDA toolkit is not on PATH, which includes the setup documented for building this project without a system-wide install. They are told their environment is broken when it is not, and doctor's non-zero exit is the signal the issue template asks bug reporters to attach (#956).
Scope
Exactly three toolkit executables are referenced anywhere in cargo-oxide (nvcc, cuda-gdb, compute-sanitizer); one is already correct and two are not. ptxas is not probed by doctor at all — a separate coverage question, not part of this.
I have a fix ready that routes all three through the existing helper, hoists the cuda-gdb fallback list into one constant shared by doctor and debug, and adds a source-level test so a fourth tool cannot arrive with a bare probe. Happy to open it, or to hold if you would rather the nvcc required/optional classification be settled first — I deliberately left that tier untouched, since whether nvcc should be required at all is a policy call rather than a discovery bug.
Activity
fix(cargo-oxide): doctor probes two toolkit tools on PATH only
fix(cargo-oxide): doctor probes two toolkit tools on PATH only
fix(cargo-oxide): doctor probes two toolkit tools on PATH only
fix(cargo-oxide): doctor probes two toolkit tools on PATH only (NVIDI…