Process abstraction
include/core/process.hpp
This header defines a minimal process helper surface: find a command, test whether it exists, run a shell command and capture exit/output, or capture output directly.
Reference
struct CommandResult { int exit_code; std::string output; };
bool command_exists(const std::string& name);
std::optional<std::filesystem::path> find_command(const std::string& name);
CommandResult run(const std::string& command);
std::string capture(const char* command);Usage
The probing files stay narrow because they rely on this interface instead of open-coding PATH scans and `popen` behavior themselves. It is a tiny portability layer for shell-based detection.
Related files
Core implementation
src/core/process.cpp
Implements PATH scanning, shell command execution, output trimming, and exit code decoding.
Core implementation
src/core/driver.cpp
Checks for `nvidia-smi` and, when available, queries the GPU driver version.
Core implementation
src/core/gpu.cpp
Uses `nvidia-smi` to ask for the GPU name and treats the driver tool as a prerequisite, not as proof that no GPU exists.
Core implementation
src/core/cuda_env.cpp
Finds `nvcc`, searches common CUDA install roots, parses `nvcc --version`, and derives the toolkit root directory.