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.
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.
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.
Ubuntu also provides official packages for CUDA, if not for cuDNN.
You can install these with your standard
apt-getcommand, 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.