Skip to main content

Module linux

Module linux 

Source
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

  1. rocminfo — parses agent entries for AMD GPU devices
  2. lspci — scans PCI bus for AMD VGA devices
  3. sysfs (/sys/class/drm) — reads vendor IDs from DRM card entries

§ROCm Path Priority

  1. ROCm_PATH environment variable
  2. /opt/rocm (standard location)
  3. /opt/rocm-* versioned directories (sorted newest-first)
  4. /usr/lib/rocm, /usr/local/rocm (Arch AUR paths)
  5. /usr/lib/rocm-* versioned paths (Arch AUR)
  6. 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.