Installing CUDA 7.5 in Ubuntu 14.04

1 minute read

After some problems installing CUDA 7.5 in Ubuntu 14.04, facing login loops and other problems, I found a solution on a NVIDIA forum (link in the end of the post). This procedure installs the graphics card for CUDA purposes, not allowing its use for rendering.

  1. Install the build-essentials package by running:
  sudo apt-get install build-essential
  1. Download the CUDA installation (.run) file from the NVIDIA website (Link).

  2. If you have a xorg.conf file, remove it (backup the file first to avoid any problems):

  sudo mv /etc/X11/xorg.conf.bkp
  1. Create the /etc/modprobe.d/blacklist-nouveau.conf file containing:
       blacklist nouveau
       option nouveau modeset=0
     
  2. The run the following command and reboot your computer.
  sudo update-initramfs -u
  1. When the login screen appears, type Ctrl + Alt + F1 to access the text interface and login with your user.

  2. Go to the directory where the CUDA .run file was downloaded and run:

  chmod a+x CUDA_RUN_FILE
  1. Stop the lightdm service and run the CUDA installation file (OpenGL libs should not be installed!):
  sudo service lightdm stop    
  sudo bash cuda-7.0.28_linux.run --no-opengl-libs
  1. During the installation you should ACCEPT the EULA conditions, say YES to installing the NVIDIA driver, YES to installing the CUDA Toolkit and Driver and YES to installing the CUDA Samples. If asked, you should say NO when asked if you want to rebuild any Xserver configurations.

  2. After the installation is complete, check if device nodes are present (if nothing happens, it means everything is ok!):

  sudo modprobe nvidia
  1. Set environment path variables (this can be added to the end of the XXXXXX file so that there is no need to rerun this commands every time you restart your computer). Remember to change YOUR_CUDA_PATH to the right path, depending on your CUDA version (e.g. /usr/local/cuda-7.5):
  export PATH=YOUR_CUDA_PATH/bin:$PATH     
  export LD_LIBRARY_PATH=YOUR_CUDA_PATH/lib64:$LD_LIBRARY_PATH
  1. Verify the NVIDIA driver version and the CUDA driver version:
  cat /proc/driver/nvidia/version    
  nvcc -V
  1. (Optional) Now, you can switch the lightdm back on. You should then be able to login through the GUI without any problems:
  sudo service lightdm start

To test the CUDA installation:

  1. Create the CUDA Samples by accessing its folder and running:
  make
  1. Go to the release folder inside the CUDA Samples folder (e.g. NVIDIA_CUDA-7.5_Samples/bin/x86_64/linux/release/) and run two standard checks (first to see your graphics card specs and then to check if its operating correctly). Both tests should ouput ‘PASS’:
  ./deviceQuery     
  ./bandwidthTest

Everything should be ok after you reboot.

Source: Titan X for CUDA 7.5 login-loop error

Leave a comment