Skip to content

Add CI tests for AMD GPU accelerator detection (real-hardware fixtures) - #271

Open
hmeiland wants to merge 2 commits into
EESSI:mainfrom
hmeiland:amd-accel-ci-tests
Open

Add CI tests for AMD GPU accelerator detection (real-hardware fixtures)#271
hmeiland wants to merge 2 commits into
EESSI:mainfrom
hmeiland:amd-accel-ci-tests

Conversation

@hmeiland

Copy link
Copy Markdown

Summary

Adds workflow-based CI tests for AMD GPU accelerator detection in eessi_archdetect.sh, building on the detection logic proposed in #205. All tests use output captured from real hardware (an AMD Radeon Pro V710 / NAVI32, gfx1101), so no AMD GPU is required in CI.

This addresses the AMD-CI gap tracked in #214, complementing the detection work in #205.

What's covered

accelpath()'s AMD path (from #205) has two detection methods; this PR tests both:

  • Method 1 — KFD sysfs (/sys/devices/virtual/kfd/kfd/topology/nodes/*/properties, no amd-smi/Python required). This is the path that fires on real AMD hardware where amdgpu-arch isn't in PATH. To make it testable without a GPU, the topology root is made overridable via $EESSI_KFD_TOPOLOGY_ROOT (defaults to the real sysfs path — behavior is unchanged when unset). Fixtures are captured nodes/*/properties files:
    • v710 → node 0 is a CPU node (gfx_target_version 0, must be skipped), node 1 is the GPU (gfx_target_version 110001gfx1101). Verifies the gfx_target_version → gfxMAJMINSTEP decode and the CPU-node skip.
    • cpu_only → only a CPU node → no accelerator → exit 2.
  • Method 2 — amd-smi fallback: a fake amd-smi on $PATH replays real amd-smi static --asic output (TARGET_GRAPHICS_VERSION: gfx1101), mirroring the existing nvidia-smi test pattern.

Changes

  • init/eessi_archdetect.sh: one-line change making the KFD topology root overridable via $EESSI_KFD_TOPOLOGY_ROOT (test seam; default unchanged).
  • .github/workflows/tests_archdetect_amd_gpu.yml: new workflow, analogous to tests_archdetect_nvidia_gpu.yml, with kfd_sysfs (v710, cpu_only) and amd_smi (v710) matrices.
  • tests/archdetect/kfd/{v710,cpu_only}/: captured KFD topology fixtures + expected output.
  • tests/archdetect/amd-smi/: amd-smi stub + expected output.

Verification

Verified locally against the #205 branch, and the gfx1101 result was confirmed on the live V710 (both KFD gfx_target_version=110001 and amd-smi TARGET_GRAPHICS_VERSION: gfx1101 decode to accel/amd/gfx1101):

Scenario Result
KFD / V710 fixture accel/amd/gfx1101
KFD / cpu_only exit 2 (CPU node skipped)
amd-smi stub fallback accel/amd/gfx1101
NVIDIA cc80 stub (regression) accel/nvidia/cc80 (unchanged)
No accelerators exit 2 (unchanged)

Notes

zerefwayne and others added 2 commits April 23, 2026 12:12
Adds workflow-based tests for both AMD detection methods in accelpath,
using output captured from real hardware (AMD Radeon Pro V710, gfx1101)
so no AMD GPU is required in CI:

- Method 1 (KFD sysfs): make the topology root overridable via
  $EESSI_KFD_TOPOLOGY_ROOT so captured nodes/*/properties fixtures can
  be injected. Covers the gfx_target_version -> gfxMAJMINSTEP decode and
  the CPU-node (gfx_target_version 0) skip.
- Method 2 (amd-smi): fake amd-smi stub on $PATH replaying real
  'amd-smi static --asic' output, mirroring the existing nvidia-smi tests.

New workflow tests_archdetect_amd_gpu.yml runs kfd_sysfs (v710, cpu_only)
and amd_smi (v710) matrices. NVIDIA detection and the no-accelerator
exit-2 path remain unchanged.

This work was created with the help of AI (GitHub Copilot / an AI coding assistant).
@casparvl

Copy link
Copy Markdown
Contributor

The main reason for not merging #205 and #214 way back when was that we weren't ready to expose the AMD GPU software yet (i.e. it was only accessible by explicitely setting the EESSI_ACCELERATOR_TARGET_OVERRIDE=accel/amd/gfx90a). We'd like at least the core software to be available, and functional. I guess we should have a discussion on what that core software is - we are up to the level of HIP/RCCL now. Maybe we consider that enough and we expose it? Will discuss in our support meeting.

@casparvl

Copy link
Copy Markdown
Contributor

Discussed in the support meeting. We think the time is right to actually expose this, i.e. add the archdetect support. Only challenge now is to find the time to review this PR :)

@casparvl

Copy link
Copy Markdown
Contributor

Just as a note: from the brief look I gave it, this replaces #205, but NOT #214. I.e. if this PR is approved, we should close #205 as 'superseded' by this PR, but we should probably take #214 out of draft mode and still assess it.

Note that #214 in the opening post also states we probably need to update workflows/tests_eessi_extend_module.yml. That is NOT resolved by the current PR, so that gap remains.

@hmeiland

Copy link
Copy Markdown
Author

Just as a note: from the brief look I gave it, this replaces #205, but NOT #214. I.e. if this PR is approved, we should close #205 as 'superseded' by this PR, but we should probably take #214 out of draft mode and still assess it.

Note that #214 in the opening post also states we probably need to update workflows/tests_eessi_extend_module.yml. That is NOT resolved by the current PR, so that gap remains.

on it...

@hmeiland

Copy link
Copy Markdown
Author

Superseded by #273. That PR consolidates AMD GPU accelerator detection in init/eessi_archdetect.sh plus the CI tests (KFD-topology fixtures for MI250X/MI300X/V710 + no-device cases), is rebased on current main, and has all checks passing. Please review #273 instead; closing this one shortly to avoid two competing implementations of the same detection.

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.

3 participants