Installing CUDA on Ubuntu 16.04

So, I came across this problem while installing tensorflow GPU version. Any deeplearning framework’s GPU version needs you to have CUDA installed prior to it. You will have to download the drivers from here . The site simply says to run the file as sudo to install. But wait. If you proceed like this on Ubuntu 16.04, there is a very good chance you will end up with a black screen when you reboot the system. Follow these steps to have a safe CUDA installation:

  • ./ -extract=~/Downloads/nvidia_installers
  • cd ~/Downloads/nvidia_installers
    sudo ./ --no-opengl-files
  • sudo ./
    sudo ./
  • Check if it is installed properly by using:
  • In case driver stops working in future, just run the first command again
    sudo ./ --no-opengl-files

    That should fix it most of the times.

  • In case you already installed the way mentioned on the site and are seeing a black screen, just go to command line interface using ctrl+alt+F2. Login and do
    sudo apt-get --purge remove nvidia-*

    And reboot. Now you should get your display back. Install CUDA as mentioned here.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s