Skip to content

Commit e19cf07

Browse files
committed
[CI] Add hip-tests kernel suite in SPIRV mode
Adds a test_hip_tests job that builds the hip-tests `kernel` catch2 unit suite with -DENABLE_SPIRV=ON and runs it via ctest on a gfx942 GPU runner. Prototype scope: just the kernel unit dir to start; expand to more unit dirs once the SPIR-V baseline is characterized. hip-tests has first-class SPIR-V support: -DENABLE_SPIRV=ON makes its own CMake set --offload-arch=amdgcnspirv and gate out cases that can't run in SPIR-V mode (per-test `if(NOT ENABLE_SPIRV)` blocks). catch2's catch_discover_tests registers each case with ctest, so we just configure -> build KernelTest -> ctest -R Kernel. Reuses the in-pipeline runtime staging tree + manylinux container + GPU passthrough from the rocm-examples job. Same lib/lib64 + libgcc runtime-lib flags. Stacked on the rocm-examples branch (shares the Build job). Will rebase onto amd-staging once #208 lands. Informational initially.
1 parent 0a855c9 commit e19cf07

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/spirv-ci-linux.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,3 +647,80 @@ jobs:
647647
for f in "${RUN_FAILED[@]}"; do echo " - $f"; done
648648
649649
[ ${#RUN_FAILED[@]} -eq 0 ]
650+
651+
# =====================================================================
652+
# Test - hip-tests (catch2 kernel suite via amdgcnspirv)
653+
# =====================================================================
654+
# Builds the hip-tests `kernel` catch2 unit suite with -DENABLE_SPIRV=ON
655+
# (which sets --offload-arch=amdgcnspirv and gates out SPIR-V-incompatible
656+
# cases), then runs it via ctest on a gfx942 GPU. Prototype scope: just
657+
# the `kernel` unit dir to start; expand to more unit dirs once the
658+
# baseline is characterized. Informational initially.
659+
test_hip_tests:
660+
name: Test hip-tests
661+
needs: build
662+
runs-on: linux-gfx942-1gpu-ossci-rocm
663+
timeout-minutes: 60
664+
# Same manylinux container + GPU passthrough as test_rocm_examples:
665+
# isolates from any system ROCm / Comgr cache on the persistent host.
666+
container:
667+
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:702a5133851e6d1daf1207d2c9fbb01c2667914a5b6dc5a01faeb3ce66ea6421
668+
options: --device=/dev/kfd --device=/dev/dri --group-add video
669+
670+
steps:
671+
- name: Checkout hip-tests (pinned)
672+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
673+
with:
674+
repository: ROCm/hip-tests
675+
ref: d01e1f96059edc25600eb13434d7e2b71c09af01 # develop, 2026-06-03
676+
path: hip-tests
677+
fetch-depth: 1
678+
persist-credentials: false
679+
680+
- name: Download build tree artifact
681+
uses: actions/download-artifact@v8
682+
with:
683+
name: linux-build-tree
684+
685+
- name: Untar build trees
686+
run: tar -xmf linux-build-tree.tar
687+
688+
- name: Install runtime deps in container
689+
run: dnf install -y numactl-libs
690+
691+
- name: Configure hip-tests (ENABLE_SPIRV)
692+
# ENABLE_SPIRV=ON makes hip-tests' own CMake set
693+
# --offload-arch=amdgcnspirv and exclude SPIR-V-incompatible cases.
694+
# Point CMAKE_HIP_COMPILER + hip's find_package at the staged tree;
695+
# HIP_PLATFORM=amd + ROCM_PATH bypass the hipconfig probe.
696+
run: |
697+
STAGING=$PWD/staging
698+
LLVM_PATH=$PWD/build
699+
cmake -S hip-tests/catch -B hip-tests-build \
700+
-DCMAKE_BUILD_TYPE=Release \
701+
-DENABLE_SPIRV=ON \
702+
-DHIP_PLATFORM=amd \
703+
-DROCM_PATH=$STAGING \
704+
-DCMAKE_PREFIX_PATH="$STAGING;$STAGING/lib/cmake" \
705+
-DCMAKE_HIP_COMPILER=$LLVM_PATH/bin/clang++ \
706+
-DCMAKE_HIP_COMPILER_ROCM_ROOT=$STAGING \
707+
-DCMAKE_HIP_ARCHITECTURES=amdgcnspirv \
708+
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
709+
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=TRUE \
710+
-DCMAKE_HIP_FLAGS="--rocm-path=$STAGING --rtlib=libgcc -unwindlib=libgcc" \
711+
-DCMAKE_HIP_LINK_FLAGS="--rtlib=libgcc -unwindlib=libgcc -L$STAGING/lib -Wl,-rpath,$STAGING/lib -Wl,--unresolved-symbols=ignore-in-shared-libs" \
712+
-DCMAKE_CXX_FLAGS="--rtlib=libgcc -unwindlib=libgcc" \
713+
-DCMAKE_EXE_LINKER_FLAGS="--rtlib=libgcc -unwindlib=libgcc -L$STAGING/lib -Wl,-rpath,$STAGING/lib -Wl,--unresolved-symbols=ignore-in-shared-libs" \
714+
-DCMAKE_SHARED_LINKER_FLAGS="--rtlib=libgcc -unwindlib=libgcc"
715+
716+
- name: Build hip-tests kernel suite
717+
run: cmake --build hip-tests-build --target KernelTest -j
718+
719+
- name: Run hip-tests kernel suite (ctest)
720+
# catch_discover_tests registered each catch2 case with ctest.
721+
# -R Kernel restricts to the kernel suite's cases. Gates on any
722+
# ctest failure.
723+
run: |
724+
STAGING=$PWD/staging
725+
export LD_LIBRARY_PATH=$STAGING/lib
726+
ctest --test-dir hip-tests-build -R Kernel --output-on-failure

0 commit comments

Comments
 (0)