← Glossary
CUDA glossaryTooling
CC 7.5

What is the CUDA driver API?

The lower-level cu* interface in libcuda, shipped with the driver rather than the toolkit, which is why its version differs from nvcc's.

The header comes with the toolkit; the library does not. libcuda.so.1 on Linux and nvcuda.dll on Windows arrive with the display driver, which is why a machine with no toolkit at all can still run a CUDA program somebody else compiled. What you trade for the extra typing is control. NVIDIA's own comparison puts it as "more fine-grained control, especially over module loading": with the runtime API "all the kernels are automatically loaded during initialization and stay loaded for as long as the program runs", while the driver API lets you "only keep the modules that are currently needed loaded, or even dynamically reload modules". Launches get explicit too, since "the execution configuration and kernel parameters must be specified with explicit function calls" rather than <<<>>>. The two are not rivals: "CUDA clients can use the driver API to create and set the current context, and then use the runtime API to work with it."

This course teaches the runtime API and only the runtime API. The driver API earns its place when you load cubins or PTX at run time (which is how frameworks ship kernels they compile on your machine), when you need explicit control over contexts per thread, or when you reach green contexts. None of that is day 3's problem.

What is day 3's problem is the version confusion this API sits at the centre of, the one behind a Stack Overflow question with 360,646 views. Three numbers, three sources:

Number Where it comes from Example from our node
Driver package version The driver you installed. Left column of nvidia-smi 595.84
Highest CUDA the driver accepts The driver API, and the CUDA Version: header of nvidia-smi 13.2
Toolkit version The toolkit that compiled the binary, what nvcc --version prints 12.6

The middle row is the one people read as "the CUDA I have installed". It is not. It is a ceiling. A toolkit below the ceiling is the normal, working case, and two floors appear in the release notes and only one binds. Table 2 lists 580 as the minor-version-compatibility floor for 13.x; Table 3 lists the toolkit driver version, where 13.3 Update 1 needs 610.43.02. This node runs 595.84, above the first and below the second, which is exactly why it caps at CUDA 13.2.

Measured

On a Tesla T4 (driver 595.84, CUDA 12.6, V12.6.85, built with nvcc -O3 -arch=sm_75), day 3 printed max CUDA the driver takes 13.2 next to runtime version 12.6, captured 2026-08-30 on the project's verification node. Both numbers come out of cudart, not out of libcuda: cudaDriverGetVersion "returns the latest version of CUDA supported by the driver", and since 12.0 cudaRuntimeGetVersion "As of CUDA 12.0, this function no longer initializes CUDA" and its purpose "is solely to return a compile-time constant stating the CUDA Toolkit version". Full run behind How to set up CUDA.

Diagram

The measured machine pairs a CUDA 12.6 toolkit with driver package 595.84; cudaDriverGetVersion reports CUDA 13.2 as the highest CUDA version supported by that driver.

Code

Two slices of day 3's devicequery.cu settle the argument, without a single cu* call:

    int driverVersion = 0;
    int runtimeVersion = 0;
    CUDA_CHECK(cudaDriverGetVersion(&driverVersion));
    CUDA_CHECK(cudaRuntimeGetVersion(&runtimeVersion));
// Formats the packed integer that cudaDriverGetVersion and
// cudaRuntimeGetVersion return. 12060 is 12.6.
static void printVersion(const char* label, int version) {
    std::printf("  %-28s %d.%d\n", label, version / 1000,
                (version % 1000) / 10);
}

Both numbers are encoded as 1000 * major + 10 * minor, so 13020 prints as 13.2 and 12060 as 12.6. If no driver is installed, cudaDriverGetVersion returns 0.

Related terms

CUDA runtime API · nvidia-smi · JIT compilation · green context · nvcc · compute capability

Where you meet this

Day 3, how to set up CUDA, prints all three numbers off your own card, and what the driver does before your first launch shows up in day 9's timings; nvcc and nvidia-smi disagree is the page for the query as people type it, and which CUDA version works with your driver has the floors. When the driver is genuinely too old, you land on CUDA driver version is insufficient for CUDA runtime version.

Sources

Byline

Author and reviewer are unassigned. This entry publishes when two different named people have signed it; the written and last-checked dates are set then.