Imran's Blog
Stuff I feel like blogging about.


I love linux

Posted on

I upgraded to linux 5.10 and noticed that LightDM would fail to start consistently. I was still able to switch to a different tty and startx manually, after which everything would work fine.

Looking at my journalctl -b was interesting

Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: [drm] fb0: amdgpudrmfb frame buffer device
Jan 05 21:20:04 linux-desktop systemd[1]: lightdm.service: Scheduled restart job, restart counter is at 5.
Jan 05 21:20:04 linux-desktop systemd[1]: Stopped Light Display Manager.
Jan 05 21:20:04 linux-desktop audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=lightdm comm="systemd" exe="/usr/lib/systemd/system>
Jan 05 21:20:04 linux-desktop audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=lightdm comm="systemd" exe="/usr/lib/systemd/systemd>
Jan 05 21:20:04 linux-desktop systemd[1]: lightdm.service: Start request repeated too quickly.
Jan 05 21:20:04 linux-desktop systemd[1]: lightdm.service: Failed with result 'exit-code'.
Jan 05 21:20:04 linux-desktop systemd[1]: Failed to start Light Display Manager.
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring sdma1 uses VM inv eng 13 on hub 0
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring vcn_dec uses VM inv eng 0 on hub 1
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring vcn_enc0 uses VM inv eng 1 on hub 1
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring vcn_enc1 uses VM inv eng 4 on hub 1
Jan 05 21:20:04 linux-desktop kernel: amdgpu 0000:28:00.0: amdgpu: ring jpeg_dec uses VM inv eng 5 on hub 1
Jan 05 21:20:04 linux-desktop kernel: [drm] Initialized amdgpu 3.40.0 20150101 for 0000:28:00.0 on minor 0
Jan 05 21:20:04 linux-desktop kernel: EDAC amd64: F17h_M70h detected (node 0).
Jan 05 21:20:04 linux-desktop kernel: EDAC amd64: Node 0: DRAM ECC disabled.
Jan 05 21:20:04 linux-desktop kernel: EDAC amd64: F17h_M70h detected (node 0).

It looks like LightDM failed to start 5 times before the amdgpu module initialized. Looking at my Xorg.0.log file confirmed this:

[     5.874] (EE) open /dev/dri/card0: No such file or directory
[     5.874] (WW) Falling back to old probe method for modesetting
[     5.874] (EE) open /dev/dri/card0: No such file or directory
[     5.874] (EE) Screen 0 deleted because of no matching config section.
[     5.874] (II) UnloadModule: "modesetting"
[     5.874] (EE) Device(s) detected, but none match those in the config file.
[     5.874] (EE)
Fatal server error:
[     5.874] (EE) no screens found(EE)
[     5.874] (EE)
Please consult the The X.Org Foundation support
	at http://wiki.x.org
 for help.
[     5.874] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[     5.874] (EE)
[     5.874] (EE) Server terminated with error (1). Closing log file.

The interesting part being open /dev/dri/card0: No such file or directory. The fix was actually pretty straightforward as this is a known issue on the ArchWiki. It's as simple as adding the following to your lightdm.conf

   [LightDM]
   logind-check-graphical=true

After a reboot, LightDM is back to working!

I enjoy the fact that:

  1. My operating system lets me debug it
  2. It has ample documentation and an active community around it.