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-cufftNo compatibility data collected yet for this library.
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.
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.
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.
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.
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.
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`.
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.