NVIDIA CUDA NVRTC
The `nvidia-cuda-nvrtc` package provides the NVRTC (NVIDIA CUDA Runtime Compilation) native shared libraries. These libraries allow applications to compile CUDA C++ source code into PTX or cubin at runtime. It is a dependency for other Python libraries (e.g., PyTorch, JAX, TensorFlow, Numba) and C++/CUDA applications that need NVRTC functionality, ensuring that a compatible version of the NVRTC library is available. As of version 13.2.51, it aligns with CUDA Toolkit 13.2 and is actively maintained as part of NVIDIA's CUDA Python ecosystem, with releases typically coinciding with CUDA Toolkit updates.
Warnings
- gotcha No direct Python API is exposed by this package. Unlike typical Python libraries, `nvidia-cuda-nvrtc` does not provide Python symbols or classes for direct interaction with NVRTC functions. Its sole purpose is to provide the underlying native shared libraries (`libnvrtc.so` on Linux, `nvrtc64_*.dll` on Windows) which other Python frameworks (like PyTorch, JAX, or Numba) or C/C++ applications will then load and use.
- gotcha Requires a compatible NVIDIA GPU driver and CUDA Toolkit. While `nvidia-cuda-nvrtc` provides the NVRTC library, it does not install the full CUDA Toolkit or a GPU driver. For actual GPU computation or full CUDA functionality, your system must have a compatible NVIDIA GPU, an installed NVIDIA driver, and potentially a full CUDA Toolkit if you are compiling custom CUDA code or using other CUDA features.
- gotcha Version alignment with CUDA Toolkit is critical. The version of `nvidia-cuda-nvrtc` (e.g., 13.2.x) directly corresponds to a specific CUDA Toolkit version (e.g., CUDA 13.2). Mismatches between the `nvidia-cuda-*` packages, system CUDA installations, or the CUDA versions expected by dependent libraries can lead to runtime errors, linker issues, or unexpected behavior.
- gotcha Implicit usage by dependent frameworks. Unlike many Python packages where you explicitly `import` and call functions, `nvidia-cuda-nvrtc` is typically consumed implicitly by higher-level machine learning frameworks or GPU computing libraries. You might not see direct references to it in your code, but its absence or incompatibility can cause failures in these frameworks.
Install
-
pip install nvidia-cuda-nvrtc
Quickstart
print("The nvidia-cuda-nvrtc package has been installed.")
print("It provides native shared libraries for runtime CUDA compilation.")
print("Other libraries (e.g., PyTorch, JAX) will automatically use these libraries if compatible.")
# No direct Python API calls are available from this package itself.