32

I am using ubuntu 14.04. I want to install CUDA. But I don't know which version is good for my laptop. I trace my driver that is:

$cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86_64 Kernel Module  304.125  Mon Dec  1 19:58:28 PST 2014
GCC version:  gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 

I tried to install CUDA cuda-linux64-rel-7.0.28-19326674 but when I test by command:

./deviceQuery
./deviceQuery Starting...

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

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

Could you help me resolve that problem? I reinstalled my Ubuntu many times.

Parker
  • 7,244
  • 12
  • 70
  • 92
Jame
  • 3,746
  • 6
  • 52
  • 101

2 Answers2

102

304.xx is a driver that will support CUDA 5 and previous (does not support newer CUDA versions.)

If you want to reinstall ubuntu to create a clean setup, the linux getting started guide has all the instructions needed to set up CUDA if that is your intent.

I believe you are picking up a 304.xx driver via a specific (ie. separate) driver install. This is not necessary if you want to use CUDA 7, you can just use the runfile installer method which has all the necessary components including an appropriate driver (346.46). Note that CUDA 7 will not be usable with older CUDA GPUs of compute capability 1.x. For those GPUs, CUDA 6.5 should work. Starting with CUDA 9.x, older CUDA GPUs of compute capability 2.x are also not supported. Older CUDA toolkits are available for download here. Note that any given CUDA toolkit has specific Linux distros (including version number) that are supported. Not all distros are supported on every CUDA toolkit version. The general support matrix is contained in the linux install guide for the specific CUDA version of interest.

For reference, on linux, the previous CUDA toolkits required the following minimum driver versions:

For versions newer than 11.0, refer to the table in the release notes linked below
CUDA 11.0: 450.36.06
CUDA 10.2: 440.33.01
CUDA 10.1: 418.39
CUDA 10.0: 410.48
CUDA  9.2: 396.xx
CUDA  9.1: 390.xx (update)
CUDA  9.0: 384.xx
CUDA  8.0  375.xx (GA2)
CUDA  8.0: 367.4x
CUDA  7.5: 352.xx
CUDA  7.0: 346.xx
CUDA  6.5: 340.xx
CUDA  6.0: 331.xx
CUDA  5.5: 319.xx
CUDA  5.0: 304.xx
CUDA  4.2: 295.41
CUDA  4.1: 285.05.33
CUDA  4.0: 270.41.19
CUDA  3.2: 260.19.26
CUDA  3.1: 256.40
CUDA  3.0: 195.36.15

A portion of this table is maintained as Table 3 here in the release notes.

This answer may also be of interest.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • 1
    I tried to install cuda v 5.0 but it has error is /usr/local/cuda-5.0/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.7 and up are not supported! #error -- unsupported GNU version! gcc 4.7 and up are not supported! – Jame Jun 13 '15 at 16:31
  • 1
    CUDA 5 is not compatible with Ubuntu 14.04. The versions of Ubuntu that were officially supported by CUDA 5 are 11.10 and 10.04 as indicated [here](https://developer.nvidia.com/cuda-toolkit-50-archive) – Robert Crovella Jun 13 '15 at 16:34
  • Right. However, my nvidia version only suport for cuda 5.0. That mean i cannot install cuda, right? – Jame Jun 13 '15 at 16:38
  • 1
    I don't know what "my nvidia version only suport for cuda 5.0" means. If you want to use Ubuntu 14.04, I'm suggesting you start over with a clean install of Ubuntu 14.04, and install CUDA 7. The only caveat, as already mentioned, is if you have an older NVIDIA GPU, you may want to install CUDA 6.5 instead. – Robert Crovella Jun 13 '15 at 16:39
  • As I debug, my nvidia version is only work for 304.xx. Then from your table, I saw that I must install cuda 5.0. Is it right? – Jame Jun 13 '15 at 16:41
  • If you want to use driver 304.xx you can only use CUDA 5.0 (or before). But, as you've discovered, CUDA 5.0 is not supported on Ubuntu 14.04. Therefore using driver 304.xx on Ubuntu 14.04 is a **bad idea** in my opinion. If you simply use CUDA 7.0 or CUDA 6.5, you should not have this trouble. – Robert Crovella Jun 13 '15 at 16:43
  • I tried to install both cuda 6.5 and 7.0 but they did not work. When I update my drive to 331 or more. I cannot login in my compute. It lost GUI. That is reason why I only choose 304.xx version for nvidia – Jame Jun 13 '15 at 16:45
  • 2
    1. Reload Ubuntu 14.04. 2. Do not install any separate drivers like 304.xx or 331.xx. 3. Follow *all* the instructions in the linux getting started guide, including things like [removing nouveau](http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#runfile-nouveau) 4. Use the CUDA 7 runfile installer method *only*. It will work, assuming you have a supported GPU. You have not indicated what GPU you are using. – Robert Crovella Jun 13 '15 at 16:49
  • I know this is like a year late, but where did you get the list of CUDA versions with minimum driver numbers? CUDA 8.0 is out now, and I can't find the minimum driver version. – CptSupermrkt Aug 02 '16 at 16:06
  • 3
    The list isn't available somewhere all in one place. I compiled it from several sources. For more recent versions of CUDA, I simply used the driver version that shipped with that particular CUDA toolkit installer. For older versions, I assembled the info by looking at the Legacy CUDA toolkits archive. I don't generally update the table above for RC versions, and CUDA 8 is currently in an RC status. When CUDA 8 goes to production status, I'll try to remember to update the above table for CUDA 8. CUDA 8RC minimum driver version is 361.62 (for linux). – Robert Crovella Aug 02 '16 at 16:17
  • This was very useful – Pavithran Ravichandiran Dec 08 '17 at 10:11
  • 1
    Can this table be maintained as a gist or somewhere more official (wiki even)? It would be nice to have a CUDA - Driver Version - Compute Capability - cuDNN - Tensorflow version. – CMCDragonkai Apr 27 '18 at 05:50
  • Very helpful :) – SebiSebi Apr 28 '18 at 12:05
  • The recently made edit to this answer was misleading. A R450 driver is not sufficient for CUDA 11.5 (for example) **in the general case**. For an R450 driver to be usable with CUDA 11.5 would require the special compatibility capability, which requires specific libraries to be installed and also only works for certain GPU types. I believe the answer as-is referring people to the table in the documentation, where compatibility mode is referenced, is preferable to the edit. (Compare table 2 and table 3 in the release notes.) – Robert Crovella Dec 16 '21 at 21:19
1

The driver version is only half of the compatibility equation. The other half is the Compute Capability. A GPU will support a specific compute version, and if your CUDA version minimum compute capability is higher than that supported by your GPU, your code will not compile or run. For instance, my laptop has an nVidia CUDA 2.1 GPU, which means I can't install a CUDA toolkit more recent than CUDA 8.0 GA2. This in turn means that I need to install an nVidia driver that is compatible with my CUDA version.

CUDA Version        Minimum Compute Capability  Default Compute Capability
CUDA 10.0           3.0                         3.0
CUDA 9.2 update 1   3.0                         3.0
CUDA 9.2            3.0                         3.0
CUDA 9.1            3.0                         3.0
CUDA 9.0            3.0                         3.0
CUDA 8.0 GA2        2.0                         2.0
CUDA 8.0            2.0                         2.0
CUDA 7.5            2.0                         2.0
CUDA 7.0            2.0                         2.0
CUDA 6.5            1.1                         2.0
CUDA 6.0            1.0                         1.0
CUDA 5.5            1.0                         1.0
CUDA 5.0            1.0                         1.0
CUDA 4.2            1.0                         1.0
CUDA 4.1            1.0                         1.0
CUDA 4.0            1.0                         1.0
CUDA 3.2            1.0                         1.0
CUDA 3.1            1.0                         1.0
CUDA 3.0            1.0                         1.0

The third thing you may need to consider is compiler compatibility. For instance, a minimum version of the gcc compiler is needed for compatibility with specific CUDA versions.

Parker
  • 7,244
  • 12
  • 70
  • 92
  • 2
    "a minimum version of the gcc compiler" and also a **maximum** version, which has caused more trouble for me than the minimum... – Marc Glisse Mar 06 '20 at 19:58
  • see [here](https://stackoverflow.com/questions/28932864/cuda-compute-capability-requirements/28933055#28933055) – Robert Crovella Dec 16 '21 at 21:23