NVIDIA cuFile
The `nvidia-cufile` package distributes the NVIDIA GPUDirect Storage (GDS) C libraries (`libcufile`), which enable direct data transfer between storage and GPU memory. It is a foundational component for GPU-accelerated I/O, typically consumed by higher-level Python bindings like `pygds` or other GPU-aware data libraries. As of version 1.17.0.44, it primarily serves as a backend dependency, providing the necessary low-level C components.
Warnings
- gotcha The `nvidia-cufile` package primarily distributes the low-level C libraries for GPUDirect Storage (`libcufile`). It does not provide a direct Python API for user interaction. Python developers should typically use higher-level binding libraries like `pygds` (`pip install pygds`) to leverage GDS functionality.
- gotcha Requires an NVIDIA GPU with GPUDirect Storage support, compatible NVIDIA drivers, and a CUDA Toolkit installation. Ensure your system meets these hardware and software prerequisites for GDS functionality to work correctly.
- gotcha GPUDirect Storage requires specific file systems (e.g., Lustre, BeeGFS, GPFS, WekaIO) and kernel modules to be properly configured and mounted on the host system. Without this specialized storage setup, GDS operations will fail or fall back to slower, non-GDS paths.
Install
-
pip install nvidia-cufile -
pip install pygds # This will install nvidia-cufile as a dependency
Imports
- No direct Python API
This package distributes C libraries; use `pygds` for Python bindings.
Quickstart
import pygds
# The 'nvidia-cufile' package itself doesn't offer a direct Python API.
# It provides the underlying C libraries for GPUDirect Storage.
# Python bindings like 'pygds' utilize these libraries.
try:
# Initialize GPUDirect Storage through its Python bindings
pygds.init()
print(f"GPUDirect Storage (via pygds) initialized successfully.")
print(f"Is GPUDirect Storage enabled: {pygds.is_enabled()}")
print(f"Is GPUDirect Storage initialized: {pygds.is_initialized()}")
# To actually perform I/O, you would use functions like pygds.open
# on a GDS-enabled file system.
print("\n`nvidia-cufile` is installed as the backend for `pygds`.")
print("For actual GPUDirect Storage file operations, refer to `pygds` documentation.")
except ImportError:
print("Error: `pygds` not found. Install it with `pip install pygds` "
"to use the `nvidia-cufile` backend.")
except Exception as e:
print(f"An error occurred during pygds initialization: {e}")