NVIDIA cuFile (CUDA 12)

raw JSON →
1.14.1.1 verified Tue May 12 auth: no python install: stale quickstart: stale

nvidia-cufile-cu12 is a Python distribution package that provides the underlying NVIDIA cuFile GPUDirect Storage (GDS) libraries specifically compiled for CUDA 12. These libraries enable a direct data path for Direct Memory Access (DMA) transfers between GPU memory and storage, bypassing the CPU to increase bandwidth and decrease latency. It is generally consumed as a dependency by higher-level Python libraries like `cuda-python` (which exposes `cuda.bindings.cufile`) or other GPU-accelerated data science tools. The current version is 1.14.1.1, with a release cadence tied to CUDA Toolkit updates.

pip install nvidia-cufile-cu12
error Failed to download `nvidia-cufile-cu12`
cause The pip installer could not reach `pypi.nvidia.com` to download the necessary wheel file, often due to network issues, firewall restrictions, or the server being temporarily unavailable.
fix
Ensure stable internet connectivity and that https://pypi.nvidia.com is reachable. You may need to configure proxy settings, temporarily disable firewalls, or retry the installation. If the specific package name in the error is a dependency, consider adding --extra-index-url https://pypi.nvidia.com to your pip install command for the main package you're trying to install.
error ERROR: Could not find a version that satisfies the requirement nvidia-cufile-cu12 (from versions: none)
cause pip cannot find a compatible wheel for `nvidia-cufile-cu12` on the default PyPI or the specified `--extra-index-url`. This commonly happens when `https://pypi.nvidia.com` is not explicitly included in the installation command, or if a pre-built wheel for your specific Python version, operating system, architecture, or CUDA version is not available on `pypi.nvidia.com`.
fix
Include https://pypi.nvidia.com as an extra index URL in your pip install command: pip install --extra-index-url https://pypi.nvidia.com nvidia-cufile-cu12. Also, verify that your Python version, operating system, and CUDA toolkit version are supported by the available wheels on pypi.nvidia.com.
error ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.XX not found
cause This error indicates a mismatch between the C++ standard library (libstdc++) version linked by the `nvidia-cufile-cu12` binaries (or a library it depends on) and the version available in your system's environment. The package was likely compiled with a newer `libstdc++` than what's present on your system.
fix
Use a virtual environment (like Conda) with a more recent compiler toolchain or a containerized environment (e.g., Docker) that provides the required libstdc++ version. Alternatively, ensure your system's libstdc++ is updated to a compatible version.
error ERROR: metadata-generation-failed
cause This generic pip error often occurs during installation of complex packages, including those in the NVIDIA ecosystem, when pip struggles to build or retrieve metadata for the package. For `nvidia-cufile-cu12`, it often points to issues similar to 'Could not find a version' or problems reaching `pypi.nvidia.com` where the actual wheels are hosted.
fix
Ensure you are using pip install --extra-index-url https://pypi.nvidia.com and that pypi.nvidia.com is reachable. Check if your Python and CUDA versions are compatible with the available packages. Sometimes, an outdated setuptools or pip can also cause this; try updating them: pip install --upgrade pip setuptools.
gotcha Installing `nvidia-cufile-cu12` along with other `nvidia-*cu12` packages can sometimes lead to prolonged dependency resolution times with `pip`.
fix Ensure `pip` and `setuptools` are up-to-date (`python -m pip install --upgrade pip setuptools`). If issues persist, consider providing stricter version constraints for dependencies or using `conda` for environment management.
gotcha Python bindings for CUDA libraries, including `cuda.bindings.cufile`, require a CUDA driver on your system that is compatible with the installed CUDA Toolkit version. Mismatches can lead to import errors or runtime failures.
fix Ensure your NVIDIA GPU driver is up-to-date and compatible with the CUDA Toolkit version corresponding to the `cu12` suffix (i.e., CUDA 12.x). You may need to explicitly install a specific version of `cuda-python` (e.g., `pip install cuda-python==12.x`) to match your driver if auto-resolution fails.
breaking The `cuda.bindings` module (which provides `cuda.bindings.cufile`) deprecated using `int(cuda_obj)` to retrieve the underlying address of a CUDA object in `cuda-bindings` version 13.0.0.
fix Switch to using `get_cuda_native_handle()` for retrieving the underlying address of CUDA objects.
gotcha The cuFile APIs, and by extension `cuda.bindings.cufile`, are primarily supported on Linux for GPUDirect Storage functionality. Usage on Windows may be limited or require WSL2 with specific configurations.
fix For full GPUDirect Storage functionality, use a Linux environment with appropriate hardware and kernel modules (e.g., `nvidia-fs.ko`).
breaking The script failed due to `ModuleNotFoundError: No module named 'numpy'`, indicating that the `numpy` package is not installed in the environment.
fix Ensure `numpy` is installed in your Python environment by running `pip install numpy` or including it in your project's `requirements.txt` file. If using a virtual environment, ensure it is activated before installation.
breaking `nvidia-cufile-cu12` currently does not provide pre-built wheels for Python 3.13 or for musl libc-based distributions like Alpine Linux. This leads to `pip` being unable to find a compatible distribution.
fix Use a glibc-based Linux distribution (e.g., Ubuntu, Debian, CentOS) and a Python version for which pre-built wheels are available (currently Python 3.8-3.12). Check the package's official PyPI page for the most up-to-date information on supported versions and platforms.
pip install --extra-index-url https://pypi.nvidia.com nvidia-cufile-cu12
python os / libc variant status wheel install import disk
3.10 alpine (musl) --extra-index-url build_error - - - -
3.10 alpine (musl) nvidia-cufile-cu12 build_error - - - -
3.10 alpine (musl) --extra-index-url - - - -
3.10 alpine (musl) nvidia-cufile-cu12 - - - -
3.10 slim (glibc) --extra-index-url wheel 1.7s - 22M
3.10 slim (glibc) nvidia-cufile-cu12 wheel 1.5s - 22M
3.10 slim (glibc) --extra-index-url - - - -
3.10 slim (glibc) nvidia-cufile-cu12 - - - -
3.11 alpine (musl) --extra-index-url build_error - - - -
3.11 alpine (musl) nvidia-cufile-cu12 build_error - - - -
3.11 alpine (musl) --extra-index-url - - - -
3.11 alpine (musl) nvidia-cufile-cu12 - - - -
3.11 slim (glibc) --extra-index-url wheel 1.7s - 23M
3.11 slim (glibc) nvidia-cufile-cu12 wheel 1.6s - 23M
3.11 slim (glibc) --extra-index-url - - - -
3.11 slim (glibc) nvidia-cufile-cu12 - - - -
3.12 alpine (musl) --extra-index-url build_error - - - -
3.12 alpine (musl) nvidia-cufile-cu12 build_error - - - -
3.12 alpine (musl) --extra-index-url - - - -
3.12 alpine (musl) nvidia-cufile-cu12 - - - -
3.12 slim (glibc) --extra-index-url wheel 1.5s - 15M
3.12 slim (glibc) nvidia-cufile-cu12 wheel 1.5s - 15M
3.12 slim (glibc) --extra-index-url - - - -
3.12 slim (glibc) nvidia-cufile-cu12 - - - -
3.13 alpine (musl) --extra-index-url build_error - - - -
3.13 alpine (musl) nvidia-cufile-cu12 build_error - - - -
3.13 alpine (musl) --extra-index-url - - - -
3.13 alpine (musl) nvidia-cufile-cu12 - - - -
3.13 slim (glibc) --extra-index-url wheel 1.5s - 15M
3.13 slim (glibc) nvidia-cufile-cu12 wheel 1.4s - 15M
3.13 slim (glibc) --extra-index-url - - - -
3.13 slim (glibc) nvidia-cufile-cu12 - - - -
3.9 alpine (musl) --extra-index-url build_error - - - -
3.9 alpine (musl) nvidia-cufile-cu12 build_error - - - -
3.9 alpine (musl) --extra-index-url - - - -
3.9 alpine (musl) nvidia-cufile-cu12 - - - -
3.9 slim (glibc) --extra-index-url wheel 1.9s - 21M
3.9 slim (glibc) nvidia-cufile-cu12 wheel 1.8s - 21M
3.9 slim (glibc) --extra-index-url - - - -
3.9 slim (glibc) nvidia-cufile-cu12 - - - -

This conceptual quickstart demonstrates how to access the `cufile` module through `cuda.bindings` after installing `cuda-python` and `nvidia-cufile-cu12`. Direct, runnable examples of cuFile operations are highly dependent on specific hardware (NVIDIA GPU), a GPUDirect Storage enabled filesystem, and a properly configured NVIDIA driver, making a universally runnable snippet impractical without such a setup. It outlines the typical high-level steps for interacting with the cuFile API in Python.

# The 'nvidia-cufile-cu12' package provides the underlying C/C++ cuFile libraries.
# To interact with cuFile from Python, you typically use the 'cuda-python' package.
# Install cuda-python: pip install cuda-python numpy

import numpy as np
from cuda.bindings import cufile, driver

# NOTE: This quickstart is conceptual and requires a system with GPUDirect Storage
# enabled, a compatible filesystem, and appropriate NVIDIA hardware/driver setup.
# A simple 'hello world' is not feasible without such infrastructure.

def conceptual_cufile_usage():
    print("Initializing CUDA driver and cuFile (conceptual)...")
    try:
        # Initialize CUDA driver (required for cuFile operations)
        driver.cuInit(0)
        
        # Open cuFile driver
        cufile.driver_open()
        
        # --- Example: Hypothetical buffered read/write setup ---
        # In a real scenario, you'd perform operations like:
        # 1. Allocate GPU memory (e.g., using CuPy or PyTorch on device)
        # 2. Register the buffer with cuFile (cufile.buf_register)
        # 3. Open a file for GPUDirect Storage (e.g., POSIX open on a supported filesystem)
        # 4. Register the file handle with cuFile (cufile.handle_register)
        # 5. Perform I/O operations (cufile.read, cufile.write)
        # 6. Deregister handles and buffers (cufile.handle_deregister, cufile.buf_deregister)

        print("cuFile driver opened successfully. Real I/O requires extensive setup.")
        print("Please refer to NVIDIA GPUDirect Storage documentation for full usage.")
        
    except Exception as e:
        print(f"An error occurred during conceptual cuFile initialization: {e}")
    finally:
        try:
            # Close cuFile driver
            cufile.driver_close()
            print("cuFile driver closed (conceptual).")
        except Exception as e:
            print(f"Error closing cuFile driver: {e}")

if __name__ == "__main__":
    conceptual_cufile_usage()