Repository navigation
Open
Labels
Component: C++Component: GPUComponent: PythonStatus: confirmedIssues confirmed as reproducible in 2026Type: bug
Description
Describe the bug, including details regarding any error messages, version, and platform.
The CUDA Python jobs have started failing on the nightly builds:
There are plenty of errors part of the output:
_____________ ERROR at setup of test_pyarrow_jit[int16-numba.cuda] _____________
module = <module 'pyarrow.tests.test_cuda_numba_interop' from '/arrow-dev/lib/python3.10/site-packages/pyarrow/tests/test_cuda_numba_interop.py'>
def setup_module(module):
np.random.seed(1234)
ctx1 = cuda.Context()
nb_ctx1 = ctx1.to_numba()
nb_ctx2 = nb_cuda.current_context()
> ctx2 = cuda.Context.from_numba(nb_ctx2)
arrow-dev/lib/python3.10/site-packages/pyarrow/tests/test_cuda_numba_interop.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E AttributeError: 'cuda.bindings.driver.CUcontext' object has no attribute 'value'
pyarrow/_cuda.pyx:84: AttributeError
___________ ERROR at setup of test_pyarrow_jit[float32-pyarrow.cuda] ___________
module = <module 'pyarrow.tests.test_cuda_numba_interop' from '/arrow-dev/lib/python3.10/site-packages/pyarrow/tests/test_cuda_numba_interop.py'>
def setup_module(module):
np.random.seed(1234)
ctx1 = cuda.Context()
nb_ctx1 = ctx1.to_numba()
nb_ctx2 = nb_cuda.current_context()
> ctx2 = cuda.Context.from_numba(nb_ctx2)
arrow-dev/lib/python3.10/site-packages/pyarrow/tests/test_cuda_numba_interop.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E AttributeError: 'cuda.bindings.driver.CUcontext' object has no attribute 'value'
pyarrow/_cuda.pyx:84: AttributeError
____________ ERROR at setup of test_pyarrow_jit[float32-numba.cuda] ____________
module = <module 'pyarrow.tests.test_cuda_numba_interop' from '/arrow-dev/lib/python3.10/site-packages/pyarrow/tests/test_cuda_numba_interop.py'>
def setup_module(module):
np.random.seed(1234)
ctx1 = cuda.Context()
nb_ctx1 = ctx1.to_numba()
nb_ctx2 = nb_cuda.current_context()
> ctx2 = cuda.Context.from_numba(nb_ctx2)
arrow-dev/lib/python3.10/site-packages/pyarrow/tests/test_cuda_numba_interop.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E AttributeError: 'cuda.bindings.driver.CUcontext' object has no attribute 'value'
I haven't investigated whether a third party dependency version difference can be the issue but looks like it.
Component(s)
C++, Python, GPU
Metadata
Metadata
Assignees
Labels
Component: C++Component: GPUComponent: PythonStatus: confirmedIssues confirmed as reproducible in 2026Type: bug
Activity
apacheGH-49437: [Python][GPU] Fix numba-cuda interop after ctypes rem…
raulcd commentedon Mar 4, 2026
This is related to this changes:
drvapi.pyin favor of directcuda-pythonusage NVIDIA/numba-cuda#784I tried a naive approach that I was pretty sure it wasn't going to work :) From what I can see we should handle both the
from_numbaandto_numbacases for the ctypes changes for numba-cuda 0.28. As we are also wrapping the handles onctypes.c_void_p(self.handle)FYI @gmarkall @pitrou
raulcd commentedon Mar 23, 2026
This has been failing for 3 weeks, @gmarkall @cpcloud @kkraus14 any idea on how to fix this?
adamreeve commentedon Mar 25, 2026
I had a quick look at this. The change in #49446 partly fixes the problem, but the context returned from
pyarrow.cuda.Context.to_numbabehaves differently to the one fromnumba.cuda.current_context().The one from
to_numbastill has ahandlewith avalueattribute, but the one fromnumba.cudadoesn't. This change fixes the tests for me but I'm not very familiar with this area of the code and this feels like a workaround rather than a proper fix. I would think that the context fromto_numbashould behave like the one fromnumba.cuda.pitrou commentedon Jun 29, 2026
The Python CUDA jobs still fail on the Numba interop tests @gmarkall @kkraus14 .
https://github.com/apache/arrow/actions/runs/28357499789
contentis commentedon Aug 19, 2026
I started to look into this and from what I can tell most of the reported issues arrise from "legacy" handling of CUDA context in numba-cuda<0.28 where
.valuewas being used vs. the new (arguably better way) of using the CUContext objects from the cuda.bindings.- Writing a compatibility wrapper for both representations should resolve this. However, my honest preference would be to require numba-cuda >=0.28 and rely entirely on native CUcontext to keep the code lean and clean.Supporting both would require some handler like
Would this be acceptable, or are there strong reasons to retain compatibility with numba-cuda<0.28?
Similarly, I think it may be worth dropping CUDA 11.x coverage and focusing on CUDA 12.x and 13.x instead, especially since current numba-cuda no longer provides a CUDA 11 extra.
raulcd commentedon Aug 20, 2026
You mean for the Python CUDA jobs? Sounds reasonable to me.
For the C++ packages we are still shipping some libarrow-cuda packages for some distros, i.e ubuntu-jammy, which use CUDA 11.
As per the fix, when I did some initial investigation I saw the API had several changes so a wrapper here sounds reasonable to me.
Thanks for taking a look at this @contentis
raulcd commentedon Oct 27, 2026
Since the 2nd of March 2026 the Python CUDA jobs have been failing. Should we just remove them? It's been 8 months failing at this point.
@pitrou @rok
pitrou commentedon Oct 27, 2026
Random ping @gmarkall @kkraus14 Do you know someone that cares about PyArrow on CUDA? Otherwise we'll end up removing CI support (and may deprecate the actual code).