Registry / ai-ml / nvidia-cufft

nvidia-cufft

JSON →
library12.2.0.37pypypiunverified

The `nvidia-cufft` package provides the NVIDIA CUDA Fast Fourier Transform (cuFFT) native runtime libraries for Python environments. It is not a Python API itself, but rather a low-level dependency for other Python libraries (like CuPy, PyTorch, or TensorFlow) that leverage cuFFT for GPU-accelerated FFT computations. The current version is 12.2.0.37, and new versions are typically released in conjunction with NVIDIA CUDA Toolkit updates.

pip install nvidia-cufft
INSTALL
IMPORT
SIG · NVIDIA-CUFFT
N
nvidia-cufft
ai-mlpythonv12.2.0.37
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how a higher-level library like CuPy leverages `nvidia-cufft` for GPU-accelerated FFTs. The `nvidia-cufft` package itself provides the native shared libraries but no direct Python API. Installation of `cupy` is required to run this example.

import cupy as cp import cupy.fft as cufft # Ensure CUDA is available and nvidia-cufft binaries are usable by CuPy if not cp.cuda.is_available(): print("CUDA is not available. CuPy cannot use cuFFT.") else: print(f"CuPy version: {cp.__version__}") print(f"CUDA driver version: {cp.cuda.runtime.getDriverVersion()}") print(f"CUDA runtime version: {cp.cuda.runtime.get_version()}") # Example: Perform a 1D FFT on the GPU using CuPy a_h = cp.arange(10, dtype=cp.float32) # Host array (CPU) a_d = cp.asarray(a_h) # Transfer to Device (GPU) print(f"\nOriginal array on GPU: {a_d}") # Perform FFT on GPU using CuPy's wrapper for cuFFT fft_result_d = cufft.fft(a_d) print(f"FFT result on GPU: {fft_result_d}") print("\nNote: The `nvidia-cufft` package provides the underlying native") print("libraries that enable CuPy's GPU FFT functions to work. This") print("package itself does not expose direct Python imports or APIs.")
Debug
Known issues
gotchaThe `nvidia-cufft` package does NOT expose a direct Python API for cuFFT functions. It provides only the native runtime libraries (e.g., `.so` or `.dll` files) that other Python libraries (like CuPy, PyTorch, or TensorFlow) link against to offer GPU-accelerated FFT capabilities.
fix
To use cuFFT from Python, install a wrapper library such as `cupy` or use the relevant modules within `pytorch` or `tensorflow` that internally call cuFFT.
affects: All versions
gotchaEnsure the `nvidia-cufft` version is compatible with your installed NVIDIA CUDA Toolkit and driver version, as well as the CUDA versions targeted by other GPU-accelerated Python libraries (e.g., CuPy, PyTorch). Mismatches can lead to runtime errors, crashes, or unexpected behavior.
fix
Refer to the compatibility matrix for your specific CUDA Toolkit version and ensure all related packages are aligned. Often, installing CUDA-enabled libraries like `cupy-cudaXX` (where XX is CUDA version) might implicitly handle this.
affects: All versions
gotchaFor most users, `nvidia-cufft` is installed as an indirect dependency when installing other GPU-accelerated Python libraries (e.g., `cupy`). Manual installation is usually not necessary unless troubleshooting specific environment setups or dependency issues.
fix
If experiencing cuFFT-related errors, verify `nvidia-cufft` is installed (`pip show nvidia-cufft`) and its version is appropriate for your setup. Avoid manual installation if `pip install cupy` or similar commands are already successfully installing it.
affects: All versions
Errors
Common errors & fixes
CUDA driver library cannot be found.
The system's NVIDIA CUDA driver is either not installed, not correctly configured, or its path is not included in the system's dynamic linker search paths (e.g., LD_LIBRARY_PATH on Linux or system PATH on Windows). Since `nvidia-cufft` relies on the underlying CUDA runtime, it cannot function without a discoverable driver. This error often appears when a Python library like Numba or CuPy attempts to initialize CUDA.
fix
Ensure that the correct NVIDIA GPU drivers are installed and that the CUDA Toolkit is properly configured. On Linux, verify that `libcuda.so` is discoverable by adding its directory (e.g., `/usr/local/cuda/lib64`) to the `LD_LIBRARY_PATH` environment variable. On Windows, ensure the CUDA Toolkit bin directories are in the system's PATH.
Required cuFFT library not found. Check your environment or set CUFFT_LIBRARY to its location
A dependent application (e.g., a build system like CMake for Lammps, or a Python library at runtime) could not locate the `nvidia-cufft` runtime library (e.g., `libcufft.so`). This usually means the library is not installed, or its directory is not included in the system's dynamic linker search paths, or a specific environment variable like `CUFFT_LIBRARY` is not set.
fix
Install the `nvidia-cufft` package via pip (`pip install nvidia-cufft-cuXX` where `XX` matches your CUDA version, or `pip install nvidia-cufft` for the default). Ensure that the directory containing `libcufft.so` (typically within your CUDA Toolkit installation, e.g., `/usr/local/cuda/targets/x86_64-linux/lib/`) is added to `LD_LIBRARY_PATH`. If building from source, explicitly set CMake variables like `CUFFT_LIBRARY` to the full path of `libcufft.so`.
Failed to dlopen libcuda.so.1
This Python-level warning or error (often seen from libraries like CuPy or Numba) indicates that the Python interpreter or a loaded module was unable to dynamically load the `libcuda.so.1` shared library. This is a common symptom of the underlying CUDA driver not being found or being inaccessible, preventing `nvidia-cufft` and other CUDA libraries from initializing.
fix
This issue is typically a manifestation of the 'CUDA driver library cannot be found' problem. Verify your NVIDIA GPU driver installation and CUDA Toolkit setup. Ensure that the directory containing `libcuda.so.1` (e.g., `/usr/lib/wsl/lib` in WSL2, or `/usr/local/cuda/lib64`) is correctly added to your `LD_LIBRARY_PATH` environment variable on Linux-like systems or the system PATH on Windows. Restart your terminal or environment after setting environment variables.
Upgrade
Version history
12.2.0.37latest on PyPI · released Mar 9, 2026
Audit
Dependencies
cupyoptionalCommonly used Python library that leverages nvidia-cufft for GPU-accelerated FFTs. Used in quickstart example.
Agent activity
8 hits · last 30 days
node
8
Resources
nvidia-cufft — pip install nvidia-cufft · libregistry