Skip to content

Commit ab4a096

Browse files
authored
GH-47677: [C++][GPU] Allow building with CUDA 13 (#48259)
### What changes are included in this PR? 1. Add compatibility fix for CUDA 13 in C++ CUDA tests 2. Add CI builds with CUDA 13 3. Disable Numba interop tests because of a regression in Numba-CUDA: see NVIDIA/numba-cuda#611 ### Are these changes tested? Yes, on CI. ### Are there any user-facing changes? No. * GitHub Issue: #47677 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent c3c56e1 commit ab4a096

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

ci/scripts/install_numba.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ if [ -n "${ARROW_PYTHON_VENV:-}" ]; then
3434
. "${ARROW_PYTHON_VENV}/bin/activate"
3535
fi
3636

37+
# TODO: GH-47371 (install Python CUDA bindings explicitly)
38+
3739
if [ "${numba}" = "master" ]; then
3840
pip install https://github.com/numba/numba/archive/main.tar.gz#egg=numba
3941
elif [ "${numba}" = "latest" ]; then

compose.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,16 @@ services:
581581
environment:
582582
<<: [*common, *ccache, *sccache, *cpp]
583583
ARROW_BUILD_UTILITIES: "OFF"
584+
ARROW_ACERO: "OFF"
585+
ARROW_AZURE: "OFF"
584586
ARROW_COMPUTE: "OFF"
585587
ARROW_CSV: "OFF"
586588
ARROW_CUDA: "ON"
587589
ARROW_DATASET: "OFF"
588590
ARROW_ENABLE_TIMING_TESTS: "OFF"
589591
ARROW_FILESYSTEM: "OFF"
592+
ARROW_FLIGHT: "OFF"
593+
ARROW_FLIGHT_SQL: "OFF"
590594
ARROW_GANDIVA: "OFF"
591595
ARROW_GCS: "OFF"
592596
ARROW_HDFS: "OFF"
@@ -999,19 +1003,20 @@ services:
9991003
environment:
10001004
<<: [*common, *ccache, *sccache]
10011005
ARROW_BUILD_UTILITIES: "OFF"
1002-
ARROW_COMPUTE: "ON"
1003-
ARROW_CSV: "ON"
1006+
ARROW_ACERO: "OFF"
1007+
ARROW_AZURE: "OFF"
10041008
ARROW_CUDA: "ON"
1005-
ARROW_DATASET: "ON"
1009+
ARROW_DATASET: "OFF"
10061010
ARROW_ENABLE_TIMING_TESTS: "OFF"
1007-
ARROW_FILESYSTEM: "ON"
1011+
ARROW_FILESYSTEM: "OFF"
1012+
ARROW_FLIGHT: "OFF"
1013+
ARROW_FLIGHT_SQL: "OFF"
10081014
ARROW_GANDIVA: "OFF"
10091015
ARROW_GCS: "OFF"
1010-
ARROW_HDFS: "ON"
1011-
ARROW_JEMALLOC: "ON"
1012-
ARROW_JSON: "ON"
1016+
ARROW_HDFS: "OFF"
1017+
ARROW_JEMALLOC: "OFF"
10131018
ARROW_ORC: "OFF"
1014-
ARROW_PARQUET: "ON"
1019+
ARROW_PARQUET: "OFF"
10151020
ARROW_S3: "OFF"
10161021
ARROW_SUBSTRAIT: "OFF"
10171022
ARROW_WITH_OPENTELEMETRY: "OFF"

cpp/src/arrow/gpu/cuda_test.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ class TestCudaBase : public ::testing::Test {
9191

9292
Result<CUcontext> NonPrimaryRawContext() {
9393
CUcontext ctx;
94+
#if CUDA_VERSION >= 13000
95+
RETURN_NOT_OK(StatusFromCuda(cuCtxCreate(&ctx, /*ctxCreateParams=*/nullptr,
96+
/*flags=*/0, device_->handle())));
97+
#else
9498
RETURN_NOT_OK(StatusFromCuda(cuCtxCreate(&ctx, /*flags=*/0, device_->handle())));
99+
#endif
95100
non_primary_contexts_.push_back(ctx);
96101
return ctx;
97102
}

dev/tasks/tasks.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -833,23 +833,25 @@ tasks:
833833

834834
############################## CUDA tests #################################
835835

836-
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1:
836+
{% for ubuntu, cuda in [("22.04", "11.7.1"), ("24.04", "13.0.2")] %}
837+
test-cuda-cpp-ubuntu-{{ ubuntu }}-cuda-{{ cuda }}:
837838
ci: github
838839
template: docker-tests/github.cuda.yml
839840
params:
840841
env:
841-
CUDA: 11.7.1
842-
UBUNTU: 22.04
842+
CUDA: {{ cuda }}
843+
UBUNTU: {{ ubuntu }}
843844
image: ubuntu-cuda-cpp
844845

845-
test-cuda-python-ubuntu-22.04-cuda-11.7.1:
846+
test-cuda-python-ubuntu-{{ ubuntu }}-cuda-{{ cuda }}:
846847
ci: github
847848
template: docker-tests/github.cuda.yml
848849
params:
849850
env:
850-
CUDA: 11.7.1
851-
UBUNTU: 22.04
851+
CUDA: {{ cuda }}
852+
UBUNTU: {{ ubuntu }}
852853
image: ubuntu-cuda-python
854+
{% endfor %}
853855

854856
############################## Fuzz tests #################################
855857

python/pyarrow/_cuda.pyx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,14 @@ cdef class CudaBuffer(Buffer):
460460
"""
461461
import ctypes
462462
from numba.cuda.cudadrv.driver import MemoryPointer
463-
return MemoryPointer(self.context.to_numba(),
464-
pointer=ctypes.c_void_p(self.address),
465-
size=self.size)
463+
try:
464+
return MemoryPointer(self.context.to_numba(),
465+
pointer=ctypes.c_void_p(self.address),
466+
size=self.size)
467+
except TypeError:
468+
# Newer Numba does not take a context argument anymore
469+
return MemoryPointer(pointer=ctypes.c_void_p(self.address),
470+
size=self.size)
466471

467472
cdef getitem(self, int64_t i):
468473
return self.copy_to_host(position=i, nbytes=1)[0]

python/pyarrow/tests/test_cuda_numba_interop.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
except ImportError:
2323
pytestmark = pytest.mark.numpy
2424

25+
pytest.skip("Numba integration tests broken by Numba API changes, see GH-48265",
26+
allow_module_level=True)
27+
2528
dtypes = ['uint8', 'int16', 'float32']
2629
cuda = pytest.importorskip("pyarrow.cuda")
2730
nb_cuda = pytest.importorskip("numba.cuda")

0 commit comments

Comments
 (0)