Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to install CUDA 7.5 on Ubuntu

📅 2015-Sep-25 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cuda, installation, login loop, nvidia, ubuntu ⬩ 📚 Archive

Easy solution

The easiest method is to visit the CUDA Downloads webpage and download the deb (network) file that matches your Ubuntu. Installing from it is as easy as:

$ sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
$ sudo apt-get update
$ sudo apt install cuda-7-5

This worked great on a notebook for me. However, on a desktop I started getting the infamous login loop problem.

Login loop problem: You start Ubuntu and you get the graphical login, but it is being displayed at an extremely low resolution (like 640x480 for example). You login, you see the desktop for a second, something fails and you are thrown back to the graphical login screen.

Manual solution

There are many solutions to the login loop problem. The only one which worked for me is described here.

That solution has many steps, not all of which I needed. I also ran into problems not listed there. Here is what worked for me:

$ sudo apt purge "nvidia*"
$ sudo apt purge "cuda*"
$ sudo rm /etc/X11/xorg.conf
$ sudo service lightdm stop
$ chmod +x cuda_7.5.18_linux
$ sudo ./cuda_7.5.18_linux --no-opengl-libs
$ sudo update-alternatives --config gcc

Tried with: CUDA 7.5, NVIDIA driver 352.21, Ubuntu 14.04, Linux 3.19.0-28-generic and NVIDIA GTX 750 Ti


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧