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:

  • ./cuda_8.0.xx_linux.run -extract=~/Downloads/nvidia_installers
  • cd ~/Downloads/nvidia_installers
    sudo ./NVIDIA-Linux-x86_64-367.xx.run --no-opengl-files
  • sudo ./cuda-linux64-rel-6.0.37-18176142.run
    sudo ./cuda-samples-linux-6.0.37-18176142.run
  • Check if it is installed properly by using:
    nvidia-smi
  • In case driver stops working in future, just run the first command again
    sudo ./NVIDIA-Linux-x86_64-367.xx.run --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.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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