Skip to main content

detect_gpus

Function detect_gpus 

Source
pub fn detect_gpus() -> Vec<GpuInfo>
Expand description

Scan the system for GPU devices via sysfs PCI enumeration (Linux only)

Iterates over /sys/bus/pci/devices looking for PCI class codes that indicate display controllers:

  • 0x0300xx – VGA compatible controller
  • 0x0302xx – 3D controller (e.g., NVIDIA Tesla/datacenter GPUs)

For each GPU found, determines vendor, model name, VRAM, and device paths.