Ubuntu 16.04 + GTX 1080 + CUDA 8.0

June 22, 2016

I have recently acquired a GTX 1080. A few friends have told me that they have been having trouble getting everything working for a standard machine learning setup, so I have decided to document the steps I have taken.

  • Boot from a UEFI USB. Add “nouveau.modeset=0” to the end of the options script (press F6, then Escape, then type), otherwise you will get a blank screen.
  • Install Ubuntu, quite straightforward. Then “nouveau.modeset=0” on grub again (after pressing e) to get to desktop.
  • Download NVIDIA 367.18 driver and CUDA 8.0.
  • Press Alt+Ctrl+F1. Sign in. Type:
sudo service lightdm stop
sudo init 3
sudo sh {INSERT .run of 367.18 driver}
sudo sh {INSERT .run of CUDA}
sudo service lightdm start

Don’t install the drivers that come with CUDA. You will need to change some settings to be able to see text when you Alt+Ctrl+F1 again; you can search for the solution online. Otherwise, you can get to desktop with Alt+Ctrl+F7.

  • Reboot. Now you can install Theano, Lasagne, Keras etc. normally.

Then, if you haven’t already, create a .theanorc file in your $HOME$ directory. Copy and paste:

[global]
device = gpu
floatX = float32

[nvcc]
flags=-D_FORCE_INLINES

[cuda] 
root = /usr/local/cuda-8.0
  • Download cuDNN. Copy and paste the contents of cuDNN to the CUDA directory. Open terminal. Type:
sudo ldconfig /usr/local/cuda-8.0/lib64
  • Hopefully everything should work now. If they don’t, try to reboot. Then, if you have any problems, search for solutions online. The specific details of this setup will probably change quite soon, yet perhaps bits of information will be of help to some in the future.