CUDA toolkit discovery
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.
Related files
Core contract
include/core/cuda_env.hpp
Declares the toolkit detection probe plus helper functions that locate `nvcc` and derive a toolkit root.
Core implementation
src/core/process.cpp
Implements PATH scanning, shell command execution, output trimming, and exit code decoding.
Core implementation
src/core/configure.cpp
Writes `.cuda-doctor.env` with `CUDA_HOME`, `PATH`, and `LD_LIBRARY_PATH` for the discovered toolkit root.