|
| 1 | +name: CI Linux |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + workflow_dispatch: |
| 6 | + pull_request: |
| 7 | + merge_group: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + |
| 12 | +concurrency: |
| 13 | + # A PR number if a pull request and otherwise the commit hash. This cancels |
| 14 | + # queued and in-progress runs for the same PR (presubmit) or commit |
| 15 | + # (postsubmit). |
| 16 | + group: ci-build-test-cpp-linux-${{ github.event.number || github.sha }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + name: Build (linux) |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + runs-on: |
| 26 | + - ubuntu-22.04 |
| 27 | +# - nod-ai-shared-cpubuilder-manylinux-x86_64 |
| 28 | + runs-on: ${{ matrix.runs-on }} |
| 29 | + steps: |
| 30 | + - name: Install tmate |
| 31 | + if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }} |
| 32 | + run: dnf install -y epel-release && dnf install -y tmate |
| 33 | + |
| 34 | + - name: Configure local git mirrors |
| 35 | + if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }} |
| 36 | + run: | |
| 37 | + /gitmirror/scripts/trigger_update_mirrors.sh |
| 38 | + /gitmirror/scripts/git_config.sh |
| 39 | +
|
| 40 | + - name: Install deps |
| 41 | + if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }} |
| 42 | + run: | |
| 43 | + dnf install -y almalinux-release-devel |
| 44 | + yum install -y elfutils-libelf-devel p7zip p7zip-plugins |
| 45 | +
|
| 46 | + - name: Install deps |
| 47 | + if: ${{ matrix.runs-on == 'ubuntu-22.04' }} |
| 48 | + run: | |
| 49 | + sudo apt install -y libelf-dev libnuma-dev libdrm-dev |
| 50 | +
|
| 51 | + - name: Setup Cpp |
| 52 | + if: ${{ matrix.runs-on == 'ubuntu-22.04' }} |
| 53 | + uses: aminya/setup-cpp@v1 |
| 54 | + with: |
| 55 | + compiler: llvm-18 |
| 56 | + cmake: true |
| 57 | + ninja: true |
| 58 | + ccache: true |
| 59 | + |
| 60 | + - name: "Checking out repository" |
| 61 | + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 |
| 62 | + with: |
| 63 | + submodules: recursive |
| 64 | + |
| 65 | + - name: Build and install libnuma |
| 66 | + if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }} |
| 67 | + run: | |
| 68 | + curl --silent -L \ |
| 69 | + https://github.com/numactl/numactl/releases/download/v2.0.18/numactl-2.0.18.tar.gz \ |
| 70 | + -o numactl-2.0.18.tar.gz |
| 71 | + tar -xf numactl-2.0.18.tar.gz |
| 72 | + pushd numactl-2.0.18 |
| 73 | + ./configure |
| 74 | + make install |
| 75 | + popd |
| 76 | +
|
| 77 | + - name: Hack ROCR |
| 78 | + run: | |
| 79 | + sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/blit_shaders/CMakeLists.txt |
| 80 | + sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/trap_handler/CMakeLists.txt |
| 81 | + sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/image/blit_src/CMakeLists.txt |
| 82 | +
|
| 83 | + - name: Build ROCR distro |
| 84 | + run: | |
| 85 | + rocr_dir="$(cd ${{ github.workspace }} && pwd)" |
| 86 | + build_rocr_dir="${{ github.workspace }}/rocr-build" |
| 87 | + mkdir -p "$build_rocr_dir" |
| 88 | + build_rocr_dir="$(cd $build_rocr_dir && pwd)" |
| 89 | + rocr_install_dir="${{ github.workspace }}/rocr-install" |
| 90 | + |
| 91 | + cmake -GNinja \ |
| 92 | + -DCMAKE_BUILD_TYPE=Release \ |
| 93 | + -DCMAKE_INSTALL_PREFIX="$rocr_install_dir" \ |
| 94 | + -DClang_DIR=/usr/lib/llvm-18/lib/cmake/clang \ |
| 95 | + -DLLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm \ |
| 96 | + -DIMAGE_SUPPORT=OFF \ |
| 97 | + -S "$rocr_dir" -B "$build_rocr_dir" |
| 98 | + |
| 99 | + cmake --build "$build_rocr_dir" --target install |
| 100 | + tar -cf rocr-$(git rev-parse --short HEAD).tar rocr-install |
| 101 | +
|
| 102 | + - name: Upload artifacts |
| 103 | + uses: actions/upload-artifact@v4 |
| 104 | + if: ${{ !cancelled() }} |
| 105 | + with: |
| 106 | + name: linux_x86_64_distro |
| 107 | + path: rocr-*.tar |
| 108 | + if-no-files-found: warn |
| 109 | + |
| 110 | + - name: Setup tmate session |
| 111 | + if: ${{ failure() }} |
| 112 | + |
| 113 | + with: |
| 114 | + limit-access-to-actor: true |
| 115 | + install-dependencies: ${{ matrix.runs-on == 'ubuntu-22.04' }} |
| 116 | + |
| 117 | + test_aie: |
| 118 | + name: AIE tests |
| 119 | + needs: build |
| 120 | + strategy: |
| 121 | + fail-fast: false |
| 122 | + matrix: |
| 123 | + runs-on: [linux-phoenix] |
| 124 | + runs-on: ${{ matrix.runs-on }} |
| 125 | + steps: |
| 126 | + - name: "Checking out repository" |
| 127 | + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 |
| 128 | + |
| 129 | + - name: Download artifacts |
| 130 | + uses: actions/download-artifact@v4 |
| 131 | + with: |
| 132 | + name: linux_x86_64_distro |
| 133 | + |
| 134 | + - name: Extract artifact |
| 135 | + run: | |
| 136 | + tar -xf rocr-*.tar |
| 137 | + echo hsa_runtime64_ROOT="$PWD/rocr-install" >> $GITHUB_ENV |
| 138 | +
|
| 139 | + - name: Build and run AIE smoke test |
| 140 | + run: | |
| 141 | + pushd rocrtst/suites/aie |
| 142 | + |
| 143 | + build_dir="$PWD/build" |
| 144 | + mkdir -p $build_dir |
| 145 | + cmake -GNinja \ |
| 146 | + -DCMAKE_BUILD_TYPE=Release \ |
| 147 | + "-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib/cmake/hsa-runtime64" \ |
| 148 | + -S "$PWD" -B "$build_dir" |
| 149 | + cmake --build "$build_dir" --target aie_hsa_bare_add_one |
| 150 | + |
| 151 | + "$build_dir"/aie_hsa_bare_add_one $PWD |
| 152 | + |
| 153 | + popd |
| 154 | +
|
| 155 | + - name: Build AIE test suite |
| 156 | + continue-on-error: true |
| 157 | + run: | |
| 158 | + pushd rocrtst/suites/aie |
| 159 | + |
| 160 | + build_dir="$PWD/build" |
| 161 | + mkdir -p $build_dir |
| 162 | + cmake -GNinja \ |
| 163 | + -DCMAKE_BUILD_TYPE=Release \ |
| 164 | + "-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib/cmake/hsa-runtime64" \ |
| 165 | + -S "$PWD" -B "$build_dir" |
| 166 | + cmake --build "$build_dir" --target aie_hsa_dispatch_test |
| 167 | + |
| 168 | + popd |
| 169 | +
|
| 170 | + - name: Run AIE test suite |
| 171 | + if: ${{ !failure() }} |
| 172 | + run: | |
| 173 | + pushd rocrtst/suites/aie |
| 174 | + build_dir="$PWD/build" |
| 175 | + "$build_dir"/aie_hsa_dispatch_test $PWD |
0 commit comments