NVIDIA JIT LTO Library (CUDA 12)

12.9.86 · active · verified Sun Apr 05

The `nvidia-nvjitlink-cu12` package is a metapackage that facilitates the installation of the NVIDIA JIT LTO (Just-In-Time Link Time Optimization) library, `nvJitLink`, as part of the CUDA Toolkit for CUDA 12.x environments. It ensures the presence of the native C-based `nvJitLink` library, which is used by other Python libraries like CuPy and Numba-CUDA for advanced GPU code compilation and linking at runtime. This package itself does not expose direct Python APIs for JIT linking. The current version is 12.9.86, and it follows the CUDA Toolkit's release cadence.

Warnings

Install

Imports

Quickstart

Since `nvidia-nvjitlink-cu12` is a metapackage for native CUDA components, its functionality is indirectly exposed through other Python libraries that depend on the `nvJitLink` library. This quickstart demonstrates how to check for the availability of a CUDA-capable GPU and the CUDA runtime environment using `CuPy` and `Numba-CUDA`, which would implicitly rely on `nvJitLink` if their features that use it are invoked. This verifies that the underlying CUDA toolkit, which `nvidia-nvjitlink-cu12` helps install, is correctly set up.

import os

try:
    import cupy as cp
    print(f"CuPy is installed. CUDA available: {cp.cuda.is_available()}")
    if cp.cuda.is_available():
        print(f"CuPy CUDA Device Count: {cp.cuda.runtime.getDeviceCount()}")
except ImportError:
    print("CuPy not installed. Install with `pip install cupy-cuda12x` to verify CUDA environment.")

try:
    import numba.cuda
    print(f"Numba CUDA is installed. CUDA available: {numba.cuda.is_available()}")
    if numba.cuda.is_available():
        print(f"Numba CUDA Device Count: {numba.cuda.count_devices()}")
except ImportError:
    print("Numba-CUDA not installed. Install with `pip install numba-cuda` to verify CUDA environment.")

print("\nThis output indicates whether higher-level Python libraries can detect and use the CUDA environment, which includes the nvJitLink library provided by nvidia-nvjitlink-cu12.")

view raw JSON →