24

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.

einpoklum
  • 118,144
  • 57
  • 340
  • 684

1 Answers1

19

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.

Community
  • 1
  • 1
Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • 1
    (sigh) I get it now. So, I can blame the confusing names, then... Thanks. You've given me a bit of work to do on [this](https://github.com/eyalroz/cuda-api-wrappers). – einpoklum Nov 14 '16 at 16:17
  • Also, how exactly do I interpret the 8000? Are the three lowest decimal digits a single 'minor version number', or is it something like 8.0.0 or 8.0.0.0? After all, the CUDA 8.0 release was named 8.0.44 last time I downloaded. – einpoklum Nov 14 '16 at 23:18
  • 2
    Study the `deviceQuery` cuda sample code for interpretation hints. There is no sub-versioning here. 8000 = CUDA 8 – Robert Crovella Nov 15 '16 at 01:27
  • I still don't get it. Can someone ELI5? How do I check both of these outside of code (is there a way via the command line for both?). Is there also a driver for the graphics card itself (so 3 things: CUDA runtime, CUDA driver, Nvidia drive), or just the 2 things? – Breck Dec 08 '18 at 01:19
  • 4
    1. There is a GPU driver version. Query it with `nvidia-smi`. 2. There is a CUDA compatibility version associated with the driver (but there is a 1:1 correspondence between a specific GPU driver version and its associated CUDA compatibility version). The `nvidia-smi` tool bundled with recent drivers will display the CUDA compatibility version that they have. 3. There is a CUDA runtime version, which would be associated with the runtime API you use to build a particular runtime API code. You can query this with `nvcc -v` for example, or these last 2 things with `deviceQuery` sample code. – Robert Crovella Dec 08 '18 at 03:07