From a0eb8c1f2abcb4144ad575d79dd745409eb960bb Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Tue, 20 Jan 2026 16:09:31 -0500 Subject: [PATCH 01/10] Add TheRock CI Signed-off-by: zichguan-amd --- .github/workflows/therock_ci.yml | 223 +++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 .github/workflows/therock_ci.yml diff --git a/.github/workflows/therock_ci.yml b/.github/workflows/therock_ci.yml new file mode 100644 index 000000000..75080d5e0 --- /dev/null +++ b/.github/workflows/therock_ci.yml @@ -0,0 +1,223 @@ +name: Build ROCm Examples + +on: + push: + branches: [ amd-staging, amd-mainline, release/** ] + paths: + - 'Applications/**' + - 'HIP-Basic/**' + - 'HIP-Doc/**' + - 'Libraries/**' + - 'Programming-Guide/**' + - 'Tools/**' + - 'Tutorials/**' + - 'Common/**' + - 'CMakeLists.txt' + - 'Makefile' + - '.github/workflows/**' + pull_request: + branches: [ amd-staging, amd-mainline, release/** ] + paths: + - 'Applications/**' + - 'HIP-Basic/**' + - 'HIP-Doc/**' + - 'Libraries/**' + - 'Programming-Guide/**' + - 'Tools/**' + - 'Tutorials/**' + - 'Common/**' + - 'CMakeLists.txt' + - 'Makefile' + - '.github/workflows/**' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + +env: + DEBIAN_FRONTEND: noninteractive + +jobs: + build: + name: "TheRock - ${{ matrix.gpu_config.gpu_target }} - ${{ matrix.install_method }}" + runs-on: [self-hosted, Linux, "${{ matrix.gpu_config.therock_family }}"] + container: + image: ubuntu:22.04 + options: + --group-add video + --device /dev/kfd + --device /dev/dri + --security-opt seccomp=unconfined + strategy: + fail-fast: false + matrix: + install_method: ['wheel', 'tarball'] + gpu_config: + - gpu_target: gfx1100 + therock_family: gfx110X-all + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + shell: bash + run: | + apt-get update -qq && + apt-get install -y git wget curl build-essential python3.11 python3.11-venv libdw-dev libglfw3-dev libvulkan-dev glslang-tools libtiff-dev libopencv-dev + + - name: Setup virtual environment + shell: bash + run: | + python3.11 -m venv .venv + source .venv/bin/activate + pip install pyyaml cmake + + # persist the virtual environment + echo "$PWD/.venv/bin" >> $GITHUB_PATH + echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV + + - name: Install TheRock Python wheel + if: ${{ matrix.install_method == 'wheel' }} + shell: bash + run: | + pip install --no-cache-dir --index-url https://rocm.nightlies.amd.com/v2/${{ matrix.gpu_config.therock_family }}/ \ + "rocm[libraries,devel]" + + - name: Wheel sanity check + if: ${{ matrix.install_method == 'wheel' }} + id: sanity-check + shell: bash + run: | + ROCM_VERSION=$(rocm-sdk version) + echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT + echo "## ROCm Version: $ROCM_VERSION" >> $GITHUB_STEP_SUMMARY + rocm-sdk init + rocm-sdk test + + - name: Setup environment variables (wheel) + if: ${{ matrix.install_method == 'wheel' }} + shell: bash + run: | + ROCM_PATH=$(rocm-sdk path --root) + echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PLATFORM=amd" >> $GITHUB_ENV + echo "HIP_DEVICE_LIB_PATH=$ROCM_PATH/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV + echo "$ROCM_PATH/bin" >> $GITHUB_PATH + echo "$ROCM_PATH/llvm/bin" >> $GITHUB_PATH + + - name: Install TheRock tarball + if: ${{ matrix.install_method == 'tarball' }} + shell: bash + run: | + LATEST_TARBALL=$(curl -s https://rocm.nightlies.amd.com/tarball/ | grep -oE "therock-dist-linux-${{ matrix.gpu_config.therock_family }}-[0-9]+\.[0-9]+\.\w+\.tar\.gz" | tail -1) + mkdir /therock-tarball && cd /therock-tarball + wget https://rocm.nightlies.amd.com/tarball/$LATEST_TARBALL + mkdir install + tar -xzf $LATEST_TARBALL -C install + + ROCM_VERSION=$(echo $LATEST_TARBALL | grep -oE "[0-9]+\.[0-9]+\.\w+") + echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT + echo "## ROCm Version: $ROCM_VERSION" >> $GITHUB_STEP_SUMMARY + echo "## Tarball link: https://rocm.nightlies.amd.com/tarball/$LATEST_TARBALL" >> $GITHUB_STEP_SUMMARY + + - name: Setup environment variables (tarball) + if: ${{ matrix.install_method == 'tarball' }} + shell: bash + run: | + ROCM_PATH=/therock-tarball/install + echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PLATFORM=amd" >> $GITHUB_ENV + echo "HIP_DEVICE_LIB_PATH=$ROCM_PATH/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV + echo "$ROCM_PATH/bin" >> $GITHUB_PATH + echo "$ROCM_PATH/llvm/bin" >> $GITHUB_PATH + + - name: CMake configure + shell: bash + run: | + cmake -S . -B build -DCMAKE_HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}" -DROCM_ROOT="$ROCM_PATH" -DCMAKE_BUILD_RPATH="$ROCM_PATH/lib" -Wno-dev 2> >(tee cmake_error.log >&2) + + - name: CMake configure error summary + if: ${{ !cancelled() }} + shell: bash + run: | + if [ ! -f cmake_error.log ]; then + exit 0 + fi + + echo "## CMake Configure" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Count warnings and errors + WARNINGS=$(grep -ci "warning" cmake_error.log || true) + ERRORS=$(grep -ci "error" cmake_error.log || true) + + echo "| Status | Count |" >> $GITHUB_STEP_SUMMARY + echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY + echo "| Warnings | $WARNINGS |" >> $GITHUB_STEP_SUMMARY + echo "| Errors | $ERRORS |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Show details if there are warnings/errors + if [ -s cmake_error.log ]; then + echo "
CMake error log" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat cmake_error.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "
" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + else + echo "Clean configure - no warnings or errors" >> $GITHUB_STEP_SUMMARY + fi + + - name: CMake build + shell: bash + run: | + cmake --build build -j + + - name: Upload build artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: rocm-examples-build-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version }}-${{ matrix.install_method }} + path: build/ + + - name: Run tests + shell: bash + run: | + ctest --test-dir build --output-on-failure 2>&1 | tee ctest_output.log + + - name: Test summary + if: ${{ !cancelled() }} + shell: bash + run: | + if [ ! -f ctest_output.log ]; then + exit 0 + fi + + # Generate summary + echo "## Test summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Parse test result + SUMMARY=$(grep "tests passed" ctest_output.log) + echo "**$SUMMARY**" >> $GITHUB_STEP_SUMMARY + + # Count passed/failed + FAILED=$(grep -c "Failed" ctest_output.log || true) + + # Show failed tests if any + if [ "$FAILED" -gt 0 ]; then + echo "
Failed tests output" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + # Extract failed test output + awk '/^[[:space:]]*Start[[:space:]]+[0-9]+:/ {found=0; next} /\*\*\*/ && !/Passed/ {found=1} found' ctest_output.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "
" >> $GITHUB_STEP_SUMMARY + fi From b094878c6f1e547be1af6666730c9ec53d32cbfd Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Tue, 20 Jan 2026 17:16:41 -0500 Subject: [PATCH 02/10] Move build-only workflows to GitHub-hosted runners Signed-off-by: zichguan-amd --- .github/workflows/build_docker.yml | 2 +- .github/workflows/build_libraries.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 1c95fec1c..4e93c209b 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -15,7 +15,7 @@ on: jobs: find-dockerfiles: name: Find Dockerfiles - runs-on: self-hosted + runs-on: ubuntu-latest outputs: files: ${{ steps.find-files.outputs.files }} steps: diff --git a/.github/workflows/build_libraries.yml b/.github/workflows/build_libraries.yml index e757dcd8a..804d5c393 100644 --- a/.github/workflows/build_libraries.yml +++ b/.github/workflows/build_libraries.yml @@ -21,7 +21,7 @@ env: jobs: build: name: "Build Libraries Examples" - runs-on: self-hosted + runs-on: ubuntu-latest container: image: ubuntu:22.04 steps: From 77491d5a2e699f17e85269fb52b81fe04301c76c Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Tue, 20 Jan 2026 17:20:00 -0500 Subject: [PATCH 03/10] Add cancel-in-progress to all workflows Signed-off-by: zichguan-amd --- .github/workflows/build_applications.yml | 4 ++++ .github/workflows/build_applications_cuda.yml | 4 ++++ .github/workflows/build_applications_vs.yml | 4 ++++ .github/workflows/build_docker.yml | 6 +++++- .github/workflows/build_hip_basic.yml | 4 ++++ .github/workflows/build_hip_basic_cuda.yml | 4 ++++ .github/workflows/build_hip_basic_vs.yml | 4 ++++ .github/workflows/build_hip_documentation.yml | 4 ++++ .github/workflows/build_hip_documentation_cuda.yml | 4 ++++ .github/workflows/build_hip_documentation_vs.yml | 4 ++++ .github/workflows/build_libraries.yml | 4 ++++ .github/workflows/build_libraries_cuda.yml | 4 ++++ .github/workflows/build_libraries_vs.yml | 4 ++++ .github/workflows/build_portable_sln.yml | 4 ++++ .github/workflows/build_programming_guide.yml | 4 ++++ .github/workflows/build_programming_guide_cuda.yml | 4 ++++ .github/workflows/build_programming_guide_vs.yml | 4 ++++ .github/workflows/build_tools.yml | 4 ++++ .github/workflows/linting.yml | 4 ++++ 19 files changed, 77 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_applications.yml b/.github/workflows/build_applications.yml index 010ffa006..114cfc560 100644 --- a/.github/workflows/build_applications.yml +++ b/.github/workflows/build_applications.yml @@ -12,6 +12,10 @@ on: - 'Applications/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.1.1' diff --git a/.github/workflows/build_applications_cuda.yml b/.github/workflows/build_applications_cuda.yml index 677a8d696..cbc98aba9 100644 --- a/.github/workflows/build_applications_cuda.yml +++ b/.github/workflows/build_applications_cuda.yml @@ -12,6 +12,10 @@ on: - 'Applications/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.0' diff --git a/.github/workflows/build_applications_vs.yml b/.github/workflows/build_applications_vs.yml index 6e6de6853..e1064e240 100644 --- a/.github/workflows/build_applications_vs.yml +++ b/.github/workflows/build_applications_vs.yml @@ -14,6 +14,10 @@ on: - '.github/workflows/**' - 'Scripts/VisualStudio/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: PLATFORM_TOOLSET_VERSION: 6.4 HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 4e93c209b..f0088b65c 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -11,7 +11,11 @@ on: paths: - 'Dockerfiles/**' - '.github/workflows/**' - + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + jobs: find-dockerfiles: name: Find Dockerfiles diff --git a/.github/workflows/build_hip_basic.yml b/.github/workflows/build_hip_basic.yml index 3f8150b16..27783cb28 100644 --- a/.github/workflows/build_hip_basic.yml +++ b/.github/workflows/build_hip_basic.yml @@ -12,6 +12,10 @@ on: - 'HIP-Basic/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.1.1' diff --git a/.github/workflows/build_hip_basic_cuda.yml b/.github/workflows/build_hip_basic_cuda.yml index 80bf2676a..a5ec70b50 100644 --- a/.github/workflows/build_hip_basic_cuda.yml +++ b/.github/workflows/build_hip_basic_cuda.yml @@ -12,6 +12,10 @@ on: - 'HIP-Basic/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.0' diff --git a/.github/workflows/build_hip_basic_vs.yml b/.github/workflows/build_hip_basic_vs.yml index 29a38a567..2061b6c8a 100644 --- a/.github/workflows/build_hip_basic_vs.yml +++ b/.github/workflows/build_hip_basic_vs.yml @@ -14,6 +14,10 @@ on: - '.github/workflows/**' - 'Scripts/VisualStudio/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: PLATFORM_TOOLSET_VERSION: 6.4 HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ diff --git a/.github/workflows/build_hip_documentation.yml b/.github/workflows/build_hip_documentation.yml index 8318cb610..f2d6def47 100644 --- a/.github/workflows/build_hip_documentation.yml +++ b/.github/workflows/build_hip_documentation.yml @@ -12,6 +12,10 @@ on: - 'HIP-Doc/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.1.1' diff --git a/.github/workflows/build_hip_documentation_cuda.yml b/.github/workflows/build_hip_documentation_cuda.yml index f84e2eac7..5eb195d42 100644 --- a/.github/workflows/build_hip_documentation_cuda.yml +++ b/.github/workflows/build_hip_documentation_cuda.yml @@ -12,6 +12,10 @@ on: - 'HIP-Doc/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.0' diff --git a/.github/workflows/build_hip_documentation_vs.yml b/.github/workflows/build_hip_documentation_vs.yml index e1a28a8d3..d6edeaa78 100644 --- a/.github/workflows/build_hip_documentation_vs.yml +++ b/.github/workflows/build_hip_documentation_vs.yml @@ -14,6 +14,10 @@ on: - '.github/workflows/**' - 'Scripts/VisualStudio/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: PLATFORM_TOOLSET_VERSION: 6.4 HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ diff --git a/.github/workflows/build_libraries.yml b/.github/workflows/build_libraries.yml index 804d5c393..c8e0b7656 100644 --- a/.github/workflows/build_libraries.yml +++ b/.github/workflows/build_libraries.yml @@ -12,6 +12,10 @@ on: - 'Libraries/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.1.1' diff --git a/.github/workflows/build_libraries_cuda.yml b/.github/workflows/build_libraries_cuda.yml index bcaf6f00c..5a7bc81cd 100644 --- a/.github/workflows/build_libraries_cuda.yml +++ b/.github/workflows/build_libraries_cuda.yml @@ -12,6 +12,10 @@ on: - 'Libraries/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.0' diff --git a/.github/workflows/build_libraries_vs.yml b/.github/workflows/build_libraries_vs.yml index 44542d8d9..b9f9e5f56 100644 --- a/.github/workflows/build_libraries_vs.yml +++ b/.github/workflows/build_libraries_vs.yml @@ -14,6 +14,10 @@ on: - '.github/workflows/**' - 'Scripts/VisualStudio/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: PLATFORM_TOOLSET_VERSION: 6.4 HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ diff --git a/.github/workflows/build_portable_sln.yml b/.github/workflows/build_portable_sln.yml index 90c19b2a2..4790c8a5e 100644 --- a/.github/workflows/build_portable_sln.yml +++ b/.github/workflows/build_portable_sln.yml @@ -22,6 +22,10 @@ on: - '.github/workflows/**' - 'Scripts/VisualStudio/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: PLATFORM_TOOLSET_VERSION: 6.4 HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ diff --git a/.github/workflows/build_programming_guide.yml b/.github/workflows/build_programming_guide.yml index 2370424ed..2590e9d64 100644 --- a/.github/workflows/build_programming_guide.yml +++ b/.github/workflows/build_programming_guide.yml @@ -12,6 +12,10 @@ on: - 'Programming-Guide/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.1.1' diff --git a/.github/workflows/build_programming_guide_cuda.yml b/.github/workflows/build_programming_guide_cuda.yml index ed8f21bbb..680521140 100644 --- a/.github/workflows/build_programming_guide_cuda.yml +++ b/.github/workflows/build_programming_guide_cuda.yml @@ -12,6 +12,10 @@ on: - 'Programming-Guide/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive ROCM_VERSION: '7.0' diff --git a/.github/workflows/build_programming_guide_vs.yml b/.github/workflows/build_programming_guide_vs.yml index 87e07656a..168c3e487 100644 --- a/.github/workflows/build_programming_guide_vs.yml +++ b/.github/workflows/build_programming_guide_vs.yml @@ -14,6 +14,10 @@ on: - '.github/workflows/**' - 'Scripts/VisualStudio/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: PLATFORM_TOOLSET_VERSION: 6.4 HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ diff --git a/.github/workflows/build_tools.yml b/.github/workflows/build_tools.yml index 1500b84e9..f43cd8440 100644 --- a/.github/workflows/build_tools.yml +++ b/.github/workflows/build_tools.yml @@ -12,6 +12,10 @@ on: - 'Tools/**' - '.github/workflows/**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: ROCM_VERSION: '7.1.1' AMDGPU_INSTALLER_VERSION: 7.1.1.70101-1 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index a77ba6457..8581ef2d4 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -12,6 +12,10 @@ on: - amd-mainline - 'release/rocm-rel*' +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + env: DEBIAN_FRONTEND: noninteractive CLANG_FORMAT: /usr/lib/llvm-18/bin/clang-format From a22959c7af361dd9312599002d58ed1cf71bad22 Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Wed, 21 Jan 2026 11:56:31 -0500 Subject: [PATCH 04/10] Move build_libraries to self-hosted due to large storage need Signed-off-by: zichguan-amd --- .github/workflows/build_libraries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_libraries.yml b/.github/workflows/build_libraries.yml index c8e0b7656..ca2f1f461 100644 --- a/.github/workflows/build_libraries.yml +++ b/.github/workflows/build_libraries.yml @@ -25,7 +25,7 @@ env: jobs: build: name: "Build Libraries Examples" - runs-on: ubuntu-latest + runs-on: self-hosted container: image: ubuntu:22.04 steps: From 067b97abdab4d3345c6be4de673f8bfd617d877d Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Thu, 22 Jan 2026 12:38:41 -0500 Subject: [PATCH 05/10] Resolve comments Signed-off-by: zichguan-amd --- .../workflows/{therock_ci.yml => ci_therock.yml} | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) rename .github/workflows/{therock_ci.yml => ci_therock.yml} (94%) diff --git a/.github/workflows/therock_ci.yml b/.github/workflows/ci_therock.yml similarity index 94% rename from .github/workflows/therock_ci.yml rename to .github/workflows/ci_therock.yml index 75080d5e0..a16387c9b 100644 --- a/.github/workflows/therock_ci.yml +++ b/.github/workflows/ci_therock.yml @@ -29,6 +29,7 @@ on: - 'CMakeLists.txt' - 'Makefile' - '.github/workflows/**' + workflow_dispatch: permissions: contents: read @@ -111,13 +112,17 @@ jobs: - name: Install TheRock tarball if: ${{ matrix.install_method == 'tarball' }} + id: install-tarball shell: bash run: | - LATEST_TARBALL=$(curl -s https://rocm.nightlies.amd.com/tarball/ | grep -oE "therock-dist-linux-${{ matrix.gpu_config.therock_family }}-[0-9]+\.[0-9]+\.\w+\.tar\.gz" | tail -1) + LATEST_TARBALL=$(curl -s https://rocm.nightlies.amd.com/tarball/ \ + | grep -oE "therock-dist-linux-${{ matrix.gpu_config.therock_family }}-[0-9]+\.[0-9]+\.\w+\.tar\.gz" \ + | sort -V \ + | tail -1) mkdir /therock-tarball && cd /therock-tarball - wget https://rocm.nightlies.amd.com/tarball/$LATEST_TARBALL + wget "https://rocm.nightlies.amd.com/tarball/$LATEST_TARBALL" mkdir install - tar -xzf $LATEST_TARBALL -C install + tar -xzf "$LATEST_TARBALL" -C install ROCM_VERSION=$(echo $LATEST_TARBALL | grep -oE "[0-9]+\.[0-9]+\.\w+") echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT @@ -184,7 +189,7 @@ jobs: if: success() uses: actions/upload-artifact@v4 with: - name: rocm-examples-build-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version }}-${{ matrix.install_method }} + name: rocm-examples-build-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }} path: build/ - name: Run tests From 9d40a318e9cffedb4330f798a046edf7d7195ba0 Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Mon, 26 Jan 2026 13:59:19 -0500 Subject: [PATCH 06/10] Add nightly SLES 15.7 workflow Signed-off-by: zichguan-amd --- .github/workflows/ci_nightly.yml | 223 +++++++++++++++++++++++++++++++ .github/workflows/ci_therock.yml | 14 +- 2 files changed, 229 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/ci_nightly.yml diff --git a/.github/workflows/ci_nightly.yml b/.github/workflows/ci_nightly.yml new file mode 100644 index 000000000..4cdf5973f --- /dev/null +++ b/.github/workflows/ci_nightly.yml @@ -0,0 +1,223 @@ +name: Nightly CI + +on: + schedule: + # Run nightly at 2 AM UTC + - cron: '0 2 * * *' + pull_request: + branches: [ amd-staging, amd-mainline, release/** ] + paths: + - '.github/workflows/**' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + +env: + DEBIAN_FRONTEND: noninteractive + +jobs: + build: + name: "SLES 15.7 - ${{ matrix.gpu_config.gpu_target }} - ${{ matrix.install_method }}" + runs-on: [self-hosted, Linux, "${{ matrix.gpu_config.therock_family }}"] + container: + image: registry.suse.com/suse/sle15:15.7 + options: + --group-add video + --device /dev/kfd + --device /dev/dri + --security-opt seccomp=unconfined + strategy: + fail-fast: false + matrix: + install_method: ['wheel', 'tarball'] + gpu_config: + - gpu_target: gfx1100 + therock_family: gfx110X-all + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + shell: bash + run: | + zypper -qni update -y + zypper -qni install -y awk unzip xz cmake gcc gcc-c++ wget git python313 libdw-devel Mesa-libGL-devel wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel + + # build and install GLFW 3.4 + wget https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip + unzip glfw-3.4.zip + cmake -S glfw-3.4 -B glfw-3.4/build -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF + cmake --build glfw-3.4/build --target install + + # build and install Vulkan SDK 1.4.335.0 + wget https://sdk.lunarg.com/sdk/download/1.4.335.0/linux/vulkansdk-linux-x86_64-1.4.335.0.tar.xz + tar -xvf vulkansdk-linux-x86_64-1.4.335.0.tar.xz -C $GITHUB_WORKSPACE + + VULKAN_SDK=$GITHUB_WORKSPACE/1.4.335.0/x86_64 + echo "VULKAN_SDK=$VULKAN_SDK" >> $GITHUB_ENV + echo "PATH=$VULKAN_SDK/bin:$PATH" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> $GITHUB_ENV + echo "VK_ADD_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=$VULKAN_SDK/share/pkgconfig:$VULKAN_SDK/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" >> $GITHUB_ENV + + - name: Setup virtual environment + shell: bash + run: | + python3.13 -m venv $GITHUB_WORKSPACE/.venv + source $GITHUB_WORKSPACE/.venv/bin/activate + pip install pyyaml cmake + + # issue https://github.com/actions/runner/issues/3210: + # using $GITHUB_PATH breaks subsequent steps if base image does not have $PATH + + # persist the virtual environment + echo "PATH=$PATH" >> $GITHUB_ENV + echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV + + - name: Install TheRock Python wheel + if: ${{ matrix.install_method == 'wheel' }} + shell: bash + run: | + pip install --no-cache-dir --index-url https://rocm.nightlies.amd.com/v2/${{ matrix.gpu_config.therock_family }}/ \ + "rocm[libraries,devel]" + + - name: Wheel sanity check + if: ${{ matrix.install_method == 'wheel' }} + id: sanity-check + shell: bash + run: | + ROCM_VERSION=$(rocm-sdk version) + echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT + echo "## ROCm Version: $ROCM_VERSION" >> $GITHUB_STEP_SUMMARY + rocm-sdk init + rocm-sdk test + continue-on-error: true + + - name: Setup environment variables (wheel) + if: ${{ matrix.install_method == 'wheel' }} + shell: bash + run: | + ROCM_PATH=$(rocm-sdk path --root) + echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PLATFORM=amd" >> $GITHUB_ENV + echo "HIP_DEVICE_LIB_PATH=$ROCM_PATH/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV + echo "PATH=$ROCM_PATH/bin:$ROCM_PATH/llvm/bin:$PATH" >> $GITHUB_ENV + + - name: Install TheRock tarball + if: ${{ matrix.install_method == 'tarball' }} + id: install-tarball + shell: bash + run: | + LATEST_TARBALL=$(curl -s https://rocm.nightlies.amd.com/tarball/ | grep -oE "therock-dist-linux-${{ matrix.gpu_config.therock_family }}-[0-9]+\.[0-9]+\.\w+\.tar\.gz" | tail -1) + mkdir /therock-tarball && cd /therock-tarball + wget https://rocm.nightlies.amd.com/tarball/$LATEST_TARBALL + mkdir install + tar -xzf $LATEST_TARBALL -C install + + ROCM_VERSION=$(echo $LATEST_TARBALL | grep -oE "[0-9]+\.[0-9]+\.\w+") + echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT + echo "## ROCm Version: $ROCM_VERSION" >> $GITHUB_STEP_SUMMARY + echo "## Tarball link: https://rocm.nightlies.amd.com/tarball/$LATEST_TARBALL" >> $GITHUB_STEP_SUMMARY + + - name: Setup environment variables (tarball) + if: ${{ matrix.install_method == 'tarball' }} + shell: bash + run: | + ROCM_PATH=/therock-tarball/install + echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV + echo "HIP_PLATFORM=amd" >> $GITHUB_ENV + echo "HIP_DEVICE_LIB_PATH=$ROCM_PATH/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV + echo "PATH=$ROCM_PATH/bin:$ROCM_PATH/llvm/bin:$PATH" >> $GITHUB_ENV + + - name: CMake configure + shell: bash + run: | + cmake -S . -B build -DCMAKE_HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}" -DROCM_ROOT="$ROCM_PATH" -DCMAKE_BUILD_RPATH="$ROCM_PATH/lib" -Wno-dev 2> >(tee cmake_error.log >&2) + + - name: CMake configure error summary + if: ${{ !cancelled() }} + shell: bash + run: | + if [ ! -f cmake_error.log ]; then + exit 0 + fi + + echo "## CMake Configure" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Count warnings and errors + WARNINGS=$(grep -ci "warning" cmake_error.log || true) + ERRORS=$(grep -ci "error" cmake_error.log || true) + + echo "| Status | Count |" >> $GITHUB_STEP_SUMMARY + echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY + echo "| Warnings | $WARNINGS |" >> $GITHUB_STEP_SUMMARY + echo "| Errors | $ERRORS |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Show details if there are warnings/errors + if [ -s cmake_error.log ]; then + echo "
CMake error log" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat cmake_error.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "
" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + else + echo "Clean configure - no warnings or errors" >> $GITHUB_STEP_SUMMARY + fi + + - name: CMake build + shell: bash + run: | + cmake --build build -j + + - name: Upload build artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: rocm-examples-build-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }} + path: build/ + + - name: Run tests + shell: bash + run: | + ctest --test-dir build --output-on-failure 2>&1 | tee ctest_output.log + + - name: Test summary + if: ${{ !cancelled() }} + shell: bash + run: | + if [ ! -f ctest_output.log ]; then + exit 0 + fi + + # Generate summary + echo "## Test summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Parse test result + SUMMARY=$(grep "tests passed" ctest_output.log) + echo "**$SUMMARY**" >> $GITHUB_STEP_SUMMARY + + # Count passed/failed + FAILED=$(grep -c "Failed" ctest_output.log || true) + + # Show failed tests if any + if [ "$FAILED" -gt 0 ]; then + echo "
Failed tests output" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + # Extract failed test output + awk '/^[[:space:]]*Start[[:space:]]+[0-9]+:/ {found=0; next} /\*\*\*/ && !/Passed/ {found=1} found' ctest_output.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "
" >> $GITHUB_STEP_SUMMARY + fi diff --git a/.github/workflows/ci_therock.yml b/.github/workflows/ci_therock.yml index a16387c9b..f6f913526 100644 --- a/.github/workflows/ci_therock.yml +++ b/.github/workflows/ci_therock.yml @@ -72,13 +72,13 @@ jobs: - name: Setup virtual environment shell: bash run: | - python3.11 -m venv .venv - source .venv/bin/activate + python3.11 -m venv $GITHUB_WORKSPACE/.venv + source $GITHUB_WORKSPACE/.venv/bin/activate pip install pyyaml cmake # persist the virtual environment - echo "$PWD/.venv/bin" >> $GITHUB_PATH - echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV + echo "PATH=$PATH" >> $GITHUB_ENV + echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV - name: Install TheRock Python wheel if: ${{ matrix.install_method == 'wheel' }} @@ -107,8 +107,7 @@ jobs: echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV echo "HIP_PLATFORM=amd" >> $GITHUB_ENV echo "HIP_DEVICE_LIB_PATH=$ROCM_PATH/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV - echo "$ROCM_PATH/bin" >> $GITHUB_PATH - echo "$ROCM_PATH/llvm/bin" >> $GITHUB_PATH + echo "PATH=$ROCM_PATH/bin:$ROCM_PATH/llvm/bin:$PATH" >> $GITHUB_ENV - name: Install TheRock tarball if: ${{ matrix.install_method == 'tarball' }} @@ -138,8 +137,7 @@ jobs: echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV echo "HIP_PLATFORM=amd" >> $GITHUB_ENV echo "HIP_DEVICE_LIB_PATH=$ROCM_PATH/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV - echo "$ROCM_PATH/bin" >> $GITHUB_PATH - echo "$ROCM_PATH/llvm/bin" >> $GITHUB_PATH + echo "PATH=$ROCM_PATH/bin:$ROCM_PATH/llvm/bin:$PATH" >> $GITHUB_ENV - name: CMake configure shell: bash From 173beb39d4ba650e273d64aee89a0c59f0b5162b Mon Sep 17 00:00:00 2001 From: sshi-amd Date: Wed, 28 Jan 2026 13:44:49 -0500 Subject: [PATCH 07/10] Add ROCm base images and update CI workflows - Add sles-15.7-rocm.Dockerfile with Python venv pre-configured - Add ubuntu-22.04-rocm.Dockerfile with Python venv pre-configured - Update ci_nightly.yml to use new SLES base image - Update ci_therock.yml to use new Ubuntu base image - ROCm installation (wheel/tarball) delegated to workflow for flexibility --- .github/workflows/ci_nightly.yml | 57 ++++-------------- .github/workflows/ci_therock.yml | 21 +------ Dockerfiles/sles-15.7-rocm.Dockerfile | 73 ++++++++++++++++++++++++ Dockerfiles/ubuntu-22.04-rocm.Dockerfile | 42 ++++++++++++++ 4 files changed, 129 insertions(+), 64 deletions(-) create mode 100644 Dockerfiles/sles-15.7-rocm.Dockerfile create mode 100644 Dockerfiles/ubuntu-22.04-rocm.Dockerfile diff --git a/.github/workflows/ci_nightly.yml b/.github/workflows/ci_nightly.yml index 4cdf5973f..201ffe73d 100644 --- a/.github/workflows/ci_nightly.yml +++ b/.github/workflows/ci_nightly.yml @@ -25,7 +25,9 @@ jobs: name: "SLES 15.7 - ${{ matrix.gpu_config.gpu_target }} - ${{ matrix.install_method }}" runs-on: [self-hosted, Linux, "${{ matrix.gpu_config.therock_family }}"] container: - image: registry.suse.com/suse/sle15:15.7 + # Base image with Python venv, GLFW, Vulkan SDK pre-installed + # ROCm installation delegated to workflow (wheel or tarball) + image: ghcr.io/sshi-amd/rocm-examples-base:sles15.7-rocm options: --group-add video --device /dev/kfd @@ -42,43 +44,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install dependencies - shell: bash - run: | - zypper -qni update -y - zypper -qni install -y awk unzip xz cmake gcc gcc-c++ wget git python313 libdw-devel Mesa-libGL-devel wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel - - # build and install GLFW 3.4 - wget https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip - unzip glfw-3.4.zip - cmake -S glfw-3.4 -B glfw-3.4/build -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF - cmake --build glfw-3.4/build --target install - - # build and install Vulkan SDK 1.4.335.0 - wget https://sdk.lunarg.com/sdk/download/1.4.335.0/linux/vulkansdk-linux-x86_64-1.4.335.0.tar.xz - tar -xvf vulkansdk-linux-x86_64-1.4.335.0.tar.xz -C $GITHUB_WORKSPACE - - VULKAN_SDK=$GITHUB_WORKSPACE/1.4.335.0/x86_64 - echo "VULKAN_SDK=$VULKAN_SDK" >> $GITHUB_ENV - echo "PATH=$VULKAN_SDK/bin:$PATH" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> $GITHUB_ENV - echo "VK_ADD_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d" >> $GITHUB_ENV - echo "PKG_CONFIG_PATH=$VULKAN_SDK/share/pkgconfig:$VULKAN_SDK/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" >> $GITHUB_ENV - - - name: Setup virtual environment - shell: bash - run: | - python3.13 -m venv $GITHUB_WORKSPACE/.venv - source $GITHUB_WORKSPACE/.venv/bin/activate - pip install pyyaml cmake - - # issue https://github.com/actions/runner/issues/3210: - # using $GITHUB_PATH breaks subsequent steps if base image does not have $PATH - - # persist the virtual environment - echo "PATH=$PATH" >> $GITHUB_ENV - echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV - - name: Install TheRock Python wheel if: ${{ matrix.install_method == 'wheel' }} shell: bash @@ -140,7 +105,7 @@ jobs: shell: bash run: | cmake -S . -B build -DCMAKE_HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}" -DROCM_ROOT="$ROCM_PATH" -DCMAKE_BUILD_RPATH="$ROCM_PATH/lib" -Wno-dev 2> >(tee cmake_error.log >&2) - + - name: CMake configure error summary if: ${{ !cancelled() }} shell: bash @@ -151,17 +116,17 @@ jobs: echo "## CMake Configure" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - + # Count warnings and errors WARNINGS=$(grep -ci "warning" cmake_error.log || true) ERRORS=$(grep -ci "error" cmake_error.log || true) - + echo "| Status | Count |" >> $GITHUB_STEP_SUMMARY echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY echo "| Warnings | $WARNINGS |" >> $GITHUB_STEP_SUMMARY echo "| Errors | $ERRORS |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - + # Show details if there are warnings/errors if [ -s cmake_error.log ]; then echo "
CMake error log" >> $GITHUB_STEP_SUMMARY @@ -203,21 +168,21 @@ jobs: # Generate summary echo "## Test summary" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - + # Parse test result SUMMARY=$(grep "tests passed" ctest_output.log) echo "**$SUMMARY**" >> $GITHUB_STEP_SUMMARY - + # Count passed/failed FAILED=$(grep -c "Failed" ctest_output.log || true) - + # Show failed tests if any if [ "$FAILED" -gt 0 ]; then echo "
Failed tests output" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY # Extract failed test output - awk '/^[[:space:]]*Start[[:space:]]+[0-9]+:/ {found=0; next} /\*\*\*/ && !/Passed/ {found=1} found' ctest_output.log >> $GITHUB_STEP_SUMMARY + awk '/^[[:space:]]*Start[[:space:]]+[0-9]+:/ {found=0; next} /\*\*\*/ && !/Passed/ {found=1} found' ctest_output.log >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY echo "
" >> $GITHUB_STEP_SUMMARY fi diff --git a/.github/workflows/ci_therock.yml b/.github/workflows/ci_therock.yml index f6f913526..befa0b332 100644 --- a/.github/workflows/ci_therock.yml +++ b/.github/workflows/ci_therock.yml @@ -46,7 +46,9 @@ jobs: name: "TheRock - ${{ matrix.gpu_config.gpu_target }} - ${{ matrix.install_method }}" runs-on: [self-hosted, Linux, "${{ matrix.gpu_config.therock_family }}"] container: - image: ubuntu:22.04 + # Base image with Python venv, GLFW, Vulkan SDK pre-installed + # ROCm installation delegated to workflow (wheel or tarball) + image: ghcr.io/sshi-amd/rocm-examples-base:ubuntu22.04-rocm options: --group-add video --device /dev/kfd @@ -63,23 +65,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install dependencies - shell: bash - run: | - apt-get update -qq && - apt-get install -y git wget curl build-essential python3.11 python3.11-venv libdw-dev libglfw3-dev libvulkan-dev glslang-tools libtiff-dev libopencv-dev - - - name: Setup virtual environment - shell: bash - run: | - python3.11 -m venv $GITHUB_WORKSPACE/.venv - source $GITHUB_WORKSPACE/.venv/bin/activate - pip install pyyaml cmake - - # persist the virtual environment - echo "PATH=$PATH" >> $GITHUB_ENV - echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV - - name: Install TheRock Python wheel if: ${{ matrix.install_method == 'wheel' }} shell: bash diff --git a/Dockerfiles/sles-15.7-rocm.Dockerfile b/Dockerfiles/sles-15.7-rocm.Dockerfile new file mode 100644 index 000000000..ecbc5f044 --- /dev/null +++ b/Dockerfiles/sles-15.7-rocm.Dockerfile @@ -0,0 +1,73 @@ +FROM registry.suse.com/suse/sle15:15.7 + +ARG VULKAN_SDK_VERSION=1.4.335.0 +ARG GLFW_VERSION=3.4 + +ENV GPU_TARGET=gfx1100 +ENV THEROCK_FAMILY=gfx110X-all +ENV VULKAN_SDK_VERSION=${VULKAN_SDK_VERSION} + +RUN zypper -qni update -y && \ + zypper -qni install -y \ + awk \ + unzip \ + xz \ + cmake \ + gcc \ + gcc-c++ \ + wget \ + git \ + curl \ + python313 \ + libdw-devel \ + Mesa-libGL-devel \ + wayland-devel \ + libxkbcommon-devel \ + libXcursor-devel \ + libXi-devel \ + libXinerama-devel \ + libXrandr-devel && \ + zypper clean -a + +# Build GLFW from source (not available in SLES repos) +WORKDIR /tmp +RUN wget https://github.com/glfw/glfw/releases/download/${GLFW_VERSION}/glfw-${GLFW_VERSION}.zip && \ + unzip glfw-${GLFW_VERSION}.zip && \ + cmake -S glfw-${GLFW_VERSION} -B glfw-${GLFW_VERSION}/build \ + -DGLFW_BUILD_EXAMPLES=OFF \ + -DGLFW_BUILD_TESTS=OFF \ + -DGLFW_BUILD_DOCS=OFF && \ + cmake --build glfw-${GLFW_VERSION}/build --target install && \ + rm -rf /tmp/glfw-${GLFW_VERSION}* + +# Install Vulkan SDK +ENV VULKAN_SDK=/opt/vulkan-sdk/${VULKAN_SDK_VERSION}/x86_64 +RUN mkdir -p /opt/vulkan-sdk && \ + wget https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz && \ + tar -xvf vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz -C /opt/vulkan-sdk && \ + rm vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz + +ENV PATH="${VULKAN_SDK}/bin:${PATH}" +ENV LD_LIBRARY_PATH="${VULKAN_SDK}/lib" +ENV VK_ADD_LAYER_PATH="${VULKAN_SDK}/share/vulkan/explicit_layer.d" +ENV PKG_CONFIG_PATH="${VULKAN_SDK}/share/pkgconfig:${VULKAN_SDK}/lib/pkgconfig" + +ENV HIP_PLATFORM=amd + +# ============================================================================ +# Python virtual environment (ready for ROCm wheel or tarball installation) +# ROCm installation is delegated to the CI workflow to support both methods +# ============================================================================ + +# Create virtual environment with base packages +RUN python3.13 -m venv /opt/venv && \ + /opt/venv/bin/pip install --upgrade pip && \ + /opt/venv/bin/pip install pyyaml cmake + +# Set up virtual environment in PATH +ENV PATH="/opt/venv/bin:${PATH}" +ENV VIRTUAL_ENV="/opt/venv" + +WORKDIR /workspace + +CMD ["/bin/bash"] diff --git a/Dockerfiles/ubuntu-22.04-rocm.Dockerfile b/Dockerfiles/ubuntu-22.04-rocm.Dockerfile new file mode 100644 index 000000000..2db21a804 --- /dev/null +++ b/Dockerfiles/ubuntu-22.04-rocm.Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV GPU_TARGET=gfx1100 +ENV THEROCK_FAMILY=gfx110X-all + +# Install system dependencies +RUN apt-get update -qq && \ + apt-get install -y \ + git \ + wget \ + curl \ + xz-utils \ + build-essential \ + python3.11 \ + python3.11-venv \ + libdw-dev \ + libglfw3-dev \ + libvulkan-dev \ + glslang-tools \ + libtiff-dev \ + libopencv-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# ============================================================================ +# Python virtual environment (ready for ROCm wheel or tarball installation) +# ROCm installation is delegated to the CI workflow to support both methods +# ============================================================================ + +ENV VIRTUAL_ENV=/opt/venv +RUN python3.11 -m venv ${VIRTUAL_ENV} +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" + +RUN pip install --no-cache-dir --upgrade pip && \ + pip install --no-cache-dir pyyaml cmake + +ENV HIP_PLATFORM=amd + +WORKDIR /workspace + +CMD ["/bin/bash"] From 6492208ebaabb890b70e8640386a1feed07bc081 Mon Sep 17 00:00:00 2001 From: sshi-amd Date: Thu, 29 Jan 2026 13:23:31 -0500 Subject: [PATCH 08/10] Make ROCm base Dockerfiles GPU-agnostic Remove GPU_TARGET and THEROCK_FAMILY environment variables from the base images. These are now set at workflow runtime, allowing the same image to be used for different GPU targets. Co-authored-by: Cursor --- Dockerfiles/sles-15.7-rocm.Dockerfile | 3 +-- Dockerfiles/ubuntu-22.04-rocm.Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfiles/sles-15.7-rocm.Dockerfile b/Dockerfiles/sles-15.7-rocm.Dockerfile index ecbc5f044..b91603703 100644 --- a/Dockerfiles/sles-15.7-rocm.Dockerfile +++ b/Dockerfiles/sles-15.7-rocm.Dockerfile @@ -3,8 +3,7 @@ FROM registry.suse.com/suse/sle15:15.7 ARG VULKAN_SDK_VERSION=1.4.335.0 ARG GLFW_VERSION=3.4 -ENV GPU_TARGET=gfx1100 -ENV THEROCK_FAMILY=gfx110X-all +# GPU_TARGET and THEROCK_FAMILY are set at workflow runtime, not in the base image ENV VULKAN_SDK_VERSION=${VULKAN_SDK_VERSION} RUN zypper -qni update -y && \ diff --git a/Dockerfiles/ubuntu-22.04-rocm.Dockerfile b/Dockerfiles/ubuntu-22.04-rocm.Dockerfile index 2db21a804..a4542998e 100644 --- a/Dockerfiles/ubuntu-22.04-rocm.Dockerfile +++ b/Dockerfiles/ubuntu-22.04-rocm.Dockerfile @@ -1,8 +1,8 @@ FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive -ENV GPU_TARGET=gfx1100 -ENV THEROCK_FAMILY=gfx110X-all + +# GPU_TARGET and THEROCK_FAMILY are set at workflow runtime, not in the base image # Install system dependencies RUN apt-get update -qq && \ From bf67c461c1838d880e32ff83a82f7dd1c61295eb Mon Sep 17 00:00:00 2001 From: sshi-amd Date: Thu, 29 Jan 2026 15:11:29 -0500 Subject: [PATCH 09/10] Add dynamic CI matrix configuration via Python script Adds workflow_dispatch inputs for manual GPU target and install method selection. The configure_ci.py script determines matrix values based on whether the workflow was triggered manually or automatically. Co-authored-by: Cursor --- .github/build_tools/configure_ci.py | 62 +++++++++++++++++++++++++++++ .github/workflows/ci_therock.yml | 36 +++++++++++++++-- 2 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 .github/build_tools/configure_ci.py diff --git a/.github/build_tools/configure_ci.py b/.github/build_tools/configure_ci.py new file mode 100644 index 000000000..7f29db93a --- /dev/null +++ b/.github/build_tools/configure_ci.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +"""Configure CI matrix based on workflow inputs or defaults.""" +import os +import json + +# GPU target to TheRock family mapping +GPU_CONFIG_MAP = { + "gfx1100": "gfx110X-all", + "gfx90a": "gfx90X-dcgpu", + "gfx942": "gfx94X-dcgpu", +} + +# Default configurations for automated runs (push/PR) +DEFAULT_GPU_TARGETS = ["gfx1100"] +DEFAULT_INSTALL_METHODS = ["wheel", "tarball"] + + +def main(): + # Read inputs from environment (set by workflow) + gpu_input = os.getenv("GPU_CONFIG", "") + install_input = os.getenv("INSTALL_METHOD", "") + + # Determine GPU configurations + if gpu_input: + # Manual dispatch: use the single provided value + gpu_targets = [gpu_input] + else: + # Automated run: use all defaults + gpu_targets = DEFAULT_GPU_TARGETS + + # Determine install methods + if install_input: + # Manual dispatch: use the single provided value + install_methods = [install_input] + else: + # Automated run: use all defaults + install_methods = DEFAULT_INSTALL_METHODS + + # Build gpu_config array with both gpu_target and therock_family + gpu_configs = [] + for target in gpu_targets: + family = GPU_CONFIG_MAP.get(target, "gfx110X-all") + gpu_configs.append({ + "gpu_target": target, + "therock_family": family + }) + + # Write outputs to $GITHUB_OUTPUT + github_output = os.getenv("GITHUB_OUTPUT") + if github_output: + with open(github_output, "a") as f: + f.write(f"gpu_configs={json.dumps(gpu_configs)}\n") + f.write(f"install_methods={json.dumps(install_methods)}\n") + print(f"Wrote outputs to {github_output}") + else: + # Local testing + print(f"gpu_configs={json.dumps(gpu_configs)}") + print(f"install_methods={json.dumps(install_methods)}") + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/ci_therock.yml b/.github/workflows/ci_therock.yml index befa0b332..f5ed869e7 100644 --- a/.github/workflows/ci_therock.yml +++ b/.github/workflows/ci_therock.yml @@ -30,6 +30,18 @@ on: - 'Makefile' - '.github/workflows/**' workflow_dispatch: + inputs: + gpu_config: + description: "GPU configuration" + required: true + default: gfx1100 + type: string + install_method: + description: "Installation method" + required: true + default: wheel + type: choice + choices: [wheel, tarball] permissions: contents: read @@ -42,8 +54,26 @@ env: DEBIAN_FRONTEND: noninteractive jobs: + setup: + name: "Setup CI" + runs-on: ubuntu-latest + outputs: + gpu_configs: ${{ steps.config.outputs.gpu_configs }} + install_methods: ${{ steps.config.outputs.install_methods }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure CI + id: config + env: + GPU_CONFIG: ${{ github.event.inputs.gpu_config }} + INSTALL_METHOD: ${{ github.event.inputs.install_method }} + run: python3 .github/build_tools/configure_ci.py + build: name: "TheRock - ${{ matrix.gpu_config.gpu_target }} - ${{ matrix.install_method }}" + needs: [setup] runs-on: [self-hosted, Linux, "${{ matrix.gpu_config.therock_family }}"] container: # Base image with Python venv, GLFW, Vulkan SDK pre-installed @@ -57,10 +87,8 @@ jobs: strategy: fail-fast: false matrix: - install_method: ['wheel', 'tarball'] - gpu_config: - - gpu_target: gfx1100 - therock_family: gfx110X-all + install_method: ${{ fromJson(needs.setup.outputs.install_methods) }} + gpu_config: ${{ fromJson(needs.setup.outputs.gpu_configs) }} steps: - name: Checkout repository uses: actions/checkout@v4 From a2b8d468f71039a7a3b7adff2fc09692c7036fd9 Mon Sep 17 00:00:00 2001 From: sshi-amd Date: Fri, 30 Jan 2026 12:16:27 -0500 Subject: [PATCH 10/10] fix syntax error --- .github/workflows/ci_therock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_therock.yml b/.github/workflows/ci_therock.yml index f5ed869e7..1f9367b64 100644 --- a/.github/workflows/ci_therock.yml +++ b/.github/workflows/ci_therock.yml @@ -41,7 +41,7 @@ on: required: true default: wheel type: choice - choices: [wheel, tarball] + options: [wheel, tarball] permissions: contents: read