Installing NVIDIA Drivers and CUDA 8 Toolkit on Ubuntu 16.04

Step 1: Update and upgrade your system
apt-get update && apt-get upgrade -y

Step 2: Install Linux Headers (for installing aptitude “apt install aptitude”)
aptitude -r install linux-headers-$(uname -r)

Step 3: apt-get purge nvidia-*

Step 4: add-apt-repository ppa:graphics-drivers/ppa

Step 5: apt-get update

Step 6: apt-get install nvidia-375

Step 7: Create a file and paste the following lines
gedit /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
(Paste Following)
blacklist nouveau
options nouveau modeset=0

For troubleshoot info:

step 8: Download CUDA 8 Toolkit latest from

Click Download Now


Scroll below and Click Legacy Releases


Click on CUDA Toolkit 8.0 GA2


Select appropriate settings for your machine as shown and in installer type select deb (local)


Download both Base Installer and Patch 2 setup as shown


step 9: Follow CUDA installation steps and install CUDA 8
1. sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
2. sudo apt-get update
3. sudo apt-get install cuda
4. sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8.0.61-1_amd64.deb

5. gedit (Write down the following lines and make sure to change version 375.<66>)
or if you already have this script move to next step.
sudo mv /usr/lib/nvidia-375/ /usr/lib/nvidia-375/
sudo mv /usr/lib32/nvidia-375/ /usr/lib32/nvidia-375/
sudo ln -s /usr/lib/nvidia-375/ /usr/lib/nvidia-375/
sudo ln -s /usr/lib32/nvidia-375/ /usr/lib32/nvidia-375/

6. Run the above script
chmod +x

7. Post Installation step (path setting append in the file)
gedit ~/.bashrc
#CUDA home path
export CUDA_HOME=/usr/local/cuda

# CUDA Bin Path
export PATH=/usr/local/cuda-8.0/bin:$PATH

# CUDA Library Path
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

# Use OpenCV and other custom-built libraries.
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH


Join the Discussion

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

Up ↑

%d bloggers like this: