Sunday, January 14, 2018

Ubuntu 16.04 stuck in login loop

https://askubuntu.com/questions/223501/ubuntu-gets-stuck-in-a-login-loop

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.



I encountered this exact problem and non of the suggested fixes above worked for me. After almost giving up I looked at the .xsession-errors and noticed I had a typo in my .profile (I had an extra } in the file after I edited it earlier in the day).
That was causing the login loop. It might be another place to look if the other suggested fixes don't work for you.


https://askubuntu.com/questions/801440/login-loop-badvalue-integer-parameter-out-of-range-for-operation-16-04

Adding +iglx to xserver-command in /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf.
[SeatDefaults] 
# Dump core 
xserver-command=X -core +iglx
After which you either reboot or Ctrl-Alt-F1, login, and sudo service lightdm restart.
more .xsession-errors
openConnection: connect: No such file or directory
cannot connect to brltty at :0
...


$ grep NVRM /var/log/kern.log
Jan 14 08:37:31 berlin kernel: [1351327.884905] NVRM: API mismatch: the client has the version 384.111, but
Jan 14 08:37:31 berlin kernel: [1351327.884905] NVRM: this kernel module has the version 384.98.  Please
Jan 14 08:37:31 berlin kernel: [1351327.884905] NVRM: make sure that this kernel module and all NVIDIA driver
Jan 14 08:37:31 berlin kernel: [1351327.884905] NVRM: components have the same version.
Jan 14 09:17:26 berlin kernel: [1353722.487659] NVRM: API mismatch: the client has the version 384.111, but
Jan 14 09:17:26 berlin kernel: [1353722.487659] NVRM: this kernel module has the version 384.98.  Please
Jan 14 09:17:26 berlin kernel: [1353722.487659] NVRM: make sure that this kernel module and all NVIDIA driver
Jan 14 09:17:26 berlin kernel: [1353722.487659] NVRM: components have the same version.

CHANGE THE DRIVER VERSION TO MATCH THE VERSION YOU INSTALLED 

I was able to resolve my issue by performing the following steps:

1. First reinstall the nvidia-375 repository graphic driver.
sudo apt-get install nvidia-375
During the installation, I noticed that nvidia-375.26 driver was being installed.

2. I moved the entire /lib/modules/4.4.0-64-generic/updates/dkms folder to my home directory backup folder. This was to make sure all old .ko files were removed.
cp -R /lib/modules/4.4.0-64-generic/updates/dkms ~/backup

3. I regenerated the .ko files for the installed driver using 
sudo dpkg-reconfigure nvidia-375
It created a new dkms folder with the relevant nvidia kernel modules. I also checked their version using command:
sudo modinfo nvidia_375.ko
sudo modinfo nvidia_375_drm.ko
sudo modinfo nvidia_375_modeset.ko
sudo modinfo nvidia_375_uvm.ko
Their output showed that they were for version 375.26.

4. I rebooted the system with 
sudo reboot

Adapted from https://devtalk.nvidia.com/default/topic/525877/linux/api-mismatch-means-ubuntu-can-39-t-boot-i-can-39-t-fix-i-please-help-/1

$ sudo dpkg-reconfigure nvidia-384
Removing all DKMS Modules
Done.
update-initramfs: deferring update (trigger activated)

A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau from loading. This can be reverted by deleting /etc/modprobe.d/nvidia-graphics-drivers.conf.
A new initrd image has also been created. To revert, please replace /boot/initrd-4.13.0-26-generic with /boot/initrd-$(uname -r)-backup.

*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can   ***
*** be loaded.                                                            ***
*****************************************************************************

INFO:Enable nvidia-384
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Loading new nvidia-384-384.111 DKMS files...
Building only for 4.13.0-26-generic
Building for architecture x86_64
Building initial module for 4.13.0-26-generic
Done.

nvidia_384:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.13.0-26-generic/updates/dkms/

nvidia_384_modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.13.0-26-generic/updates/dkms/

nvidia_384_drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.13.0-26-generic/updates/dkms/

nvidia_384_uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.13.0-26-generic/updates/dkms/

depmod....

DKMS: install completed.
Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.13.0-26-generic

$ sudo modinfo nvidia_384
filename:       /lib/modules/4.13.0-26-generic/updates/dkms/nvidia_384.ko
alias:          char-major-195-*
version:        384.111
supported:      external
license:        NVIDIA
srcversion:     EB07FB20BD3656BF1198872
alias:          pci:v000010DEd00000E00sv*sd*bc04sc80i00*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        
name:           nvidia
vermagic:       4.13.0-26-generic SMP mod_unload 
parm:           NVreg_Mobile:int
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_UpdateMemoryTypes:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_MapRegistersEarly:int
parm:           NVreg_RegisterForACPIEvents:int
parm:           NVreg_CheckPCIConfigSpace:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_TCEBypassMode:int
parm:           NVreg_UseThreadedInterrupts:int
parm:           NVreg_EnableStreamMemOPs:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RegistryDwordsPerDevice:charp
parm:           NVreg_RmMsg:charp
parm:           NVreg_AssignGpus:charp

No comments:

Post a Comment