diff --git a/.github/workflows/buildcupy.yaml b/.github/workflows/buildcupy.yaml index 56f917f8..fc8c5e12 100644 --- a/.github/workflows/buildcupy.yaml +++ b/.github/workflows/buildcupy.yaml @@ -10,7 +10,9 @@ on: jobs: build: - runs-on: self-hosted + runs-on: + - self-hosted + - exouser steps: - name: Check out source repository uses: actions/checkout@v6 @@ -22,35 +24,25 @@ jobs: python-version: 3.11 - name: Install dependencies and pylops run: | - srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c ' - uv sync --locked --extra advanced \ - --extra stat --extra gpu-cu12 \ - --extra deep-cu128 --all-groups - ' + uv sync --locked --extra advanced \ + --extra stat --extra gpu-cu12 \ + --extra deep-cu128 --all-groups echo "done!" - - name: Install CUDA 12.8 toolkit + - name: Use local CUDA 12.8 toolkit run: | - srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c ' - # Currently, the NVIDIA GPU drivers on the self-hosted runner - # and the CUDA installation in CUDA_HOME require different PTX versions - # (8.7 and 8.8, respectively). CUDA and NVCC are temporarely - # installed in the uv environment, and the CUDA paths are set in - # the test command, to work around this issue. - uv add nvidia-cuda-nvcc-cu12==12.8.* - # Numba resolves libNVVM via CUDA_HOME and needs a versioned - # libnvvm.so.N (the pip wheel only ships a bare libnvvm.so), so - # add the symlink once here against the wheel-provided toolkit. - ln -sf libnvvm.so .venv/lib/python3.11/site-packages/nvidia/cuda_nvcc/nvvm/lib64/libnvvm.so.4 - ' + if [ ! -d "$HOME/local/cuda" ]; then + echo "CUDA 12.8 toolkit not found at $HOME/local/cuda" + exit 1 + fi + echo "CUDA_HOME=$HOME/local/cuda" >> "$GITHUB_ENV" echo "done!" - name: Test with pytest run: | - srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c ' - # Use the pip-installed CUDA 12.8 toolkit (matches the 12.8 driver), - # not any system CUDA on the runner, so numba emits PTX <= 8.7. - export CUDA_HOME="$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_nvcc" - export CUPY_PYLOPS=1 - export TEST_CUPY_PYLOPS=1 - uv run pytest --color=yes pytests/ - ' + # Use the local CUDA 12.8 toolchain from $HOME/local/cuda. + export CUDA_HOME="${CUDA_HOME:-$HOME/local/cuda}" + export CUPY_PYLOPS=1 + export TEST_CUPY_PYLOPS=1 + export PATH="$CUDA_HOME/bin:$PATH" + export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH" + uv run pytest --color=yes pytests/ echo "done!"