• I have installed both the graphics driver and cuda from a single installation file It comes with compatible driver version 384. So you have not to worry about driver compatibility issue. Following link will show downloadable run file (1.6 GB) for ubuntu 16.04.


1) Pre-installation
  • Verify the system has a CUDA-capable GPU.
  • Verify the system is running a supported version of Linux.
  • Verify the system has gcc installed.
  • If there is any NVIDIA driver already installed, uninstall it for safety (not mandatory)
$ sudo apt-get purge nvidia* 
2) Disabling Nouveau
  • To install the Display Driver, the Nouveau drivers must first be disabled. The Nouveau drivers are loaded if the following command prints anything:
$ lsmod | grep nouveau
  • If nouveau is enabled then:

i) Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:

blacklist nouveau
options nouveau modeset=0

ii) Regenerate the kernel initramfs:

$ sudo update-initramfs -u
3) Stop X server service
  • Hit Ctrl+Alt+F1 and login using your credentials.
  • Kill your current X server session by typing
$ sudo service lightdm stop


$ sudo lightdm stop
  • Enter runlevel 3 by typing
$ sudo init 3
  • Install your *.run file.
  • Make exucutable
$ chmod +x ./
  • Execute the file with
$ sudo ./
4) Reboot
  • You might be required to reboot when the installation finishes.
$ reboot
5) Add bin to PATH and libs to LD_LIBRARY_PATH
  • Add following lines to .bashrc
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
  • Reload .bashrc with
$ source .bashrc

6) Verify installation

  • Following commands would verify installed driver version
$ nvidia-smi
$ nvcc -V
  • Go to NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery and make files. After running file, when the driver information is shown property, graphic driver is properly installed!

Unistallation and enable Nouveau

  • To uninstall the CUDA Toolkit, run the uninstallation script provided in the bin directory of the toolkit. By default, it is located in /usr/local/cuda-9.0/bin :
$ sudo /usr/local/cuda-9.0/bin/
  • To uninstall the NVIDIA Driver, run nvidia-uninstall :
$ sudo /usr/bin/nvidia-uninstall
  • To enable the Nouveau drivers, remove the blacklist file created in the Disabling Nouveau section, and regenerate the kernel initramfs/initrd again as described in that section.