46

This didn't start out as a problem with the login loop. I was attempting a clean install of Ubuntu 16 and using the new feature that allows it to detect proprietary drivers for me.

I started off with this issue

When I attempted to use the recommended Nvidia Drivers, it caused the laptop to become unstable and freeze.

I attempted the remedy from that post and it resulted in a login loop.

I have attempted this

sudo mv ~/.config/dconf/user ~/.config/dconf/user.old

Tried this

sudo mv ~/.Xauthority ~/.Xauthority.backup
sudo service lightdm restart

I have tried locating and disabling secureboot, but there is no secureboot option in the bios. This is an HP DV2000 series laptop.

Nothing is helping

what i get when i try to log in

Can someone help?

edit:

Guest session does the same loop.

/var/log/Xorg.0.log shows a lot of stuff, but I took a pic of what seems relevant Here

Thing is the driver I first tried that started this mess was 304 drivers and the 364 drivers were supposed to be the fix according to other posts.

More editing:

I purged the nvidia files and it came back to a blank desktop w/o the interfaces so I right clicked and restored a backup.. The sidebar came back and it was running gallium. I restarted and its the blank purple screen again.

I am thinking of just reinstalling and not using nvidia drivers. The software center is telling me I have a presario and i should use 304 drivers. Its not a presario. =( At least the software center provides a suggestion for the coprocessor driver which is nice.

MoMo
  • 561
  • Does the guest session allow logins to work? What errors are in /var/log/Xorg.0.log (tagged with (EE)")? What errors are in ~/.xsession-errors ? Did you try deleting/renaming ~/.ICEauthority ? – ubfan1 Apr 26 '16 at 01:52
  • i too have the same problem. http://askubuntu.com/questions/761819/nvidi-361-login-loop-ubuntu-16-04-lts/762823#762823 – shiv garg Apr 26 '16 at 03:34
  • i have solved the problem. refer my question for answer – shiv garg Apr 27 '16 at 13:02
  • Goto UEFI/BIOS settings and disable secure boot. Then install NVIDIA drivers. This will work – pradyot Jun 02 '16 at 04:45
  • if you think the the problem is with the user settings then try logging in with a freshly created user account and see if the same issue occurs. This is much quicker and less disruptive than changing your config. – Amias Oct 12 '16 at 13:10
  • I was able to resolve the issue by disabling Secure Boot manually on the BIOS prior to the installation. Other than that, I followed this guide to install. – Duy Nguyen Nov 25 '17 at 23:31
  • The main reason behind login-infinite loop is discussed here: https://devtalk.nvidia.com/default/topic/878117/cuda-setup-and-installation/-solved-titan-x-for-cuda-7-5-login-loop-error-ubuntu-14-04-/ . It is baffling that no one talks about opengl issue here (one mentions but is not certain). If installing from additional-drivers in ubuntu does not work, 1) install proprietary 2) Make sure you disabled uefi-secure mode (go to boot options before boot). 3) "ctrl+alt-f1" after you start ubuntu, "sudo service lightdm stop" 4) "sudo bash *.run -A | more" to see advanced options. – Dinesh Apr 06 '18 at 18:03
  • you will eventually see "--no-opengl-files" or something similar . Again do "sudo bash *.run --no-opengl-files". After completion, "sudo service lightdm restart". – Dinesh Apr 06 '18 at 18:04
  • You can try press Ctrl + Alt + F7 login in text mode: chown username:username .Xauthorit then press Ctrl + Alt + F1 and login again – Dũng IT Jul 16 '18 at 07:35

10 Answers10

54

If you've been successfully running 16.04 with your video driver before, but the login loop issue happens after the latest software update, try this, it worked for me after trying EVERYTHING else. This is the equivalent of searching for "additional drivers":

sudo ubuntu-drivers list

then use:

sudo ubuntu-drivers autoinstall

For me, this updated the driver for my nvidia quadroFx 3800 in a way that using sudo apt-get install nvidia-current would not.

After autoinstall, invoke another tty (ex. ctrl+alt+f1) and

sudo service lightdm restart
  • 2
    This worked for me after the installation of CUDA 8.0 on Ubuntu 16.04 caused a login loop. Haven't verified that cuda is working properly, though. – John Prior Nov 18 '16 at 16:40
  • 1
    I'm using the nvidia-304 and I face the login loop in almost in each upgrade. This is the simplest solution I found. – Italo Borssatto Dec 30 '16 at 13:27
  • 2
    I know we aren't supposed to say 'thank you' on here, but you have saved my day. – Cokes Mar 31 '17 at 04:38
  • 2
    This is what happened to me too just last weekend; was getting login loop after updates were installed. Running sudo ubuntu-drivers autoinstall sorted it for me. (Ubuntu 16.04.2 LTS) – AnthonyK Jul 05 '17 at 00:44
  • 1
    Just wanted to create an account and say THANKS SO MUCH, fucking bizzare problem espically coz I just used ubuntu system settings to select what I thought was a normal option and then random crash, this fixed it all perfectly, really really appreciate the post. Also these sort of problems give me more experience in fixing problems in linux – Cacoon Nov 16 '17 at 20:48
  • 1
    Thanks! It works for me. But could you please explain a little about why the infinite loop is happening and why this routine solves it. Thanks again. – Microos Jan 12 '18 at 19:01
  • 1
    I was going to repost this to a similar question, but thought you might want to to get the upvote credit: https://askubuntu.com/questions/223501/ubuntu-gets-stuck-in-a-login-loop. – Nick Jan 17 '18 at 19:29
  • 2
    This worked for me too. It seems that sudo ubuntu-drivers list shows you the drivers that are fully compatible with your devices. I kept installing the latest driver versions and non worked until I tried your solution. Thank you! – Amir Feb 12 '18 at 05:16
  • THANK YOU SO MUCH I don't care what rules are on here, I'm thanking in the comments. In addition to the well-deserved upvote. – ComputerScientist Feb 18 '18 at 20:10
  • This is what finally worked for me. Thinkpad T61 with Quadro NVS 140M. Ubuntu 17.10 x64 and nvidia-340. Not sure if necessary but I also made sure to hold the driver version using sudo apt-mark hold nvidia-340. – nitro2k01 Apr 02 '18 at 14:40
  • I upgraded to 16.04 only a month ago & had installed nvidia-current and today I had the login loop. I tried various other methods that I had tried in the past and failed. This one did it for me. – eshwar Jul 05 '18 at 06:18
  • What a strong spell it is! I tried to install CUDA 9.0 for tensorflow-gpu, but after the installation I got into login loop. Your recipe helped me to restore my desktop! (tensorflow-gpu, BTW, crashes, but at least I hadn't lost time to reinstall Ubuntu) – Maksym Ganenko Oct 27 '18 at 16:53
  • +1 for your nice username DontLoseHope (and the great answer too). Thank you! – salocinx Jun 26 '19 at 21:51
  • After I did it, I get "The system is running in low graphics mode", and then "What would you like to do" with a few options – Nathan B Oct 16 '19 at 08:20
  • Is there a way to install old nvidia drivers using this method? I want to use steam but nvidia driver with version 390 and later seem to not support it. – exAres Mar 28 '20 at 02:23
16

In case you really want to use the drivers provided by Nvidia from their website (they solved cublas error CUBLAS_STATUS_NOT_INITIALIZED on my NVIDIA GTX980M), the only thing that worked for me was:

Press CTRL-ALT-F1

Uninstall any previous drivers:

sudo apt-get remove nvidia-*
sudo apt-get autoremove

Uninstall the drivers from the .run file:

sudo nvidia-uninstall

This should remove the login loop, so now reboot and login normally.

Apply only if you use lightdm, Press again CTRL-ALT-F1 and do:

sudo service lightdm stop
sudo bash Your-Nvidia-Drivers-File.run

I used all the default options, except for the opengl, where I said no. I don't know if this is important though.

And here is the important part: DO NOT reboot. Just do:

sudo service lightdm restart

and press CTRL-ALT-F7 to login immediately after installation. This way I never saw a login loop again.

andoum
  • 161
  • 1
    Not sure what actually is happening in the background, the first half of this post managed to get me through the infinite loop login part and I'm now back in the Ubuntu GUI! :) – Atlas7 May 30 '17 at 14:53
  • 1
    The first section solved my login loop. Thank you! But when I tried to install the new CUDA pack, the login loop appeared again. Then I realized that my original Ubuntu default Nvidia driver was newer than the CUDA pack's Nvidia driver. Thus when I reinstalled the CUDA pack I chose "not installing the new Nvidia driver" and then go further with the default options (btw I chose opengl installing and caused no problem). Finally it worked! – Geeocode Jul 12 '17 at 23:50
  • I needed remove --purge. – Ciro Santilli OurBigBook.com Apr 03 '18 at 10:59
1

I used to have this problem and I googled it all day all night and finally found the right site for solution. It looks like the problem lies in your laptop using NVIDIA Optimus. I solve this using

sudo apt-get install nvidia-364 nvidia-prime

Follow this installation guide here for more info http://rajat-osgyan.blogspot.co.id/2016/04/how-to-install-latest-nvidia-drivers-on.html

1

I had the same problem with Ubuntu 14.04 and NVIDIA-304 driver.

This driver was updated from version 304.131 to 304.132 during one of the system updates. This new driver version was the source of my problem.

Reinstalling the old driver version (304.131) solved this. Everything works fine now.

For more Info see this Launchpad bug page

Here you can find driver 304.1: https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-304/304.131-0ubuntu0.14.04.1 On the right hand side of the page choose your build (amd 64 or i386), this will open the downloads page, where you can choose your download (mine was nvidia-304_304.131-0ubuntu0.14.04.1_i386.deb ). Download and copy to a USB stick. Power on the computer with the login Loop problem, open terminal, stop lightdm:

sudo service lightdm stop

Purge NVIDIA drivers:

sudo apt-get purge nvidia*

Plug in the USB stick with the downoaded file, run fdisk to identify your USB stick on the computer:

sudo fdisk -l

(mine was /dev/sdb1)

Mount the usb stick, but first create a mount point:

sudo mkdir /media/usb

Mount the usb stick:

sudo mount /dev/sdb1 /media/usb

Check if the downloaded file is present:

ls /media/usb

Install the NVIDIA driver:

sudo dpkg -i /media/usb/nvidia-304_304.131-0ubuntu0.14.04.2_i386.deb

(please replace the file name with the one of your download)

Unmount USB stick:

sudo umount /media/usb

Reboot system

sudo reboot

Hope this helps.

d a i s y
  • 5,511
Judex
  • 61
  • 1
    Could you please elaborate on this a little more? Explaining how to reinstall the driver would really be helpful to the OP, and anyone else who has a similar issue. :) – AnotherKiwiGuy Dec 04 '16 at 08:10
1

I had a similar issue after messing around with my screen configs in xorg.conf via the Nvidia-control panel. I had previously been running the currently latest drivers (at the time 381.09) on my 1080 with 3 screens with no problem. But once I restarted I got the login loop.

To fix I simply:

  • opened a terminal ctrl-alt-f1
  • moved my renamed my xorg.conf file sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf~
  • Then restarted allowing the system to workout it's own config again.

This was a very quick fix - no need to reinstall drivers etc. Which I was keen to do to avoid messing up various dependents e.g. CUDA

0

Called the customer service and finally the problem solved. I have 2 GPUs (Geforce 1080 and 1080Ti) on my SuperMicro workstation. After install the GPU driver in a proper way that needs to go into the tty mode and stop the lightdm, you need to plug out the VGA/DVI on the motherboard and plug the monitor cable to the GPU ports. In my case, plug to the DVI of GPU 1080Ti, the login loop problem solved.

Bruce Yo
  • 160
  • 1
  • 1
  • 8
0

One other solution I must add here is to just not use NVIDIA drivers because they are creating such a mess, so often, and user are not always aware that NVIDIA drivers are the underlying reason.

I would rather recommend to use the Nouveau drivers. I never experienced any issues after installing Nouveau drivers.

1 - Purge NVIDIA packages:

sudo apt purge nvidia*

2 - Install a Nouveau driver. For Ubuntu 16.04 I suggest to use xserver-xorg-video-nouveau-lts-xenial:

sudo apt install xserver-xorg-video-nouveau-lts-xenial

3- Then reboot

sudo reboot

Now the problem should be fixed!
For some Graphic device there might still be another problem: being stuck with an ugly low resolution of 800 x 600.

Here are some extra steps to overcome this and to set the resolution you want:

4- Go to your grub configuration file (here I will use nano):

sudo nano /etc/default/grub

5- In the file look for a line starting with #GRUB_GFXMODE= (maybe you will see written #GRUB_GFXMODE=800x600)
6- Uncomment the line (remove the #) and replace the current resolution by the one of your choice. Here I use 1920x1200 to obtain this:

GRUB_GFXMODE=1920x1200

7- Save changes and close the file.
8- Update your grub parameters:

sudo update-grub

9- Reboot one last time:

sudo reboot

Now everything should work well: you are able to log in, and the resolution displayed is the one you chosed.
An error message complaining about xrandr can appear after log in: This is not yet a complete fix, but shouldn't be too much of a problem either. Just "ok" it.

Chosing Nouveau drivers should spare you a lot of burden, since you will not experience NVIDIA driver updates that could mess your installation.

0

I have had similar problems on several computers since upgrading to 16.04. First of all make sure secure boot is disabled in computer BIOS. Older computers won't even have this option.

Can you get to a command prompt by hitting Ctrl-Alt-F4? If so type your username and then your password to login. From there try typing:

sudo lspci|grep VGA

and enter password when asked.

If your system says you have NVIDIA graphics then type:

sudo apt-get purge nvidia

Wait until this finishes and then type:

sudo apt-get install nvidia-current

Once complete type sudo shutdown -r now to restart the computer. You should be booting into a functional desktop.

This can also fix a login loop issue on 16.04 or a black screen with cursor problem.

Josh
  • 21
  • nividia-current install an (old) stable and LTS driver version not apt to newer chipset. This should not be the default recommendation. –  Feb 14 '17 at 11:23
-2

I ran into the login loop problem running Ubuntu 16.04 on a Macbook Pro Retina bought in 2012. Over the years I have always been using the nvidia-304 driver from xorg-edgers that was going fine and mostly the only working option (with uefi boot). With the latest update (Nov 4 2016 on ubuntu 16.04) this driver stopped working and I spent long time trying to figure out the problems (I had nomodeset in boot options throughout).

My solution finally was to either 1) use nouveau (surprisingly because this never worked before) putting nouveau in /etc/modules and using a xorg.conf putting nouveau as device (but performance of this driver is suboptimal even on ordinary desktop activities) or 2) actually the latest nvidia driver nvidia-367 with no xorg.conf

-2

Nuance: in my case I have a rather old gfx card - GTX280 What I did:

  • checked at nvidia.com which driver version supports my card, in my case it was nvidia-340

  • service lightdm stop

  • apt-get purge lightdm

  • apt-get purge nvidia*

  • apt-get install nvidia-340

  • apt-get install lightdm

  • restarted the system

I've noted that nvidia-367 installs gdm, so after nvidia drivers installation you will have both lightdm and gdm alongside, possibley it can be the key to the problem.

George Udosen
  • 36,677