CUDA and cuDNN on Ubuntu 17.04

August 14, 2017

In August 2017, using CUDA on Ubuntu 17.04, rather than on 16.04 LTS, is a bit of a pain in the ass, because of the missing official support.

In theory, there are three ways of getting things to work.

  1. The simplest and best way is to use nvidia-docker.
    This way, only the nvidia kernel drivers are run on the Ubuntu 17.04 host system, but all of the CUDA and cuDNN library stuff is run inside a Ubuntu 16.04 LTS Docker container.
    NVidia even provides official CUDA/cuDNN images which are used as a basis of Google’s official Tensorflow images.

  2. Use NVidia’s official installers for their kernel module and Xorg drivers. This might screw with your Ubuntu distribution.
    Unfortunately, the installers are meant for 16.04, so they may require some additional massaging. All of NVidia’s official documentation assumes that you do things this way.

  3. Ubuntu also provides official packages for CUDA, if not for cuDNN.
    You can install these with your standard apt-get command, but unfortunately the package is very rarely upgraded, and only reaches version 8.0.44-3 at this time.

Personally, I chose the combination of 1. nvidia-docker and 3. the distro-provided drivers.