Description
tl;dr: This error happens with cuda-python
12.6.1 & 11.8.4, the first patch releases with the new layout (#75). To tentatively work around this error, please downgrade cuda-python
to either 12.6.0 or below (if you’re using 12.x) or 11.8.3 or below (if you’re using 11.x).
This only impacts projects satisfying all of the following conditions:
- access CUDA Python through the Cython level (=
cimport
); through the Python level (=import
) it should work fine - were built against CUDA Python with the old layout (12.6.0 and below, or 11.8.3 and below)
- are running against the latest CUDA Python patch releases with the new layout (12.6.1 or 11.8.4)
Reproducer:
# test_cuda_python_abi.pyx
# distutils: include_dirs = /usr/local/cuda-12.6/include
from cuda.ccudart cimport cudaGetDevice
def test_function():
cdef int dev
print(cudaGetDevice(&dev))
print(dev)
Steps:
pip install "cuda-python==12.6.0"
(build against the "old layout")cythonize -i -3 -f test_cuda_python_abi.pyx
pip install "cuda-python==12.6.1"
(run against the "new layout")python -c "import test_cuda_python_abi; test_cuda_python_abi.test_function()"
Error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "test_cuda_python_abi.pyx", line 1, in init test_cuda_python_abi
# distutils: include_dirs = /usr/local/cuda-12.6/include
AttributeError: module 'cuda.ccudart' has no attribute '__pyx_capi__'