fix: pin CUDA_PATH to the CUDA 12.8 runtime wheel in CuPy CI - #785
Merged
Conversation
The self-hosted CuPy job fails at test collection with:
cupy.cuda.compiler.CompileException: .../libcudacxx/cuda/std/
__floating_point/storage.h(137): error: incomplete type
"__nv_fp8_e8m0" is not allowed
NVRTC comes from the nvidia-cuda-nvrtc-cu12==12.8.93 wheel, so CuPy 14's
bundled CCCL enables _CCCL_HAS_NVFP8_E8M0() (gated on CTK >= 12.8) and
forward-declares __nv_fp8_e8m0. But CuPy also passes
-I$(get_cuda_path())/include, and get_cuda_path() reads $CUDA_PATH first.
When the runner inherits CUDA_PATH=/usr/local/cuda from its shell, that
directory is searched before the wheel include dir, so <cuda_fp8.h>
resolves to the system CUDA 12.2 header which has no __nv_fp8_e8m0.
Every CCCL-using kernel then fails to compile; test_poststack.py just
happens to trigger the first one at import time via filtfilt/convolve1d.
The step already rebuilds CUDA_HOME, LD_LIBRARY_PATH and NUMBA_CUDA_NVVM
from the uv wheels -- CUDA_PATH was the one that got missed. Pointing it
at the 12.8 cuda_runtime wheel makes the header and NVRTC versions agree.
Verified on the self-hosted runner: 2183 passed, 910 skipped in 6m18s.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The self-hosted
PyLops Testing with CuPyjob has been failing on every run for the last few days (e.g. run 30707829236), dying in Test with pytest after ~35s withProcess completed with exit code 2.It's a pytest collection error, not a test failure:
Nothing is wrong with pylops or with
test_poststack.pyspecifically — any CuPy kernel that pulls in CCCL headers fails to compile.test_poststack.py:31is simply the first one to run, viacupyx.scipy.signal.filtfilt→convolve1dat import time.Root cause
Mixed CUDA toolkit versions in the NVRTC include path. Dumping the real compile options from the failing kernel:
nvidia-cuda-nvrtc-cu12==12.8.93wheel this workflow installs), so CuPy 14's bundled CCCL enables_CCCL_HAS_NVFP8_E8M0()— gated on_CCCL_CTK_AT_LEAST(12, 8)— and forward-declares__nv_fp8_e8m0.<cuda_fp8.h>resolves against the first matching-I, which is/usr/local/cuda/include. The system toolkit on the runner is CUDA 12.2.2, whosecuda_fp8.hpredates__nv_fp8_e8m0→ incomplete type.That
-I/usr/local/cuda/includecomes fromcupy._environment.get_cuda_path(), which reads$CUDA_PATHahead of everything else. The runner inheritsCUDA_PATH=/usr/local/cudafrom the shell it was launched in, so CuPy keeps pointing at the system 12.2 toolkit no matter what the workflow does.This is an environment change rather than a dependency change —
uv.lockhas not moved (CuPy has been 14.0.1 throughout), and the job was green until the runner was re-registered.Fix
The
Configure CUDA NVVM from uv wheelsstep already rebuildsCUDA_HOME,LD_LIBRARY_PATHandNUMBA_CUDA_NVVMfrom the uv wheels —CUDA_PATHwas the one that got missed. Pointing it at the 12.8cuda_runtimewheel (which ships a completeinclude/tree,__nv_fp8_e8m0included) makes the header and NVRTC versions agree:echo "CUDA_HOME=$CUDA_HOME" >> "$GITHUB_ENV" + echo "CUDA_PATH=$CUDA_RUNTIME_ROOT" >> "$GITHUB_ENV" echo "CUDA_NVVM_LIB=$CUDA_HOME/nvvm/lib64" >> "$GITHUB_ENV"$CUDA_RUNTIME_ROOTis already defined at the top of that step, so this needs no other changes.Verification
Ran the job's exact command and environment on the self-hosted runner, with only
CUDA_PATHcorrected:Exit code 0, and the 6m18s runtime matches the last green runs of this workflow.
Worth noting separately: it would be more robust to also start the runner with a clean environment (
env -u CUDA_PATH -u CUDA_HOME ./run.sh, or install it as a service viasvc.sh) so host shell variables can't leak into jobs again. That's a runner-side change, not something this PR can do.🤖 Generated with Claude Code