Add AMD GPU accelerator detection to archdetect (+ CI tests) - #273
Open
hmeiland wants to merge 4 commits into
Open
Add AMD GPU accelerator detection to archdetect (+ CI tests)#273hmeiland wants to merge 4 commits into
hmeiland wants to merge 4 commits into
Conversation
Author
|
Note: this PR was prepared with the assistance of AI coding tools (opencode and GitHub Copilot). |
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the WIP AMD GPU accelerator detection from #205 and makes it testable in CI.
Builds on top of #205 (which refactors
accelpath()intonvidia_accelpath()+amd_accelpath(), detects AMD GPUs via the KFD sysfs topology with anamd-smifallback, and widens the override regex to acceptaccel/amd/gfx<arch>).What this PR adds on top of #205
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).tests/archdetect/amd-kfd/KFD topology trees + expected outputs for:1xmi250x→accel/amd/gfx90a1xmi300x→accel/amd/gfx9421xv710→accel/amd/gfx1101(AMD Radeon PRO V710)no_devices(KFD present, CPU node only) → no acceleratornone(no KFD topology) → no acceleratortests_archdetect_amd_gpu.yml, mirroring the existing NVIDIA GPU accelerator-detection workflow.Testing
Verified locally:
gfx_target_version→gfx<arch>decoding:90010→gfx90a,90402→gfx942,110001→gfx1101,100300→gfx1030.accelpathagainst every fixture (via$EESSI_KFD_NODES_OVERRIDE): all expected outputs; CPU-only / absent topology → exit 2.EESSI_ACCELERATOR_TARGET_OVERRIDE=accel/amd/gfx90a) echoed back verbatim.bash -nclean; existingcpupathfixtures still pass (no regression).The
. init/bashCVMFS 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 NVIDIAcc01case).Notes
amd-smifallback (Method 2, from Add AMD GPU support to accelpath (WIP) #205) is not covered by fixtures — realamd-smioutput format is uncertain; the KFD path is primary and tested.