NVIDIA cuFFT (CUDA 11 variant)

10.9.0.58 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

This quickstart demonstrates how to perform a 1D Fast Fourier Transform using `CuPy`, which internally leverages the `nvidia-cufft-cu11` native libraries. It creates a random array on the GPU, computes its FFT, and optionally compares the result with a NumPy FFT on the CPU. Ensure `cupy` is installed (`pip install cupy-cuda11x`).

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}")

view raw JSON →