Expand description
GPU inventory detection
Platform-specific GPU detection:
- Linux: Scans
/sys/bus/pci/devicesfor display controllers (VGA and 3D controllers). Identifies vendor (NVIDIA, AMD, Intel) by PCI vendor ID, reads VRAM from PCI BAR regions, and optionally usesnvidia-smifor NVIDIA-specific model and memory information. - macOS: Uses
system_profiler SPDisplaysDataType -jsonto detect Apple Silicon GPUs and unified memory viasysctl -n hw.memsize. - Other: Returns an empty GPU list.
No external dependencies required – pure sysfs/system_profiler scanning with optional
subprocess calls for enrichment.
Structs§
- GpuInfo
- Detected GPU information
Functions§
- detect_
gpus - Scan the system for GPU devices via sysfs PCI enumeration (Linux only)