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.

GRUB_CMDLINE_LINUX_DEFAULT="quiet text"
GRUB_CMDLINE_LINUX="3"
  • Run the installer silently to install with the default selections (implies acceptance of the EULA):

sudo sh cuda_<version>_linux.run --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\
  ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • Install a writable copy of the samples then build and run the nbody sample:

$ cuda-install-samples-9.0.sh ~$ cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/nbody$ make$ ./nbody

Read more at: http://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#ixzz4zEOIFiaH
Follow us: @GPUComputing on Twitter | NVIDIA on Facebook