{"id":1437,"library":"cuda-toolkit","title":"NVIDIA CUDA Toolkit (PyPI meta-package)","description":"The `cuda-toolkit` meta-package on PyPI facilitates the installation of NVIDIA CUDA runtime libraries and their dependencies (like cuBLAS, cuDNN) for Python environments. It doesn't provide direct Python APIs but serves as an underlying dependency for deep learning frameworks like PyTorch and TensorFlow to leverage NVIDIA GPUs. The current version is 13.2.0, with updates generally aligning with NVIDIA's main CUDA Toolkit releases, typically a few times per year.","status":"active","version":"13.2.0","language":"en","source_language":"en","source_url":"https://developer.nvidia.com/cuda-toolkit","tags":["gpu","deep-learning","hardware","cuda","nvidia","runtime"],"install":[{"cmd":"pip install cuda-toolkit","lang":"bash","label":"Install the meta-package"}],"dependencies":[{"reason":"Core CUDA runtime libraries, pulled by the meta-package.","package":"nvidia-cuda-runtime"},{"reason":"cuBLAS library for linear algebra, versioned for CUDA 13.x.","package":"nvidia-cublas-cu13"},{"reason":"cuDNN library for deep neural networks, versioned for CUDA 13.x.","package":"nvidia-cudnn-cu13"},{"reason":"Requires compatible NVIDIA GPU hardware.","package":"NVIDIA GPU","optional":false},{"reason":"Requires pre-installed, compatible NVIDIA GPU drivers from NVIDIA's website.","package":"NVIDIA GPU Drivers","optional":false}],"imports":[{"note":"Python libraries like PyTorch or JAX internally detect and utilize the CUDA libraries installed by `cuda-toolkit`.","symbol":"No direct imports","correct":"This package is a meta-package for C++/binary libraries and does not provide direct Python imports. Functionality is exposed via frameworks like PyTorch or TensorFlow."}],"quickstart":{"code":"import torch\n\nif torch.cuda.is_available():\n    print(f\"CUDA is available! Device name: {torch.cuda.get_device_name(0)}\")\n    print(f\"CUDA version: {torch.version.cuda}\")\n    print(f\"PyTorch CUDA version: {torch.cuda.get_device_capability(0)}\")\nelse:\n    print(\"CUDA is NOT available. Check your NVIDIA drivers and cuda-toolkit installation.\")","lang":"python","description":"Since `cuda-toolkit` itself has no Python API, a quickstart demonstrates how a common library like PyTorch leverages the installed CUDA libraries. This snippet checks for CUDA availability and prints device information."},"warnings":[{"fix":"Download and install the correct NVIDIA GPU drivers from the official NVIDIA website (e.g., `www.nvidia.com/drivers`).","message":"The `cuda-toolkit` PyPI package does NOT install NVIDIA GPU drivers. You must manually install compatible drivers from NVIDIA's website for your GPU before attempting to use CUDA.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To use CUDA in Python, install a framework like `torch` or `tensorflow` (ensure you install their CUDA-enabled versions, e.g., `torch` often defaults to CPU if CUDA is not detected or installed correctly).","message":"This package is a meta-package for C++/binary libraries and does not provide direct Python imports. You interact with CUDA through deep learning frameworks (e.g., PyTorch, TensorFlow) or specialized libraries (e.g., Numba, JAX) that link against these installed binaries.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the compatibility matrix of your deep learning framework (e.g., PyTorch, TensorFlow) with the desired CUDA version. You may need to upgrade or downgrade your framework or install a specific `cuda-toolkit` version (e.g., `cuda-toolkit==11.8.0`) to match.","message":"Major CUDA version changes (e.g., from 11.x to 12.x) can introduce incompatibilities with existing deep learning frameworks. Frameworks like PyTorch or TensorFlow are typically built against specific CUDA versions and might not work correctly with significantly newer or older CUDA installations.","severity":"breaking","affected_versions":"All major version changes"},{"fix":"If you need `nvcc` or other development tools, consider a full system installation of the NVIDIA CUDA Toolkit. Ensure its version is compatible with your PyPI `cuda-toolkit` installation.","message":"The `pip install cuda-toolkit` primarily provides the runtime libraries. For full CUDA development (e.g., compiling custom CUDA kernels with `nvcc`), you may still need a full system-wide NVIDIA CUDA Toolkit installation from NVIDIA's developer site, which includes compilers, debuggers, and development headers.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If encountering 'CUDA not found' errors with non-Python tools or specific C++ extensions, try setting `CUDA_HOME` to the root of the PyPI installed CUDA (e.g., `~/.local/lib/pythonX.Y/site-packages/nvidia/cuda_toolkit/`) or manually adding the library paths to `LD_LIBRARY_PATH`.","message":"Despite `pip` installations, certain applications or older scripts might still rely on environment variables like `CUDA_HOME` or `LD_LIBRARY_PATH` to locate CUDA libraries. PyPI installations typically place libraries in Python's site-packages, which might not be on the system's default search paths for all tools.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}