This is a rough guide on how to install the latest driver in Ubuntu 18.04 and Cuda 8.0. This is separated in two distinct steps: installing the driver and then the CUDA toolkit and samples.

Driver

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo ubuntu-drivers autoinstall

This is taken from here. Using the drivers from the ubuntu website is at the time of this writing not recommended.

Toolkit and Samples

Download *.run files

wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run && \
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run

Install toolkit and samples only.

sudo bash cuda_8.0.61_375.26_linux.run --silent --verbose --toolkit --samples --override --no-opengl-libs

In case there is an error:

Can’t locate InstallUtils.pm in @INC (you may need to install the InstallUtils module)

then:

./cuda_8.0.61_375.26_linux.run --tar mxvf
sudo cp cuda/InstallUtils.pm /usr/lib/x86_64-linux-gnu/perl-base