pub fn collect_gpu(pid: i32) -> Vec<GpuInfo>Expand description
Attempt to collect GPU utilisation for this process.
Strategy (in order):
- Run
nvidia-smi(NVIDIA) and parse CSV output. - Walk
/sys/class/drm/card*/device/for AMD via ROCm sysfs. - Return empty Vec if nothing is found.
Per-process memory (process_used_mb) is filled when nvidia-smi supports
--query-compute-apps and this PID has compute processes on a GPU.