Overview
Arrow’s CUDA support provides:- GPU memory management: Allocate and manage buffers on CUDA devices
- Zero-copy transfers: Share data between CPU and GPU without copying
- IPC support: Share GPU buffers between processes using CUDA IPC
- Device abstraction: Unified API for CPU and GPU memory
- Multi-GPU support: Work with multiple CUDA devices
Getting Started
Device Management
Access CUDA devices through theCudaDeviceManager:
CUDA Context
ACudaContext manages the CUDA driver context for a device:
GPU Memory Management
Allocating GPU Memory
Allocate memory on a CUDA device:Copying Data Between CPU and GPU
Viewing GPU Memory
Create non-owning views of existing GPU memory:Host Memory with GPU Access
Allocate pinned CPU memory accessible by GPU:Memory Manager Integration
Use Arrow’s unified memory manager API:Multi-GPU Operations
Copying Between GPUs
CUDA IPC (Inter-Process Communication)
Share GPU buffers between processes:Streams and Events
CUDA Streams
CUDA Events
Buffer I/O
Read and write GPU buffers using file-like interfaces:Performance Best Practices
Minimize CPU-GPU Transfers
Use Pinned Memory for Frequent Transfers
Asynchronous Operations
When to Use GPU Support
GPU support is beneficial for:- Large-scale compute: Operations on hundreds of MBs to GBs of data
- Parallel algorithms: Data-parallel operations that map well to GPU architecture
- Integration with GPU libraries: Using CUDA-based ML/DL frameworks
- Minimizing copies: Zero-copy sharing with GPU compute engines
- Small datasets: GPU transfer overhead dominates
- Sequential operations: Limited parallelism opportunity
- Complex control flow: GPUs excel at data-parallel, not task-parallel workloads
Error Handling
All CUDA operations returnarrow::Result or arrow::Status: