Ubuntu 16.04 apt update will install nvidia driver 375.39. However CUDA-8.0 only works against 375.26. If you’re tensorflow starts to hang, you can verify if it’s this issue via:
$ dpkg -l | grep 375
ii cuda-drivers 375.26-1 amd64 CUDA Driver meta-package
ii libcuda1-375 375.26-0ubuntu1 amd64 NVIDIA CUDA runtime library
ii libxnvctrl0 375.26-0ubuntu1 amd64 NV-CONTROL X extension (runtime library)
ii nvidia-375 375.26-0ubuntu1 amd64 NVIDIA binary driver - version 375.26
ii nvidia-375-dev 375.26-0ubuntu1 amd64 NVIDIA binary Xorg driver development files
ii nvidia-modprobe 375.26-0ubuntu1 amd64 Load the NVIDIA kernel driver and create device files
ii nvidia-opencl-icd-375 375.26-0ubuntu1 amd64 NVIDIA OpenCL ICD
ii nvidia-settings 375.26-0ubuntu1 amd64 Tool for configuring the NVIDIA graphics driver
If the driver versions don’t align, then you’ll have to downgrade the nvidia driver. (Specifically nvidia-modprobe and nvidia-settings will be out-of-sync.) e.g. for nvidia-375:
Had the same issue and couldn’t get the simple reinstall to work. I had to purge the nvidia and cuda files and reinstall the latest cuda toolbox What a pain.
I fixed it by ssh’ing into my box and following Jeremy’s instructions, but I forgot to kill the X server, so the device driver installation failed. To get around that, I followed these directions:
Kill your current X server session by typing sudo service lightdm stop or sudo stop lightdm
Enter runlevel 3 (or 5) by typing sudo init 3 (or sudo init 5) and install your .run file.
You might be required to reboot when the installation finishes. If not, run sudo service start lightdm or sudo start lightdm to start your X server again.