NVIDIA/cuda-python

CUDA Python: Performance meets Productivity

What it solves

CUDA Python addresses the challenge of accessing NVIDIA's CUDA platform from Python. It provides a complete ecosystem of tools that let developers work with CUDA at various levels, from low-level C API bindings to high-level, Pythonic interfaces and even JIT compilation of CUDA kernels. The project is being restructured into a metapackage so users can install only the components they need, with each subpackage versioned independently.

How it works

CUDA Python is organized as a metapackage containing multiple subpackages. The core components include:

  • cuda.core: Pythonic access to CUDA Runtime and other core functionality.
  • cuda.bindings: Low-level Python bindings to CUDA C APIs (covering CUDA Driver, Runtime, NVRTC, nvJitLink, NVVM, nvFatbin, cuFile, and NVML).
  • cuda.pathfinder: Utilities for locating CUDA components in a Python environment.
  • cuda.compute: A Python module for highly efficient parallel algorithms (like sort, scan, reduce, transform) callable on the host.
  • numba-cuda-mlir: An evolution of Numba CUDA for SIMT kernel development in Python.
  • numba.cuda: A DSL that compiles a subset of Python into CUDA kernels.
  • cuda.tile: A DSL for writing NumPy-like code in CUDA kernels using the Tile programming model.
  • nvmath-python: Pythonic access to NVIDIA CPU & GPU math libraries with host, device, and distributed APIs.
  • nvshmem4py: Pythonic interface to NVSHMEM for GPU-accelerated PGAS programming.
  • Nsight Python and CUPTI Python: profiling tools for CUDA Python applications.
  • Accelerated Computing Hub: open-source learning materials.

Each subpackage is independently versioned and can be installed as needed. The bindings are maintained across two lines (CUDA 13 and CUDA 12.9) that build the same distribution.

Who it's for

CUDA Python is for Python developers who want to use NVIDIA's CUDA platform without leaving Python, whether they are building GPU-accelerated libraries, writing custom CUDA kernels, or profiling and optimizing GPU applications. It also serves maintainers who need low-level bindings and researchers who prefer high-level, Pythonic abstractions.

Highlights

  • Full coverage of CUDA host APIs via low-level bindings.
  • Pythonic, idiomatic access to CUDA Runtime and core functionality.
  • Multiple DSLs (numba.cuda, cuda.tile) for writing CUDA kernels in Python.
  • Host-callable parallel algorithms via cuda.compute.
  • Pythonic interfaces to math libraries, NVSHMEM, and profiling tools.
  • Independent versioning for each subpackage, allowing selective installation.
  • Apache 2.0 licensed with thorough attribution.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project