Skip to content

cargo oxide doctor reports the CUDA toolkit missing when it is not on PATH, right after finding four of its components #1180

Closed

Description

@vyncint

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:

  • nvcc is in the required tier, so this sets ok = false and doctor exits 1. A working environment is reported as broken.
  • cuda-gdb contradicts cargo oxide debug. codegen_debug resolves it with find_cuda_toolkit_executable, so debug finds a cuda-gdb that doctor — whose whole job is predicting whether debug will 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

  1. added 3 commits that reference this issue on Aug 24, 2026
    df32985
    37386c8
    faacc26
  2. added a commit that references this issue on Aug 28, 2026
    516f84c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions