Skip to content

BUG: module 'cuda.ccudart' has no attribute '__pyx_capi__' #215

Closed
@leofang

Description

@leofang

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:

  1. access CUDA Python through the Cython level (=cimport); through the Python level (=import) it should work fine
  2. were built against CUDA Python with the old layout (12.6.0 and below, or 11.8.3 and below)
  3. 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:

  1. pip install "cuda-python==12.6.0" (build against the "old layout")
  2. cythonize -i -3 -f test_cuda_python_abi.pyx
  3. pip install "cuda-python==12.6.1" (run against the "new layout")
  4. 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__'

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings module

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions