Diagnosis plus repair orchestration
src/commands/doctor.cpp
This file is the current orchestration heart of the native tool. It starts with `run_check()`, layers in repo scanning or repair, appends guided next steps based on probe statuses, and recalculates the final status across the enriched probe list.
Behavior
- Starts from the read-only `check` report.
- When `auto_configure` is false, appends a repo scan probe.
- When `auto_configure` is true, appends configuration and repo auto-fix probes instead.
- Adds targeted next steps depending on which probes are missing or unhealthy.
- Special-cases macOS as unsupported and points the user toward Linux, Windows, or WSL2 for real CUDA execution.
Why it matters
This file is where the project’s product promise first starts to become real. It does more than report raw probe results: it translates them into operator guidance and repair behavior.
Current limit
The auto-repair path currently focuses on environment export files and repo manifest fixes. It does not yet patch full driver, toolkit, framework, or validation failures.
Related files
Command implementation
src/commands/check.cpp
Runs the platform, driver, CUDA, and GPU probes and summarizes them into a report.
Core implementation
src/core/configure.cpp
Writes `.cuda-doctor.env` with `CUDA_HOME`, `PATH`, and `LD_LIBRARY_PATH` for the discovered toolkit root.
Core implementation
src/core/repo.cpp
Scans build manifests for known 32-bit CUDA compatibility problems and can rewrite those patterns automatically.
Native entrypoint
src/main.cpp
Owns native argument validation, text and JSON rendering, exit codes, and the interactive handoff from `doctor` to `doctor auto`.