[CI] GitHub Actions workflow testing ROCm release backwards compatibility (#420)

* CI workflow testing compilation against older ROCm versions

* Run on ubuntu-latest

* Install git

* Fix install requirements

* Set --site to $(hostname)

* Test latest rocm release + fix logic for rocm 6.2

* Report number of processors

* Reduce the build job parallelism

- ubuntu-latest only has 2 CPUs for 8 is probably excessive

* Add explicit permissions to rocm_release_compatibility workflow

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>

[ROCm/rocprofiler-sdk commit: 7f22b66a9b]
This commit is contained in:
Madsen, Jonathan
2025-05-29 17:27:57 -05:00
committed by GitHub
parent c585122767
commit e6fcd9709a
@@ -0,0 +1,112 @@
name: ROCm Release Compatibility
permissions:
contents: read
on:
workflow_dispatch:
push:
branches: [ amd-staging, amd-mainline ]
paths-ignore:
- '*.md'
- 'source/docs/**'
- 'CODEOWNERS'
pull_request:
paths-ignore:
- '*.md'
- 'source/docs/**'
- 'CODEOWNERS'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ROCM_PATH: "/opt/rocm"
PATH: "/usr/bin:$PATH"
jobs:
rocm-release-compatibility:
strategy:
fail-fast: false
matrix:
rocm-release: ['6.2', '6.3', '6.4', 'latest']
os: ['ubuntu-22.04']
build-type: ['Release']
runs-on: ubuntu-latest
container: rocm/dev-${{ matrix.os }}:${{ matrix.rocm-release }}
# define this for containers
env:
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
steps:
- name: Install Git
timeout-minutes: 25
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:git-core/ppa
apt-get update
apt-get install -y git
- uses: actions/checkout@v4
- name: Install requirements
if: ${{ matrix.rocm-release == '6.2' }}
timeout-minutes: 10
shell: bash
run: |
git config --global --add safe.directory '*'
apt-get update
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libdw-dev libsqlite3-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
python3 -m pip install -U --user -r requirements.txt
- name: Install requirements
if: ${{ matrix.rocm-release != '6.2' }}
timeout-minutes: 10
shell: bash
run: |
git config --global --add safe.directory '*'
apt-get update
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libdw-dev libsqlite3-dev rccl-dev rccl-unittests rocjpeg-dev rocjpeg-test rocdecode-dev rocdecode-test
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
python3 -m pip install -U --user -r requirements.txt
- name: List Files
shell: bash
run: |
echo "Number of processors: $(nproc)"
echo "PATH: ${PATH}"
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
which-realpath() { echo -e "\n$1 resolves to $(realpath $(which $1))"; echo "$($(which $1) --version &> /dev/stdout | head -n 1)"; }
for i in python3 git cmake ctest gcc g++ gcov; do which-realpath $i; done
cat /opt/rocm/.info/version
ls -la
- name: Configure and Build
timeout-minutes: 30
shell: bash
run:
python3 ./source/scripts/run-ci.py -B build
--name ${{ github.repository }}-${{ github.ref_name }}-${{ matrix.os }}-rocm-${{ matrix.rocm-release }}
--build-jobs 4
--site "$(hostname)"
--stages Start Update Configure Build Submit
--run-attempt ${{ github.run_attempt }}
--disable-cdash
--
-DROCPROFILER_DEP_ROCMCORE=ON
-DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=OFF
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX="$(realpath /opt/rocm)"
-DPython3_EXECUTABLE=$(which python3)
- name: Install
timeout-minutes: 10
run:
cmake --build build --target install