Search code examples
cudaversionnvidia

CUDA runtime version vs CUDA driver version - what's the difference?


The CUDA Runtime API exposes the functions

  • cudaRuntimeGetVersion() and
  • cudaDriverGetVersion()

(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.


Solution

  • 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.

    There is no way (currently) to get the actual numbered driver version via the CUDA runtime or driver API. I don't expect changes in the future here because the driver specifics are abstracted at the CUDA level - just as discovered here.

    If you want to retrieve the numbered driver version programmatically, one way to do it would be to use NVML (which is installed and provided by the GPU driver).

    If you wish to see a change in CUDA, you can always file a bug.