NVIDIA cuFFT (CUDA 11 variant)
The `nvidia-cufft-cu11` package provides the native runtime libraries for NVIDIA's GPU-accelerated Fast Fourier Transform (FFT) library, specifically compiled for CUDA 11.x environments. It enables high-performance FFT computations directly on NVIDIA GPUs for various scientific and engineering applications, including deep learning, computer vision, and computational physics. This package is a low-level dependency providing the C/C++ binaries, and is typically used in conjunction with Python binding libraries like CuPy or nvmath-python. The current version is 10.9.0.58, with a relatively slow release cadence for this specific CUDA 11 variant, as newer CUDA versions often have their own packages (e.g., `nvidia-cufft-cu12`).
Warnings
- breaking This `nvidia-cufft-cu11` package is specifically built for CUDA 11.x. Using it with an incompatible CUDA Toolkit version (e.g., CUDA 10.x or 12.x) or an older/newer GPU driver may lead to runtime errors or unexpected behavior due to ABI incompatibilities. Always match the `cuXX` suffix to your installed CUDA Toolkit version.
- gotcha This package (`nvidia-cufft-cu11`) provides low-level C/C++ native runtime libraries and does not expose a direct Python API for FFT operations. Attempting to `import nvidia_cufft_cu11` or similar will not work. To use cuFFT from Python, you must install and use a Python binding library such as `CuPy` (`pip install cupy-cuda11x`) or `nvmath-python` (`pip install nvmath-python[cu11]`).
- deprecated Support for cuFFT callback functionality using separately compiled device code was deprecated in CUDA 11.4 and later. While this package is for CUDA 11.x, advanced users relying on custom FFT callbacks might experience performance overheads or functional issues, as the implementation for callbacks was slated for an update to remove these. (CUFFT 10.9.0.58 is released October 3, 2022, after CUDA 11.4 was released, meaning this deprecation applies).
- gotcha This library is distributed under an NVIDIA Proprietary Software License. Users should be aware of and comply with the terms and conditions of this license, which may differ significantly from open-source licenses.
Install
-
pip install nvidia-cufft-cu11
Imports
- cuFFT functionality via CuPy
import cupy as cp cp.fft.fft(...)
- cuFFT functionality via nvmath-python
from nvmath.fft import fft fft(...)
Quickstart
import cupy as cp
import numpy as np
# Ensure a CUDA-enabled GPU is available
if not cp.cuda.is_available():
print("CUDA is not available. CuPy and cuFFT require a GPU.")
exit()
# Create a CuPy array on the GPU
n = 1024
x_gpu = cp.random.rand(n, dtype=cp.float32)
# Perform a 1D FFT using CuPy (which uses cuFFT internally)
y_gpu = cp.fft.fft(x_gpu)
# Optionally, copy back to host and compare with NumPy
y_cpu = cp.asnumpy(y_gpu)
x_cpu = cp.asnumpy(x_gpu)
y_numpy = np.fft.fft(x_cpu)
print(f"Original GPU array type: {type(x_gpu)}")
print(f"FFT result GPU array type: {type(y_gpu)}")
print(f"First 5 elements of GPU FFT: {y_gpu[:5]}")
print(f"First 5 elements of NumPy FFT: {y_numpy[:5]}")
print(f"Max absolute difference between CuPy FFT and NumPy FFT: {cp.max(cp.abs(y_gpu - cp.asarray(y_numpy))):.6e}")