📅 2015-Sep-25 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cuda, installation, login loop, nvidia, ubuntu ⬩ 📚 Archive
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.
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
Reboot and make sure you are having a X desktop that is rendering fine at the correct resolution. If not, this guide cannot help you.
Visit the CUDA Downloads webpage and download the runfile (local) installation file. It is a 1+GB file and the download will take a while. This installer file contains both a NVIDIA graphics driver and the CUDA files.
Logout of your desktop and kill the X server:
$ sudo service lightdm stop
Ctrl + Alt + F1
. Run the downloaded installer file. But, make sure it does not install its NVIDIA OpenGL libraries. This is the key to fixing the login loop problem! Choose Yes to everything except if it tries to create a xorg.conf
.$ chmod +x cuda_7.5.18_linux
$ sudo ./cuda_7.5.18_linux --no-opengl-libs
At this point the NVIDIA driver installation failed saying that the nouveau
driver was active. It reported that it had disabled nouveau
, but required a restart.
I restarted the system, switched to virtual terminal, stopped X and ran the CUDA installer again, exactly as shown above. Again, the NVIDIA driver installation failed. This time it reported that the compiler was incompatible. I was using GCC 5.1 as my default compiler. I guess compiling NVIDIA driver kernel module needs something older. So, I switched back to GCC 4.8:
$ 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