Skip to content

Add AMD GPU accelerator detection to archdetect (+ CI tests) - #273

Open
hmeiland wants to merge 4 commits into
EESSI:mainfrom
hmeiland:amdaccel-full
Open

Add AMD GPU accelerator detection to archdetect (+ CI tests)#273
hmeiland wants to merge 4 commits into
EESSI:mainfrom
hmeiland:amdaccel-full

Conversation

@hmeiland

Copy link
Copy Markdown

Completes the WIP AMD GPU accelerator detection from #205 and makes it testable in CI.

Builds on top of #205 (which refactors accelpath() into nvidia_accelpath() + amd_accelpath(), detects AMD GPUs via the KFD sysfs topology with an amd-smi fallback, and widens the override regex to accept accel/amd/gfx<arch>).

What this PR adds on top of #205

  • Testability: the KFD topology base path in amd_accelpath() can now be overridden via $EESSI_KFD_NODES_OVERRIDE (defaults to the real /sys/devices/virtual/kfd/kfd/topology/nodes). Without this the AMD detection path cannot be exercised in CI (it needs real AMD hardware + root).
  • Fixtures: tests/archdetect/amd-kfd/ KFD topology trees + expected outputs for:
    • 1xmi250xaccel/amd/gfx90a
    • 1xmi300xaccel/amd/gfx942
    • 1xv710accel/amd/gfx1101 (AMD Radeon PRO V710)
    • no_devices (KFD present, CPU node only) → no accelerator
    • none (no KFD topology) → no accelerator
  • Workflow: tests_archdetect_amd_gpu.yml, mirroring the existing NVIDIA GPU accelerator-detection workflow.

Testing

Verified locally:

  • KFD gfx_target_versiongfx<arch> decoding: 90010→gfx90a, 90402→gfx942, 110001→gfx1101, 100300→gfx1030.
  • accelpath against every fixture (via $EESSI_KFD_NODES_OVERRIDE): all expected outputs; CPU-only / absent topology → exit 2.
  • AMD override (EESSI_ACCELERATOR_TARGET_OVERRIDE=accel/amd/gfx90a) echoed back verbatim.
  • bash -n clean; existing cpupath fixtures still pass (no regression).

The . init/bash CVMFS portion of the workflow runs only on the runner (no AMD stack exists in EESSI 2023.06 yet, so a detected AMD GPU is expected to find no matching module path — modelled on the existing NVIDIA cc01 case).

Notes

@hmeiland

Copy link
Copy Markdown
Author

Note: this PR was prepared with the assistance of AI coding tools (opencode and GitHub Copilot).

zerefwayne and others added 4 commits July 28, 2026 17:31
…ests

- Add $EESSI_KFD_NODES_OVERRIDE hook so amd_accelpath() can be tested
  against fixture KFD topology trees (defaults to the real sysfs path).
- Add tests/archdetect/amd-kfd fixtures for gfx90a (MI250X), gfx942
  (MI300X), gfx1101 (Radeon PRO V710), plus no-device and no-topology cases.
- Add tests_archdetect_amd_gpu.yml workflow mirroring the NVIDIA GPU tests.
The refactor into nvidia_accelpath()/amd_accelpath() only checked for a 0
return code and fell through on any non-zero code, turning a present-but-failing
nvidia-smi (return 3) into a generic 'no accelerator' exit 2. Restore the
original semantics: a present-but-failing vendor tool is a hard error (exit 3),
while 'tool not found' (2) falls through to the next vendor. Fixes the
no_devices NVIDIA GPU test.
EESSI 2023.06 has no AMD accelerator stack, so the init script maps each
detected gfx target to its nearest supported base target (gfx90a->gfx900,
gfx942->gfx940, gfx1101->gfx1100) before reporting 'No matching path found'.
Match that line by prefix instead of pinning the exact detected gfx string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants