NVIDIA cuFFT for CUDA 12

11.4.1.4 · active · verified Sat Mar 28

nvidia-cufft-cu12 provides the native runtime libraries for NVIDIA's CUDA Fast Fourier Transform (cuFFT) product, a GPU-accelerated library for performing FFT calculations. It is a fundamental component for various scientific and engineering applications, including deep learning, computer vision, and computational physics. The library is actively maintained by the Nvidia CUDA Installer Team and receives frequent updates; the current version is 11.4.1.4, released on June 5, 2025. It primarily serves as a low-level dependency for higher-level Python frameworks and libraries that leverage GPU-accelerated FFTs.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to perform a 1D complex-to-complex FFT and inverse FFT using `nvmath-python`, which leverages the `nvidia-cufft-cu12` runtime library. Ensure `cupy` is also installed (it's a dependency of `nvmath-python[cu12]`) for GPU array operations.

import os
import nvmath.fft as nvfft
import cupy as cp

# Ensure CUDA is available and nvmath-python is correctly set up
# (e.g., pip install nvmath-python[cu12] and appropriate CUDA Toolkit installation)

# Example: Perform a 1D complex-to-complex FFT using nvmath-python
size = 1024
x = cp.arange(size, dtype=cp.complex64)

# Perform forward FFT
y = nvfft.fft(x)

# Perform inverse FFT
z = nvfft.ifft(y)

print(f"Original data (first 5 elements): {x[:5].tolist()}")
print(f"FFT result (first 5 elements): {y[:5].tolist()}")
print(f"Inverse FFT result (first 5 elements): {z[:5].tolist()}")
print(f"Difference from original (max abs error): {cp.max(cp.abs(x - z))}")

view raw JSON →