Skip to main content

collect_gpu

Function collect_gpu 

Source
pub fn collect_gpu(pid: i32) -> Vec<GpuInfo>
Expand description

Attempt to collect GPU utilisation for this process.

Strategy (in order):

  1. Run nvidia-smi (NVIDIA) and parse CSV output.
  2. Walk /sys/class/drm/card*/device/ for AMD via ROCm sysfs.
  3. 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.