From 84c025c0ba64687d52b0c7b8e9fe2cb3106a3721 Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Mon, 25 Nov 2024 17:59:29 +0100 Subject: [PATCH] test hip with librandomize_readdir --- .github/workflows/integration-tests.yml | 40 ++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index a3b85fce37..462af4c2b0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -576,7 +576,7 @@ jobs: ${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]" hip: - # Probably wouldn't matter anyway since we run in a container, but staying + # Probably wouldn't matter anyway since we run in a container, but staying # close to the version is better than not. runs-on: ubuntu-22.04 needs: build @@ -586,9 +586,11 @@ jobs: env: # SCCACHE_GHA_ENABLED: "on" ROCM_PATH: "/opt/rocm" + # LD_PRELOAD: target/debug/librandomize_readdir.so steps: - - uses: actions/checkout@v4 + - name: Clone repository + uses: actions/checkout@v4 # I don't want to break the cache during testing. Will turn on after I # make sure it's working. @@ -606,6 +608,24 @@ jobs: # script: | # core.exportVariable('ROCM_PATH', process.env.ROCM_PATH || ''); + - name: Install dependencies + shell: bash + run: | + ## Install dependencies + sudo apt-get update + sudo apt-get install -y cmake curl + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Install rust + uses: ./.github/actions/rust-toolchain + with: + toolchain: "stable" + + - name: Build & setup librandomize_readdir + run: | + cargo build -p randomize_readdir + - uses: actions/download-artifact@v4 with: name: integration-tests @@ -613,37 +633,37 @@ jobs: - name: Chmod for binary run: chmod +x ${SCCACHE_PATH} - - name: Install dependencies - shell: bash - run: | - ## Install dependencies - sudo apt-get update - sudo apt-get install -y cmake - # Ensure that HIPCC isn't already borken - name: Sanity Check run: | + export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so + echo $LD_PRELOAD + file $PWD/target/debug/librandomize_readdir.so + file $LD_PRELOAD hipcc -o vectoradd_hip --offload-arch=gfx900 tests/cmake-hip/vectoradd_hip.cpp - name: Test run: | + export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so cmake -B build -S tests/cmake-hip -DCMAKE_HIP_COMPILER_LAUNCHER=${SCCACHE_PATH} -DCMAKE_HIP_ARCHITECTURES=gfx900 cmake --build build - name: Output run: | + export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so ${SCCACHE_PATH} --show-stats - name: Test Twice for Cache Read run: | + export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so rm -rf build cmake -B build -S tests/cmake-hip -DCMAKE_HIP_COMPILER_LAUNCHER=${SCCACHE_PATH} -DCMAKE_HIP_ARCHITECTURES=gfx900 cmake --build build - name: Output run: | + export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so ${SCCACHE_PATH} --show-stats - ${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"