Skip to content

Launching numba kernels with cuPy array arguments fails with 13.5.0 #9223

@brandon-b-miller

Description

@brandon-b-miller

Description

With cupy 13.5.0, I encounter the following error when passing a cupy array to a numba kernel:

This appears to be due to a recent error message that is now thrown when trying to construct a memoryview from a cupy array, previously this may have raised a TypeError but now we get a RuntimeError.

To Reproduce

>>> from numba import cuda
>>> import cupy as cp
>>> cuda.__version__
>>> cp.__version__
'13.5.0'
>>> @cuda.jit
... def kernel(x):
...     pass

>>> ary = cp.zeros(3)
>>> kernel[1,1](ary)
RuntimeError: Accessing a CuPy ndarry on CPU is not allowed except when using system memory (on HMM or ATS enabled systems, need to set CUPY_ENABLE_UMP=1) or managed memory

Installation

pip install "numba-cuda<0.15.0a0,>=0.14.0"
pip install cupy-cuda12x

Environment

# Paste the output here

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions