Check and install your NVIDIA driver and CUDA toolkits in Ubuntu/Debian

2016-06-10

In order to run frameworks and packages like tensorflow and arrayfire, GPU drivers need to be replaced by NVIDIA drivers and we need to install CUDA toolkits including cusparse,cudnn, etc. to make CUDA C compilable on your computer.

Check your GPU type and serial number:

1
lspci -V

or use glxinfo

1
glxinfo|grep render

Check Drivers

run glxinfo|head if direct rendering: Yes = driver is installed well

Install GPU Drivers

Add the ppa repo

1
2
sudo add-apt-repository ppa:graphics-drivers/ppa -y
sudo apt-get update

Install the recommended driver

1
2
sudo ubuntu-drivers autoinstall
sudo reboot

Install CUDA and some other packages

Install everything else

1
2
sudo apt-get install nvidia-{prime,profiler,settings,visual-profiler} -y
sudo apt-get install nvidia-cuda-{dev,doc,gdb,toolkit} -y