PyLibcuDF (CUDA 12)
pylibcudf-cu12 is the Python binding layer for libcudf, a GPU-accelerated DataFrame library that is part of the NVIDIA RAPIDS ecosystem. It provides high-performance data manipulation primitives, primarily used through the higher-level `cudf` library. As of version 26.4.0, it follows a monthly release cadence, aligned with other RAPIDS components.
Common errors
-
ImportError: libcudf.so: cannot open shared object file: No such file or directory
cause The `pylibcudf` library cannot find its underlying C++ shared library. This often indicates a missing or incorrectly configured CUDA environment, or an ABI mismatch (e.g., trying to run a CUDA 12 compiled library on a system with only CUDA 11 libraries).fixVerify that CUDA Toolkit 12.x is properly installed and its library paths are in your `LD_LIBRARY_PATH`. If your system has CUDA 11, consider installing `pylibcudf-cu11` instead of `pylibcudf-cu12`. -
AttributeError: 'DataFrame' object has no attribute 'apply_chunks'
cause You are attempting to use a method (`apply_chunks`, `apply_rows`, `apply_grouped`) that has been removed from the `cudf` API in recent versions.fixThese methods were removed in `v25.10.00` and `v25.12.00` after deprecation. Refactor your code to use alternative `cudf` APIs, UDFs, or other optimized functions that have replaced their functionality. -
pyarrow.lib.ArrowInvalid: pyarrow_version < 19 is not supported
cause Your installed PyArrow version is older than the minimum required by `cudf` v26.04.00 and later.fixUpgrade your PyArrow library: `pip install 'pyarrow>=19'`. -
RuntimeError: CUDA driver version is insufficient for CUDA runtime version
cause The installed NVIDIA GPU driver is too old to support the CUDA Runtime version that `pylibcudf-cu12` was built against (CUDA 12).fixUpdate your NVIDIA GPU drivers to a version compatible with CUDA Toolkit 12.x. Refer to NVIDIA's CUDA Toolkit documentation for driver compatibility matrices.
Warnings
- breaking Starting with v26.04.00, `pylibcudf` (and by extension `cudf`) requires PyArrow version 19 or higher. Earlier versions will lead to import or runtime errors.
- breaking The `DataFrame.apply_chunks`, `Groupby.apply_grouped`, and `DataFrame.apply_rows` methods have been removed. They were deprecated in earlier versions (v25.10.00) and removed in v25.12.00.
- gotcha The `pylibcudf-cu12` package is specifically compiled for CUDA Toolkit 12.x. Installing this package on a system with CUDA 11.x (or no CUDA toolkit) will likely result in `ImportError` or runtime failures due to ABI incompatibility.
- breaking In v25.08.00, `cudf` dropped support for CUDA 11 usages. This means that if you're upgrading from a significantly older `cudf` version and still using CUDA 11, you will encounter issues.
- breaking The C++ function `cudf::get_current_device_resource` was removed in v26.02.00. While a C++ change, it could affect custom extensions or deep integrations relying on this.
Install
-
pip install pylibcudf-cu12
Imports
- cudf
import cudf
Quickstart
import cudf
import numpy as np
# Create a cuDF DataFrame from a dictionary
data = {'col1': np.random.rand(10), 'col2': np.arange(10)}
gdf = cudf.DataFrame(data)
print("Original DataFrame:")
print(gdf)
# Perform a simple operation
gdf['col3'] = gdf['col1'] * 2
print("\nDataFrame after operation:")
print(gdf)