Expand description
Linux-specific platform detection: GPU, ROCm, and hardware introspection.
Provides GPU detection with a three-tier fallback chain (rocminfo → lspci → sysfs),
GPU architecture correction from marketing names, ROCm version detection from
/opt/rocm/.info/version, and ROCm path search with priority ordering.
§Fallback Chain
- rocminfo — parses agent entries for AMD GPU devices
- lspci — scans PCI bus for AMD VGA devices
- sysfs (
/sys/class/drm) — reads vendor IDs from DRM card entries
§ROCm Path Priority
ROCm_PATHenvironment variable/opt/rocm(standard location)/opt/rocm-*versioned directories (sorted newest-first)/usr/lib/rocm,/usr/local/rocm(Arch AUR paths)/usr/lib/rocm-*versioned paths (Arch AUR)- Derived from
which rocminfo
Functions§
- detect_
gpu - Detect AMD GPUs using the three-tier fallback chain (rocminfo → lspci → sysfs).
- detect_
rocm_ path - Detect ROCm installation path by searching common locations in priority order.
- get_
correct_ gfx_ from_ marketing_ name - Map GPU marketing name to correct gfx architecture.
- get_
rocm_ version - Detect ROCm version using multiple fallback methods.