name: Continuous Integration on: workflow_dispatch: push: branches: [ "amd-staging" ] paths-ignore: - '.github/workflows/pull_*.yml' - '.github/workflows/linting.yml' - '.github/workflows/markdown_lint.yml' - '*.md' pull_request: branches: [ "amd-staging" ] paths-ignore: - '.github/workflows/pull_*.yml' - '.github/workflows/linting.yml' - '.github/workflows/markdown_lint.yml' - '*.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: # TODO(jrmadsen): replace LD_RUNPATH_FLAG, GPU_LIST, etc. with internal handling in cmake ROCM_PATH: "/opt/rocm" CMAKE_PREFIX_PATH: "/opt/rocm" LD_RUNPATH_FLAG: " -Wl,--enable-new-dtags -Wl,--rpath,/opt/rocm/lib" GPU_LIST: "gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030 gfx1100 gfx1101 gfx1102" jobs: get_latest_mainline_build_number: runs-on: mi200 outputs: LATEST_BUILD_NUMBER: ${{ steps.get_build_number.outputs.LATEST_BUILD_NUMBER }} steps: - id: get_build_number run: echo "LATEST_BUILD_NUMBER=$(wget -qO- 'http://rocm-ci.amd.com/job/compute-rocm-dkms-no-npi-hipclang/lastSuccessfulBuild/buildNumber')" >> $GITHUB_OUTPUT Mi200-Ubuntu22-Doc-Packages: # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix strategy: fail-fast: true max-parallel: 4 matrix: include: - os: 'ubuntu-22.04' runner: 'renderD129' device: '/renderD129' build-type: 'Release' ci-flags: '--coverage' name-tag: '-codecov' - os: 'ubuntu-22.04' runner: 'renderD130' device: '/renderD130' build-type: 'RelWithDebInfo' ci-flags: '' name-tag: '' runs-on: ${{ matrix.runner }} # define this for containers env: GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 container: image: compute-artifactory.amd.com:5000/rocm-plus-docker/compute-rocm-dkms-no-npi-hipclang:${{ needs.get_latest_mainline_build_number.outputs.LATEST_BUILD_NUMBER }}-${{ matrix.os }}-stg1 options: --memory=128g --cpus=32 --ipc=host --device=/dev/kfd --device=/dev/dri${{ matrix.device }} --group-add video --cap-add=SYS_PTRACE --cap-add CAP_SYS_PTRACE --cap-add CAP_SYS_ADMIN --security-opt seccomp=unconfined if: ${{ always() }} needs: get_latest_mainline_build_number steps: - uses: actions/checkout@v3 - name: List Files shell: bash run: | which-realpath() { echo "$1 resolves to $(realpath $(which $1))"; } for i in python python3 git cmake ctest; do which-realpath $i; done ls -la - name: Install Python requirements shell: bash run: pip3 install -r requirements.txt - name: Configure, Build, and Test timeout-minutes: 30 shell: bash run: python3 ./script/run-ci.py -B build --name ${{ github.repository }}-${{ github.ref_name }}-mi200-${{ matrix.os }}${{ matrix.name-tag }} --build-jobs 12 --site mi200 --gpu-targets ${{ env.GPU_LIST }} ${{ matrix.ci-flags }} -- -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="${{ env.ROCM_PATH }}" -DCMAKE_MODULE_PATH="${{ env.ROCM_PATH }}/hip/cmake;${{ env.ROCM_PATH }}/lib/cmake" -DCMAKE_SHARED_LINKER_FLAGS="${{ env.LD_RUNPATH_FLAG }}" -DCMAKE_INSTALL_RPATH=${{ env.ROCM_PATH }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DCPACK_PACKAGING_INSTALL_PREFIX=${{ env.ROCM_PATH }} -DCPACK_OBJCOPY_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-objcopy" -DCPACK_READELF_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-readelf" -DCPACK_STRIP_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-strip" -DCPACK_OBJDUMP_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-objdump" -DCPACK_GENERATOR='DEB;RPM;TGZ' -DPython3_EXECUTABLE=$(which python3) - name: Install timeout-minutes: 10 run: cmake --build build --target install --parallel 8 - name: Build Docs timeout-minutes: 10 run: cmake --build build --target doc --parallel 8 - name: Build Packaging timeout-minutes: 10 run: cmake --build build --target package --parallel 8 - name: Archive production artifacts uses: actions/upload-artifact@v3 with: name: artifacts path: | ${{github.workspace}}/build/*.deb ${{github.workspace}}/build/*.rpm ${{github.workspace}}/build/*.tgz Building-Testing: # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix strategy: fail-fast: true matrix: runner: ['vega20', 'mi100', 'navi21', 'navi32'] device: [''] os: ['ubuntu-22.04'] build-type: ['RelWithDebInfo'] ci-flags: [''] name-tag: [''] extra-options: [''] include: - os: 'rhel-8.x' runner: 'renderD131' device: '/renderD131' build-type: 'RelWithDebInfo' ci-flags: '' name-tag: '' extra-options: '--memory=128g --cpus=32' - os: 'rhel-9.x' runner: 'renderD129' device: '/renderD129' build-type: 'RelWithDebInfo' ci-flags: '' name-tag: '' extra-options: '--memory=128g --cpus=32' - os: 'sles' runner: 'renderD130' device: '/renderD130' build-type: 'RelWithDebInfo' ci-flags: '' name-tag: '' extra-options: '--memory=128g --cpus=32' - os: 'ubuntu-20.04' runner: 'renderD131' device: '/renderD131' build-type: 'RelWithDebInfo' ci-flags: '' name-tag: '' extra-options: '--memory=128g --cpus=32' runs-on: ${{ matrix.runner }} # define this for containers env: GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 container: image: compute-artifactory.amd.com:5000/rocm-plus-docker/compute-rocm-dkms-no-npi-hipclang:${{ needs.get_latest_mainline_build_number.outputs.LATEST_BUILD_NUMBER }}-${{ matrix.os }}-stg1 options: ${{ matrix.extra-options }} --ipc=host --device=/dev/kfd --device=/dev/dri${{ matrix.device }} --group-add video --cap-add=SYS_PTRACE --cap-add CAP_SYS_PTRACE --cap-add CAP_SYS_ADMIN --security-opt seccomp=unconfined if: ${{ always() }} needs: get_latest_mainline_build_number steps: - uses: actions/checkout@v3 - name: List Files shell: bash run: | which-realpath() { echo "$1 resolves to $(realpath $(which $1))"; } for i in python python3 git cmake ctest; do which-realpath $i; done ls -la - name: Install Python requirements shell: bash run: pip3 install -r requirements.txt - name: Configure, Build, and Test if: ${{ matrix.runner != 'navi32' }} timeout-minutes: 30 shell: bash run: python3 ./script/run-ci.py -B build --name ${{ github.repository }}-${{ github.ref_name }}-${{ matrix.runner }}-${{ matrix.os }}${{ matrix.name-tag }} --build-jobs 12 --site ${{ matrix.runner }} --gpu-targets ${{ env.GPU_LIST }} ${{ matrix.ci-flags }} -- -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="${{ env.ROCM_PATH }}" -DCMAKE_MODULE_PATH="${{ env.ROCM_PATH }}/hip/cmake;${{ env.ROCM_PATH }}/lib/cmake" -DCMAKE_SHARED_LINKER_FLAGS="${{ env.LD_RUNPATH_FLAG }}" -DCMAKE_INSTALL_RPATH=${{ env.ROCM_PATH }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DCPACK_PACKAGING_INSTALL_PREFIX=${{ env.ROCM_PATH }} -DCPACK_OBJCOPY_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-objcopy" -DCPACK_READELF_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-readelf" -DCPACK_STRIP_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-strip" -DCPACK_OBJDUMP_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-objdump" -DCPACK_GENERATOR='DEB;RPM;TGZ' -DPython3_EXECUTABLE=$(which python3) - name: Configure, Build, and Test if: ${{ matrix.runner == 'navi32' }} timeout-minutes: 30 shell: bash run: python3 ./script/run-ci.py -B build --name ${{ github.repository }}-${{ github.ref_name }}-${{ matrix.runner }}${{ matrix.name-tag }} --build-jobs 12 --site ${{ matrix.runner }} --gpu-targets ${{ env.GPU_LIST }} ${{ matrix.ci-flags }} -- -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="${{ env.ROCM_PATH }}" -DCMAKE_MODULE_PATH="${{ env.ROCM_PATH }}/hip/cmake;${{ env.ROCM_PATH }}/lib/cmake" -DCMAKE_SHARED_LINKER_FLAGS="${{ env.LD_RUNPATH_FLAG }}" -DCMAKE_INSTALL_RPATH=${{ env.ROCM_PATH }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DCPACK_PACKAGING_INSTALL_PREFIX=${{ env.ROCM_PATH }} -DCPACK_OBJCOPY_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-objcopy" -DCPACK_READELF_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-readelf" -DCPACK_STRIP_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-strip" -DCPACK_OBJDUMP_EXECUTABLE="${{ env.ROCM_PATH }}/llvm/bin/llvm-objdump" -DCPACK_GENERATOR='DEB;RPM;TGZ' -DPython3_EXECUTABLE=$(which python3) -- -LE v1 sanitizers: # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix strategy: fail-fast: false matrix: include: - os: 'ubuntu-22.04' runner: 'vega20' build-type: 'RelWithDebInfo' ci-flags: '' sanitizer: 'ThreadSanitizer' - os: 'ubuntu-22.04' runner: 'navi32' build-type: 'RelWithDebInfo' ci-flags: '' sanitizer: 'LeakSanitizer' - os: 'ubuntu-22.04' runner: 'mi100' build-type: 'RelWithDebInfo' ci-flags: '' sanitizer: 'AddressSanitizer' runs-on: ${{ matrix.runner }} # define this for containers env: GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 container: image: compute-artifactory.amd.com:5000/rocm-plus-docker/compute-rocm-dkms-no-npi-hipclang:${{ needs.get_latest_mainline_build_number.outputs.LATEST_BUILD_NUMBER }}-${{ matrix.os }}-stg1 options: --privileged --ipc=host --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --cap-add CAP_SYS_PTRACE --cap-add CAP_SYS_ADMIN --security-opt seccomp=unconfined if: ${{ always() }} needs: get_latest_mainline_build_number steps: - uses: actions/checkout@v3 - name: List Files shell: bash run: | which-realpath() { echo "$1 resolves to $(realpath $(which $1))"; } for i in python python3 git cmake ctest; do which-realpath $i; done ls -la - name: Install Python requirements shell: bash run: pip3 install -r requirements.txt - name: Configure, Build, and Test timeout-minutes: 30 shell: bash run: python3 ./script/run-ci.py -B build --name ${{ github.repository }}-${{ github.ref_name }}-mi100-${{ matrix.sanitizer }} --build-jobs 12 --site mi100 --gpu-targets ${{ env.GPU_LIST }} --memcheck=${{ matrix.sanitizer }} ${{ matrix.ci-flags }} -- -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="${{ env.ROCM_PATH }}" -DCMAKE_MODULE_PATH="${{ env.ROCM_PATH }}/hip/cmake;${{ env.ROCM_PATH }}/lib/cmake" -DCMAKE_SHARED_LINKER_FLAGS="${{ env.LD_RUNPATH_FLAG }}" -DCMAKE_INSTALL_RPATH=${{ env.ROCM_PATH }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DPython3_EXECUTABLE=$(which python3)