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).
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