Why CUDA Compatibility#

The NVIDIA® CUDA® Toolkit enables developers to build NVIDIA GPU accelerated compute applications for desktop computers, enterprise, and data centers to hyperscalers. It consists of the CUDA compiler toolchain including the CUDA runtime (cudart) and various CUDA libraries and tools. To build an application, a developer has to install only the CUDA Toolkit and necessary libraries required for linking.

In order to run a CUDA application, the system should have a CUDA enabled GPU and an NVIDIA driver that is compatible with the CUDA Toolkit that was used to build the application itself. If the application relies on dynamic linking for libraries, then the system should have the right version of such libraries as well.

Components of CUDA

Figure 1 Components of CUDA#

Every CUDA toolkit also ships with an NVIDIA driver package for convenience. This driver supports all the features introduced in that version of the CUDA Toolkit. Please check the toolkit and driver version mapping in the release notes. The driver package includes both the user mode CUDA driver (libcuda.so) and kernel mode components necessary to run the application.

Typically, upgrading a CUDA Toolkit involves upgrading both the toolkit and the driver to get up to date toolkit and driver capabilities.

CUDA Upgrade Path

Figure 2 CUDA Upgrade Path#

As you can see, when the NVIDIA driver is upgraded along with the CUDA Toolkit, the CUDA Driver and CUDA Runtime versions in the sample output of deviceQuery match perfectly:

$ ./deviceQuery
./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "NVIDIA GeForce RTX 4070 SUPER"
  CUDA Driver Version / Runtime Version          12.8 / 12.8
  CUDA Capability Major/Minor version number:    8.9
[...]
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.8, CUDA Runtime Version = 12.8, NumDevs = 1
Result = PASS

This is not always required. CUDA Compatibility guarantees allow for upgrading only certain components:

  • Backwards compatibility ensures that a newer NVIDIA driver can be used with an older CUDA Toolkit. This is implicit and most simple way of doing upgrades.

  • Minor version and forward compatibility ensure that an older NVIDIA driver can be used with a newer CUDA Toolkit.

Applications that directly rely only on the CUDA runtime can be deployed in the following scenarios:

CUDA driver (libcuda.so)

Compatibility type

Requirements

Newer than the CUDA runtime

Backwards compatibility

None

Older than the CUDA runtime, but same major version of the CUDA runtime

Minor Version Compatibility

No PTX (requires SASS), NVCC target architecture required

Older than the major version of the CUDA runtime

Forward Compatibility

Extra CUDA compatibility package