Skip to main content

resolve_rocminfo_path

Function resolve_rocminfo_path 

Source
pub fn resolve_rocminfo_path() -> String
Expand description

Resolve the full path to the rocminfo binary.

When running via sudo, the user’s PATH is typically stripped, so bare rocminfo fails with “command not found” even though /opt/rocm/bin is in the user’s PATH. This function resolves the full path by checking known ROCm installation directories before falling back to bare rocminfo.

Resolution order:

  1. /opt/rocm/bin/rocminfo (standard ROCm install)
  2. Any /opt/rocm-*/bin/rocminfo (versioned installs, newest first)
  3. /usr/lib/rocm/bin/rocminfo (Arch AUR)
  4. rocminfo bare (last resort, relies on PATH)