The CUDA Runtime API exposes the functions
cudaRuntimeGetVersion()
andcudaDriverGetVersion()
(see detailed description here). I was sort of expecting the first one to give me "8.0" (for CUDA 8.0) and the second one to give me the same string as what I'd get from examining nVIDIA's GPU driver kernel module, e.g.
modinfo nvidia | grep "^version:" | sed 's/^version: *//;'
which on my system is 367.57
.
Now, the first call gives me 8000
- fine, just a weird way to say 8.0 I guess; but the second API call also gives me 8000
. So what do both of these mean?
The Runtime API documentation I linked to doesn't seem to explain this.
The CUDA runtime version indicates CUDA compatibility (i.e. version) with respect to the installed cudart (CUDA runtime) library. The CUDA driver version (as reported here) reports the same information with respect to the driver. This relates to the driver compatibility model in CUDA.
The 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.
Nvidia driver includes driver kernel module and user libraries. Cuda toolkit is an SDK contains compiler, api, libs, docs, etc...
The CUDA runtime version indicates CUDA compatibility (i.e. version) with respect to the installed cudart (CUDA runtime) library. The CUDA driver version (as reported here) reports the sameinformation with respect to the driver.
Each version of the CUDA Toolkit (and runtime) requires a minimum version of the NVIDIA driver. The CUDA driver (libcuda.so on Linux for example) included in the NVIDIA driver package, provides binary backward compatibility. For example, an application built against the CUDA 3.2 SDK will continue to function even on today’s driver stack.
In contrast, the CUDA driver API requires more code, is harder to program and debug, but offers a better level of control and is language-independent since it only deals with cubin objects (see Section 4.2.5).
The C host code generated by nvcc is based on the CUDA runtime , so applications that link to this code must use the CUDA runtime API. In contrast, the CUDA driver API requires more code, is harder to program and debug, but offers a better level of control and is language-independent since it only deals with cubin objects.
The CUDA runtime version indicates CUDA compatibility (i.e. version) with respect to the installed cudart (CUDA runtime) library.
The CUDA driver version (as reported here) reports the same information with respect to the driver.
This relates to the driver compatibility model in CUDA. As I am sure you know, a particular CUDA toolkit version (i.e. CUDA runtime library version, nvcc compiler version, etc.) requires a particular minimum driver level for proper use of the codes compiled with that toolkit.
The CUDA driver version (as reported here) effectively reports what CUDA version(s) can be supported by the particular installed driver.
As you've already discovered, it does not report the actual numbered driver version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With