How to check CUDA version on Ubuntu 20.04 Focal Fossa Linux

The objective of this tutorial is to show the reader how to check CUDA version on Ubuntu 20.04 Focal Fossa Linux.

In this tutorial you will learn:

  • How to check CUDA version on Ubuntu

How to check CUDA version on Ubuntu 20.04 Focal Fossa Linux

How to check CUDA version on Ubuntu 20.04 Focal Fossa Linux

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
Software CUDA
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to check CUDA version on Ubuntu 20.04 step by step instructions



  1. The first method is to check the version of the Nvidia CUDA Compiler nvcc. To do so execute:
    $ nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2019 NVIDIA Corporation
    Built on Wed_Oct_23_19:24:38_PDT_2019
    Cuda compilation tools, release 10.2, V10.2.89
    
  2. Given that you have the Nvidia driver installed on your Ubuntu 20.04 system, the following command will also reveal the CUDA version:
    $ nvidia-smi 
    Wed Jan 15 11:48:58 2020       
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 440.44       Driver Version: 440.44       CUDA Version: 10.2     |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |===============================+======================+======================|
    |   0  GeForce GTX 106...  Off  | 00000000:01:00.0  On |                  N/A |
    | 24%   35C    P8     6W / 120W |    330MiB /  6077MiB |      0%      Default |
    +-------------------------------+----------------------+----------------------+
                                                                                   
    +-----------------------------------------------------------------------------+
    | Processes:                                                       GPU Memory |
    |  GPU       PID   Type   Process name                             Usage      |
    |=============================================================================|
    |    0      1090      G   /usr/lib/xorg/Xorg                            18MiB |
    |    0      9782      G   /usr/lib/xorg/Xorg                            74MiB |
    |    0     10001      G   /usr/bin/gnome-shell                         113MiB |
    |    0     11724      G   gnome-control-center                           1MiB |
    +-----------------------------------------------------------------------------+
    


  3. If you did not changed the default CUDA installation path, you can also check the CUDA version simply by viewing the content of the /usr/local/cuda/version.txt file:
  4. $ cat /usr/local/cuda/version.txt
    CUDA Version 10.2.89
    
  5. Check for installed CUDA toolkit package:
    $ dpkg -l | grep cuda-toolkit
    ii  cuda-toolkit-10-2 10.2.89-1 amd64    CUDA Toolkit 10.2 meta-package