Skip to content

How to Install RAPIDS with uv

Install RAPIDS libraries such as cuDF and cuML with uv, selecting a consistent CUDA major version. NVIDIA publishes packages on PyPI and its own index; the RAPIDS install selector provides the supported package combinations.

Prerequisites

Use Linux x86_64 or aarch64 with glibc 2.28+ and Python 3.11–3.14. On Windows 11, use WSL2 with a supported Linux distribution; native Windows and macOS wheels are unavailable. RAPIDS documents single-GPU support for WSL2.

Choose a CUDA variant from the stable platform matrix:

Packages System CUDA Toolkit Linux driver GPU compute capability
-cu12 12.2–12.9 535+ 7.0+ (Volta or newer)
-cu13 13.0–13.3 580+ 7.5+ (Turing or newer)

Check the driver and installed toolkit separately:

nvidia-smi
nvcc --version

Expect a GPU/driver table and a CUDA compiler version. nvidia-smi’s CUDA Version describes driver capability, not the installed toolkit. Follow the RAPIDS prerequisites for a matching toolkit, including NVRTC for Numba; for CUDA Docker images, use the devel flavor for the supported full setup.

Configure the NVIDIA index

In an existing uv project using a supported Python version, add:

pyproject.toml
[[tool.uv.index]]
name = "nvidia"
url = "https://pypi.nvidia.com"

Add the CUDA 12 packages:

uv add cudf-cu12 cuml-cu12

Expect an installation summary containing both packages and updates to pyproject.toml and uv.lock. Commit both files. For CUDA 13, substitute cudf-cu13 cuml-cu13; keep the CUDA suffix consistent across the environment and use compatible RAPIDS releases.

This index configuration lets uv query NVIDIA’s index for transitive dependencies too. Adding explicit = true with source mappings for only cuDF and cuML does not route their transitive dependencies to that index; every dependency that needs an explicit index requires its own mapping. See private package indexes with uv.

For an existing virtual environment outside a project:

uv pip install cudf-cu12 cuml-cu12 --extra-index-url https://pypi.nvidia.com

Expect both packages in the installation summary. Installation into a GPU-less image is separate from validation: run the verification on the GPU host after attaching the device and driver.

Verify GPU operations

Save this as verify_rapids.py in the project:

verify_rapids.py
import cupy as cp
import cudf
from cuml.decomposition import PCA

assert cp.cuda.runtime.getDeviceCount() > 0
print(cp.cuda.runtime.getDeviceProperties(0)["name"])
series = cudf.Series([1, 2, 3])
assert int((series * series).sum()) == 14
x = cp.asarray([[1., 2.], [2., 4.], [3., 6.], [4., 8.]], dtype=cp.float32)
y = PCA(n_components=1, output_type="cupy").fit_transform(x)
assert isinstance(y, cp.ndarray) and y.device.id == 0
assert y.shape == (4, 1) and bool(cp.all(cp.isfinite(y)))
print("cuDF and cuML GPU operations passed")
uv run python verify_rapids.py

uv run executes the command inside the project’s virtual environment, ensuring all dependencies are installed first. Expect the GPU name and cuDF and cuML GPU operations passed. This checks cuDF computation and cuML output on device memory; an import alone does not prove GPU functionality.

Resolve mixed-stack dependency conflicts

RAPIDS, PyTorch, and JAX share CUDA runtime dependencies. uv resolves their declared Python requirements together, but the result must also match the host driver and GPU architecture. Keep separate environments when CUDA, NumPy, or other dependency constraints conflict.

Pixi and conda offer another way to resolve native dependencies together; they still require a compatible driver and package combination. RAPIDS’ pip packages are incompatible with TensorFlow’s pip packages; use the upstream recommended conda packages or containers for that combination.

Last updated on