gpu_count

Function gpu_count 

Source
pub fn gpu_count(text: &str) -> Option<u32>
Expand description

2026-09-26: The device count from nvidia-smi -L, one line per visible device.

GPU 0: NVIDIA H100 80GB HBM3 (UUID: GPU-2f1c…)
GPU 1: NVIDIA H100 80GB HBM3 (UUID: GPU-9a44…)

Only lines that begin with GPU and contain : are counted, so the indented MIG 1g.10gb Device 0: … lines of a MIG-partitioned box are not.

None when no such line is present: an unreadable answer is not a box with zero GPUs, and a count of one from a missing tool would claim a single-GPU topology for a run that may have used more.