How to install Nvidia Driver and Cuda 10.0 in Ubuntu 16.04

The post is about to install the latest Nvidia driver and Cuda 10 on Ubuntu 16.04 LTS. Cuda driver have dependency of Nvidia driver so first we will install Nvidia driver.

Download the nvidia driver run file local from below link (it should be around 1.2 Gb).

Allow permission of downloaded nvidia driver file with chmod command

sudo chmod +x

Create a new folder name nvidia_drivers and extract the cuda run files in this folder.

mkdir nvidia_drivers

./path to –extract=path to nvidia_drivers folder we created above/

Go to nvidia_drivers folder and list the extracted file there should be 3 files Nvidia Driver , cuda run and cuda sample file.

path_to nvidia_drivers folder ls

Install the Nvidia Driver with below command

sudo ./ –no-x-check

Restart the system and check the nvidia driver installation


We installed the nvidia driver 410 in system now we can install cuda driver.

Install the cuda 10 with below command press d, accept the EULA licensce. After successful installation restart system.

sudo ./

Add the cuda bin and library path to bashrc file.

Open .bashrc file (sudo gedit ~/.bashrc) and add following two lines at end

export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}

export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

source ~/.bashrc or close and open new terminal

Check the cuda installation

nvcc –version

That’s it we are done.

All commands together

  1. sudo apt-get purge nvidia-*        (remove old nvidia drivers)
  2. restart system
  3. Download cuda local file
  4. sudo chmod +x (allow r/w permission)
  5. mkdir nvidia_drivers ( create new folder)
  6. ./path to –extract=path to nvidia_drivers folder we created above/
  7. sudo ./ –no-x-check
  8. restart system
  9. nvidia-smi
  10. sudo ./
  11. export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}
  12. export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  13. source ~/.bashrc or close and open new terminal
  14. nvcc –version

Happy learning cheers