{"id":1590,"library":"nvidia-cufft","title":"NVIDIA cuFFT","description":"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.","status":"active","version":"12.2.0.37","language":"python","source_language":"en","source_url":"https://developer.nvidia.com/cuda-toolkit","tags":["GPU","CUDA","FFT","scientific-computing","runtime","deep-learning"],"install":[{"cmd":"pip install nvidia-cufft","lang":"bash","label":"Install nvidia-cufft"}],"dependencies":[{"reason":"Commonly used Python library that leverages nvidia-cufft for GPU-accelerated FFTs. Used in quickstart example.","package":"cupy","optional":true}],"imports":[],"quickstart":{"code":"import cupy as cp\nimport cupy.fft as cufft\n\n# Ensure CUDA is available and nvidia-cufft binaries are usable by CuPy\nif not cp.cuda.is_available():\n    print(\"CUDA is not available. CuPy cannot use cuFFT.\")\nelse:\n    print(f\"CuPy version: {cp.__version__}\")\n    print(f\"CUDA driver version: {cp.cuda.runtime.getDriverVersion()}\")\n    print(f\"CUDA runtime version: {cp.cuda.runtime.get_version()}\")\n\n    # Example: Perform a 1D FFT on the GPU using CuPy\n    a_h = cp.arange(10, dtype=cp.float32) # Host array (CPU)\n    a_d = cp.asarray(a_h) # Transfer to Device (GPU)\n    \n    print(f\"\\nOriginal array on GPU: {a_d}\")\n    \n    # Perform FFT on GPU using CuPy's wrapper for cuFFT\n    fft_result_d = cufft.fft(a_d)\n    \n    print(f\"FFT result on GPU: {fft_result_d}\")\n    \n    print(\"\\nNote: The `nvidia-cufft` package provides the underlying native\")\n    print(\"libraries that enable CuPy's GPU FFT functions to work. This\")\n    print(\"package itself does not expose direct Python imports or APIs.\")","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"The `nvidia-cufft` package does NOT expose a direct Python API for cuFFT functions. It provides only the native runtime libraries (e.g., `.so` or `.dll` files) that other Python libraries (like CuPy, PyTorch, or TensorFlow) link against to offer GPU-accelerated FFT capabilities.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"Ensure the `nvidia-cufft` version is compatible with your installed NVIDIA CUDA Toolkit and driver version, as well as the CUDA versions targeted by other GPU-accelerated Python libraries (e.g., CuPy, PyTorch). Mismatches can lead to runtime errors, crashes, or unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"For most users, `nvidia-cufft` is installed as an indirect dependency when installing other GPU-accelerated Python libraries (e.g., `cupy`). Manual installation is usually not necessary unless troubleshooting specific environment setups or dependency issues.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'12.2.0.37':58 'acceler':51 'api':27 'comput':53,77 'conjunct':66 'cuda':11,69,73 'cufft':2,6,15,47 'cupi':41 'current':55 'deep':80 'deep-learn':79 'depend':35 'environ':21 'fast':12 'fft':52,74 'fourier':13 'gpu':50,72 'gpu-acceler':49 'learn':81 'level':34 'leverag':46 'librari':18,39 'like':40 'low':33 'low-level':32 'nativ':16 'new':60 'nvidia':1,5,10,68 'nvidia-cufft':4 'packag':7 'provid':8 'python':20,26,38 'pytorch':42 'rather':30 'releas':64 'runtim':17,78 'scientif':76 'scientific-comput':75 'tensorflow':44 'toolkit':70 'transform':14 'typic':63 'updat':71 'version':56,61","created_at":"2026-04-09T03:54:40.132804+00:00","updated_at":"2026-04-16T17:27:45.519101+00:00","problems":[{"fix":"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.","cause":"The system's NVIDIA CUDA driver is either not installed, not correctly configured, or its path is not included in the system's dynamic linker search paths (e.g., LD_LIBRARY_PATH on Linux or system PATH on Windows). Since `nvidia-cufft` relies on the underlying CUDA runtime, it cannot function without a discoverable driver. This error often appears when a Python library like Numba or CuPy attempts to initialize CUDA.","error":"CUDA driver library cannot be found."},{"fix":"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`.","cause":"A dependent application (e.g., a build system like CMake for Lammps, or a Python library at runtime) could not locate the `nvidia-cufft` runtime library (e.g., `libcufft.so`). This usually means the library is not installed, or its directory is not included in the system's dynamic linker search paths, or a specific environment variable like `CUFFT_LIBRARY` is not set.","error":"Required cuFFT library not found. Check your environment or set CUFFT_LIBRARY to its location"},{"fix":"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.","cause":"This Python-level warning or error (often seen from libraries like CuPy or Numba) indicates that the Python interpreter or a loaded module was unable to dynamically load the `libcuda.so.1` shared library. This is a common symptom of the underlying CUDA driver not being found or being inaccessible, preventing `nvidia-cufft` and other CUDA libraries from initializing.","error":"Failed to dlopen libcuda.so.1"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"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/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-09","next_check":"2026-07-08","install_tag":null}}