Registry / ai-ml / nvidia-cuda-runtime-cu12

nvidia-cuda-runtime-cu12

JSON →
library12.9.79pypypiunverified

This package provides the native CUDA Runtime libraries as Python Wheels, enabling Python applications to leverage GPU acceleration by providing core runtime functionalities. It is part of NVIDIA's initiative to offer native Python support for CUDA, simplifying GPU-based parallel processing for high-performance computing, data science, and AI workloads. The current version is 12.9.79, with releases generally aligning with the NVIDIA CUDA Toolkit.

ai-ml
pip install nvidia-cuda-runtime-cu12
Install & Compatibility
Where this runs
tested against v12.9.79 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
4/5 runs
py 3.11
✕ build_error
4/5 runs
py 3.12
✕ build_error
4/5 runs
py 3.13
✕ build_error
4/5 runs
py 3.9
✕ build_error
4/5 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Not directly imported
This package primarily provides native shared libraries. High-level Python libraries (e.g., PyTorch, TensorFlow, or the `cuda-python` project's `cuda.core` module) implicitly link against and utilize these runtime components, rather than requiring direct imports of `nvidia_cuda_runtime_cu12` itself in user code.
Users typically interact with CUDA through higher-level frameworks that depend on this runtime. To check for CUDA availability, you would use functions provided by those frameworks.

While `nvidia-cuda-runtime-cu12` itself doesn't offer direct high-level Python APIs, its successful installation allows frameworks like PyTorch to leverage the CUDA runtime. This snippet demonstrates how to verify that a CUDA-enabled PyTorch (which depends on this runtime) can detect and utilize your GPU.

import torch if torch.cuda.is_available(): print(f"CUDA is available! Version: {torch.version.cuda}") print(f"Number of GPUs: {torch.cuda.device_count()}") print(f"Current GPU name: {torch.cuda.get_device_name(0)}") else: print("CUDA is not available. Please check your installation and drivers.")
Debug
Known issues
breakingIncompatible NVIDIA GPU drivers with the installed CUDA version can lead to runtime errors (e.g., 'CUDA driver version is insufficient'). The GPU driver must be sufficiently new to support the installed CUDA toolkit version.
fix
Ensure your NVIDIA GPU drivers are updated to a version compatible with CUDA 12.x. Check NVIDIA's official documentation for driver requirements corresponding to your specific CUDA version.
affects: All versions
gotchaThis package provides CUDA runtime libraries, not the full CUDA development toolkit (e.g., it does not include `nvcc`). If you need to compile CUDA code (e.g., custom kernels or certain libraries from source), a separate, full CUDA Toolkit installation is required.
fix
For compilation, download and install the complete NVIDIA CUDA Toolkit from developer.nvidia.com/cuda-downloads alongside this runtime package. Ensure `nvcc` is in your system's PATH.
affects: All versions
gotchaCUDA binaries and libraries (like `cudart64_12.dll` on Windows or `libcudart.so.12` on Linux) need to be correctly discoverable via system environment variables (`PATH`, `LD_LIBRARY_PATH` on Linux, or `CUDA_PATH` on Windows). Incorrect setup can result in applications failing to find the CUDA runtime.
fix
Manually add the CUDA binary and library paths (e.g., `/usr/local/cuda/bin`, `/usr/local/cuda/lib64` on Linux, or `%CUDA_PATH%\bin`, `%CUDA_PATH%\lib\x64` on Windows) to your system's environment variables. Restart your shell or IDE after changes.
affects: All versions
gotchaWhen upgrading CUDA (especially major versions), some older APIs or functions might be deprecated or behave differently, potentially requiring modifications to existing CUDA C/C++ code.
fix
Consult the NVIDIA CUDA Toolkit Release Notes and Programming Guide for details on deprecated features and API changes during major upgrades. Thoroughly test your applications after upgrading.
affects: Major version upgrades (e.g., CUDA 11 to CUDA 12)
gotchaFor CUDA versions 12.2 and newer, applications that exhibit hanging during the first kernel launch might resolve the issue by setting the `CUDA_MODULE_LOADING` environment variable to `EAGER`.
fix
Set `CUDA_MODULE_LOADING=EAGER` in your environment before running the application. For example, `export CUDA_MODULE_LOADING=EAGER && python my_script.py` on Linux/macOS.
affects: >=12.2
breakingThe 'torch' Python package is not installed or cannot be found in the current Python environment. This prevents the application from importing the necessary PyTorch libraries.
fix
Ensure that the 'torch' package is installed in your Python environment using pip (e.g., `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121` for CUDA 12.1, adjusting for your specific CUDA version or 'cpu' if no GPU is used). Verify that the correct Python interpreter and environment are being used.
affects: All versions
breakingThe package you are trying to install (e.g., `nvidia-cuda-runtime-cu12`) is a placeholder on PyPI.org. These packages are hosted on the NVIDIA Python Package Index, and direct installation from PyPI will result in a runtime error indicating an incorrect package source.
fix
To install packages from the NVIDIA Python Package Index, first install the `nvidia-pyindex` package: `pip install nvidia-pyindex`. Then, proceed with the installation of the desired CUDA runtime package, e.g., `pip install nvidia-cuda-runtime-cu12`.
affects: All versions of packages distributed via the NVIDIA Python Package Index
Upgrade
Version history
12.9.79latest on PyPI
Audit
Dependencies
PythonrequiredRequires Python 3 or newer.
NVIDIA GPUrequiredRequires a CUDA-capable NVIDIA GPU to function.
NVIDIA GPU DriversrequiredRequires compatible and up-to-date NVIDIA GPU drivers.
Agent activity
10 hits · last 30 days
node
4
ahrefsbot
2
seranking-bot
2
Amazon
1
Resources