CUDA toolkit probe contract
Implementedv0.0.0
include/core/cuda_env.hpp
This header is broader than the driver and GPU headers because CUDA environment work needs more than a single probe. It exposes the main probe plus two helper queries used by configuration logic.
Reference
Public APIcpp
Probe detect();
std::optional<std::filesystem::path> locate_nvcc();
std::optional<std::filesystem::path> locate_toolkit_root();Why it exists
The extra helper functions let other code reuse toolkit discovery without rerunning full report generation. `src/core/configure.cpp` relies on that separation to write `.cuda-doctor.env`.
Related files
Core implementation
src/core/cuda_env.cpp
Finds `nvcc`, searches common CUDA install roots, parses `nvcc --version`, and derives the toolkit root directory.
Core implementation
src/core/configure.cpp
Writes `.cuda-doctor.env` with `CUDA_HOME`, `PATH`, and `LD_LIBRARY_PATH` for the discovered toolkit root.