Install cuda on ubuntu desktop

Perform the following steps to install CUDA and verify the installation.

  • Disable the Nouveau drivers:

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

blacklist nouveau
options nouveau modeset=0
  • Regenerate the kernel initramfs:

$ sudo update-initramfs -u
  • Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.

  • Run the installer silently to install with the default selections (implies acceptance of the EULA):

sudo sh cuda_<version> --silent
  • Create an xorg.conf file to use the NVIDIA GPU for display:

$ sudo nvidia-xconfig
  • Reboot the system to load the graphical interface.

  • Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:

$ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}$ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64\
  • Install a writable copy of the samples then build and run the nbody sample:

$ ~$ cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/nbody$ make$ ./nbody

Read more at:
Follow us: @GPUComputing on Twitter | NVIDIA on Facebook