cuda-doctor logo

CUDA toolkit discovery

Implementedv0.0.0

src/core/cuda_env.cpp

This file is the native CUDA-toolkit probe. It looks for `nvcc` on PATH first, falls back to `CUDA_HOME`, `CUDA_PATH`, `/usr/local/cuda`, `/opt/cuda`, and versioned sibling directories, then parses the CUDA release string from `nvcc --version` output.

Behavior

  • Collects candidate roots from environment variables and common install directories.
  • Searches for `bin/nvcc` under those roots when PATH discovery fails.
  • Parses `release X.Y` from the `nvcc --version` output.
  • Reports `missing` when `nvcc` cannot be found and `issue` when the command exists but cannot be parsed cleanly.

Caveats

This implementation proves that a toolkit is visible, not that the toolkit can target the local GPU architecture or run kernels successfully. That deeper validation still belongs to future validation and architecture-aware logic.