{"id":664,"library":"nvidia-cufft-cu12","title":"NVIDIA cuFFT for CUDA 12","description":"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.","status":"active","version":"11.4.1.4","language":"python","source_language":"en","source_url":"https://developer.nvidia.com/cufft","tags":["cuda","nvidia","runtime","fft","fast fourier transform","gpu","scientific computing","deep learning","machine learning","signal processing","mathematics"],"install":[{"cmd":"pip install nvidia-cufft-cu12","lang":"bash","label":"Install via pip"},{"cmd":"pip install nvmath-python[cu12]","lang":"bash","label":"Install with nvmath-python (recommended for Python users)"}],"dependencies":[{"reason":"Required runtime dependency for the cuFFT library.","package":"nvidia-nvjitlink-cu12"},{"reason":"Provides Pythonic APIs that leverage cuFFT for direct Python usage. Installing `nvmath-python[cu12]` handles this dependency.","package":"nvmath-python","optional":true},{"reason":"PyTorch natively supports cuFFT for accelerated FFTs on CUDA devices.","package":"torch","optional":true},{"reason":"TensorFlow utilizes cuFFT for GPU-accelerated operations.","package":"tensorflow","optional":true}],"imports":[{"wrong":"import nvidia-cufft-cu12","symbol":"cufft","correct":"from nvidia import cufft"}],"quickstart":{"code":"import os\nimport nvmath.fft as nvfft\nimport cupy as cp\n\n# Ensure CUDA is available and nvmath-python is correctly set up\n# (e.g., pip install nvmath-python[cu12] and appropriate CUDA Toolkit installation)\n\n# Example: Perform a 1D complex-to-complex FFT using nvmath-python\nsize = 1024\nx = cp.arange(size, dtype=cp.complex64)\n\n# Perform forward FFT\ny = nvfft.fft(x)\n\n# Perform inverse FFT\nz = nvfft.ifft(y)\n\nprint(f\"Original data (first 5 elements): {x[:5].tolist()}\")\nprint(f\"FFT result (first 5 elements): {y[:5].tolist()}\")\nprint(f\"Inverse FFT result (first 5 elements): {z[:5].tolist()}\")\nprint(f\"Difference from original (max abs error): {cp.max(cp.abs(x - z))}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Ensure your GPU hardware has a compute capability of SM50 or higher for CUDA 12.0+ applications.","message":"Deprecated GPU architectures: From CUDA 12.0 onwards, GPU architectures SM35 and SM37 are no longer supported. The minimum required architecture is SM50. Older CUDA versions (e.g., 11.0) also deprecated earlier architectures like SM30.","severity":"breaking","affected_versions":"CUDA 11.0+"},{"fix":"Migrate to Link-Time Optimized (LTO) callbacks, which are supported from CUDA 12.6 Update 2 onwards, to avoid deprecation issues and leverage improved performance.","message":"Legacy cuFFT callback functionality: Support for callback routines using separately compiled device code (legacy callbacks) has been deprecated since CUDA 11.4. CUDA Graphs capture for legacy callbacks that load data in out-of-place mode transforms is no longer supported from CUDA 11.8.","severity":"deprecated","affected_versions":"CUDA 11.4+"},{"fix":"Consider updating to CUDA 12.6 Update 2 or newer and migrating to LTO callbacks, or investigate the performance implications for your specific callback implementations.","message":"Performance degradation with legacy callbacks: Users have reported significant performance decreases (up to 20% or more) when using legacy cuFFT callbacks in CUDA 11.8 and newer (e.g., 12.2, 12.4, 12.9+) compared to CUDA 11.7. This often manifests as increased time spent in `cuMemFree_v2` during `cufftExecC2R` or `R2C` operations.","severity":"gotcha","affected_versions":"CUDA 11.8+"},{"fix":"This issue was not observed in CUDA 12.0 and later. If using CUDA 11.8, ensure your CUDA context management is consistent or consider upgrading to a newer CUDA Toolkit version. Replacing `-cudalib=cufft` with `-lcufft` during compilation was also noted as a workaround.","message":"Memory leak with `nvc++ -cudalib=cufft`: A potential memory leak in cuFFT library version v10.9.0.58 (shipped with CUDA 11.8) when used with `nvc++` and the `-cudalib=cufft` flag. This was linked to cuFFT failing to deallocate internal structures if the active CUDA context at program finalization was not the same used for plan creation.","severity":"gotcha","affected_versions":"CUDA 11.8 (cuFFT v10.9.0.58)"},{"fix":"Avoid using `cudaDeviceReset()` in critical paths before cuFFT plan creation. If absolutely necessary, re-establish the CUDA device context (e.g., with `cudaSetDevice(0)`) after `cudaDeviceReset()`.","message":"Interference of `cudaDeviceReset()` with `cufftPlanMany`: Calling `cudaDeviceReset()` before `cufftPlanMany` can lead to `CUFFT_INTERNAL_ERROR`. While adding `cudaSetDevice(0)` after the reset might mitigate it, `cudaDeviceReset()` is generally not recommended for regular use.","severity":"gotcha","affected_versions":"All versions (observed in CUDA 12.2, 12.4)"},{"fix":"Monitor GPU memory usage for large multi-GPU FFTs. If the error persists, consider reducing data size or reporting as a bug with NVIDIA, as 'internal error' provides limited actionable information.","message":"`CUFFT_INTERNAL_ERROR` in `cufftXtSetGPU` for multi-GPU FFTs: When performing large multi-GPU FFTs, `cufftXtSetGPU` can return an opaque 'internal error,' potentially indicating an out-of-memory condition or an unspecified library issue.","severity":"gotcha","affected_versions":"All versions (observed in CUDA 8.0 with large data)"},{"fix":"Try setting the environment variable `UV_CONCURRENT_DOWNLOADS=1` (for `uv` users) or similar mechanisms to limit concurrent downloads when installing from `pypi.nvidia.com`.","message":"Installation timeouts/failures with concurrent downloads from `pypi.nvidia.com`: Users attempting to install `nvidia-cufft-cu12` (and other NVIDIA PyPI packages) with tools that use concurrent downloads (e.g., `uv`) may experience failures due to timeout or network issues with `pypi.nvidia.com`.","severity":"gotcha","affected_versions":"All versions (related to `pip`/`uv` behavior)"},{"fix":"Install `nvidia-pyindex` first using `pip install nvidia-pyindex`, then install the desired package. Alternatively, configure pip to use the NVIDIA Python Package Index directly by adding `--extra-index-url https://pypi.nvidia.com` to your pip command or by configuring your pip.conf/pip.ini.","message":"Attempting to install NVIDIA Python packages (e.g., `nvidia-cufft-cu12`) directly from PyPI.org will result in a `RuntimeError` indicating the package is a placeholder. These packages are hosted on the NVIDIA Python Package Index and require a specific installation method.","severity":"breaking","affected_versions":"All versions (related to NVIDIA PyPI package installation)"}],"env_vars":null,"search_vec":"'11.4.1.4':71 '12':5 '2025':76 '5':75 'acceler':27,98 'activ':55 'applic':43 'calcul':32 'compon':37 'comput':47,50,109 'cu12':9 'cuda':4,18,60,100 'cufft':2,8,22 'current':68 'deep':45,110 'depend':85 'engin':42 'fast':19,104 'fft':31,103 'ffts':99 'fourier':20,105 'framework':91 'frequent':65 'fundament':36 'gpu':26,97,107 'gpu-acceler':25,96 'higher':88 'higher-level':87 'includ':44 'instal':61 'june':74 'learn':46,111,113 'level':84,89 'leverag':95 'librari':14,28,53,93 'low':83 'low-level':82 'machin':112 'maintain':56 'mathemat':116 'nativ':12 'nvidia':1,7,16,59,101 'nvidia-cufft-cu12':6 'perform':30 'physic':51 'primarili':78 'process':115 'product':23 'provid':10 'python':90 'receiv':64 'releas':72 'runtim':13,102 'scientif':40,108 'serv':79 'signal':114 'team':62 'transform':21,106 'updat':66 'various':39 'version':69 'vision':48","created_at":"2026-03-28T17:09:30.995138+00:00","updated_at":"2026-04-16T17:27:52.991136+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"11.4.1.4","cli_name":"","cli_version":null,"type":"library","homepage":"https://developer.nvidia.com/cuda-zone","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/nvidia-cufft-cu12/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","database","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":"stale"}}