Expand description
NVIDIA backend — direct NVML calls via nvml-wrapper (runtime-loads the driver’s own
libnvidia-ml.so.1 / nvml.dll). No nvidia-smi anywhere: nvidia-smi is itself just a
CLI wrapper over this same library.
Per the domain rules in CLAUDE.md:
NOT_SUPPORTED(and any other per-metric error) maps toNone, never a failure.- The
.so.1path is tried first on Linux: driver-only installs don’t ship the unversioned.sosymlink (that comes with the CUDA toolkit) — the exact pitfall bottom hit. - Throttle mapping is edge-honest: GPU idle is deliberately NOT narrated as throttling
(an idle GPU is not slow). Configuration limiters (applications-clocks / display-clock
settings) map to the catch-all
otherso they are surfaced without being mislabeled as a thermal or power slowdown. See [map_throttle]. - WSL2 is detected once at init: per-process GPU info is N/A at the driver level
there, so
StaticInfo::process_hintexplains the empty process table up front instead of crashing on it (nvtop #432 is the cautionary tale).
Windows (v1.5, docs/design/cross-platform.md §2) — NVML is the device-truth half of the
dual-source split; the shared PDH snapshot (wddm::pdh, joined per device by the §2.5
LUID↔PCI match built at init) is the per-process half:
nvml.dllloading: modern drivers (≥461.55, ~2020+) install it intoC:\Windows\System32, which is on the defaultLoadLibraryExWsearch path — plainNvml::init()is the whole story. We do NOT probe the legacyC:\Program Files\NVIDIA Corporation\NVSMI\directory; the documented driver floor is R510+ (early 2022). Load failures (no driver, pre-2020 NVSMI-only driver,DRIVER_NOT_LOADED) map toBackendError::Unavailable— normal, backend skipped.- WDDM realities: per-metric
NOT_SUPPORTED→Noneexactly as on Linux; per-processusedGpuMemoryis always Unavailable under WDDM (the Windows kernel memory manager owns that accounting, NVML architecturally cannot see it) →None, never 0 — the per-pidGPU Process Memory\Dedicated Usagecounters from the shared PDH snapshot fill that column (§2.4), and per-pid engine busy% fillsutil_pct;process_utilization_statsis deliberately not called on Windows (§2.4); throttle reasons ARE empirically readable under WDDM and keep the same mapping as Linux; devicemem_used_bytesprefers PDH’s adapter-level Dedicated Usage (VidMm truth) over NVML’s virtualized driver view (§2.3). - Driver model: WDDM is the GeForce default; TCC (WDM) is deprecated Quadro/Tesla-only
non-display mode where NVML per-process accounting works — no special path beyond an
accurate
process_hint. A future model value (MCDM) surfaces asUnexpectedVariantand is handled, never a crash (§2.6). - MIG never arises on Windows (NVIDIA ships MIG on Linux only) — the MIG NOT_SUPPORTED-on-device-utilization caveat is a Linux-only concern.