From 7a22579c9657bbd77819f2bf925d7cee0e9aa8bf Mon Sep 17 00:00:00 2001 From: mrava87 Date: Sun, 31 May 2026 09:54:44 +0100 Subject: [PATCH 1/2] ci: fix self-hosted cupy action --- .../workflows/{buildcupy.yaml => build-cupy.yaml} | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) rename .github/workflows/{buildcupy.yaml => build-cupy.yaml} (57%) diff --git a/.github/workflows/buildcupy.yaml b/.github/workflows/build-cupy.yaml similarity index 57% rename from .github/workflows/buildcupy.yaml rename to .github/workflows/build-cupy.yaml index 5574b0f2..8aae3ec8 100644 --- a/.github/workflows/buildcupy.yaml +++ b/.github/workflows/build-cupy.yaml @@ -1,4 +1,4 @@ -name: PyLops Testing (CuPy) +name: PyLops Testing with CuPy on: pull_request: @@ -28,9 +28,20 @@ jobs: --extra deep-cu128 --all-groups ' echo "done!" + # 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 temporerely + # installed in the uv environment, and the CUDA paths are set in + # the test command, to work around this issue. + - name: Install CUDA 12.8 toolkit + run: uv add nvidia-cuda-nvcc-cu12==12.8.* - name: Test with pytest run: | srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c ' + VENV_CUDA=$(uv run python -c "import nvidia.cuda_nvcc as n, os; print(os.path.dirname(n.__file__))") + export CUDA_HOME=$VENV_CUDA + export CUDAToolkit_ROOT=$VENV_CUDA + export LD_LIBRARY_PATH=$VENV_CUDA/nvvm/lib64:$VENV_CUDA/lib64 export CUPY_PYLOPS=1 export TEST_CUPY_PYLOPS=1 uv run pytest --color=yes pytests/ From 8147ca670389349d3dba69d062a46a93de764e65 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Sun, 31 May 2026 20:55:01 +0100 Subject: [PATCH 2/2] ci: added test of buildcupy --- .github/workflows/buildcupy.yaml | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/buildcupy.yaml diff --git a/.github/workflows/buildcupy.yaml b/.github/workflows/buildcupy.yaml new file mode 100644 index 00000000..56f917f8 --- /dev/null +++ b/.github/workflows/buildcupy.yaml @@ -0,0 +1,56 @@ +name: PyLops Testing (CuPy) + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - main + - dev + +jobs: + build: + runs-on: self-hosted + steps: + - name: Check out source repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Install uv with Python 3.11 + uses: astral-sh/setup-uv@v6 + with: + 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 + ' + echo "done!" + - name: Install 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 + ' + 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/ + ' + echo "done!"