Radeon GPU prevent autologin + blackscreen at boot

I’m happy to see my topic interest you :blush:

Your recap is almost correct!

I try to recap like this:

If boot from USB SSD drive then
    Ubuntu start and autologin works (A)
Else #boot from nvme
    If boot with `splash` in Grub then  
        Blackscreen, Ubuntu doesn’t start (B)  
    Else  
        If boot with `nomodeset` in Grub then  
            Ubuntu start and autologin works (B)  
        Else  
            If reboot from windows then  
                Ubuntu start and autologin works (C)  
            Else  
                Ubuntu start and autologin doesn’t work (C)  
            End if  
        End if  
    End if
End if

In my opinion, results (B) come from kernel issue and (A,B) come from another cause to identify.

My system is Bios MBR legacy. I can’t switch to EFI without lost data.

2 Likes

Huh. I was just reading the release notes for the just-released Ubuntu MATE 24.10, when I came across the following which sounds surprisingly similar to what you're experiencing:

Switched back to Slick Greeter (replacing Arctica Greeter) due to race-condition in the boot process which results the display manager failing to initialise.

I dunno. Maybe you could try installing the Slick Greeter on your Ubuntu MATE 24.04 and see if the autologin works there? :man_shrugging:

5 Likes

I don't know much about systemd's setup, but I seem to recall that you could specify a pre-condition "need" for a given "service" so that it would not start until completion of that prior action.

Wouldn't such a definition "fix" the race condition that is mentioned ?

That must have been this huge topic on launchpad bugs:

OMG! I forgot that I had the same issue when testing the alpha release of 24.04
I switched to slick-greeter and everything was ok.
@gordon , you are magnificent.
Here is the post from then:

It may be interesting to read some preceding and following posts of that thread.

Sorry for not mentioning it sooner, I totally forgot about it :pensive:

6 Likes

Thanks to @gordon finding out about the racecondition between lightdm and the AMDGPU driver I delved deeper into the problem and, I hope, have come up with a possible, though ugly, workaround: Delay the start of lightdm.

I have not tested it yet but theoretically it should work:
CopyPaste this in a terminal and press enter

cat<<\EOF | sudo tee /etc/systemd/system/lightdm.service
[Unit]
Description=Light Display Manager
Documentation=man:lightdm(1)
[email protected] plymouth-quit.service
After=systemd-user-sessions.service [email protected] plymouth-quit.service

[Service]
# temporary safety check until all DMs are converted to correct
# display-manager.service symlink handling
ExecStartPre=/usr/bin/sleep 2
ExecStartPre=/bin/sh -c '[ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ]'
ExecStart=/usr/sbin/lightdm
Restart=always
BusName=org.freedesktop.DisplayManager
EOF

then reboot.

If it doesn't solve the problem you can undo this easily

sudo rm /etc/systemd/system/lightdm.service 

Explanation of what this essentially does :
I made a copy of the systemd service in /lib that starts lightdm and put it in /etc
( Systemdfiles in /etc get precedence over the ones in /lib )
I added the line ExecStartPre=/usr/bin/sleep 2 to introduce a 2 second delay before lightdm gets started. This should hopefully do the job.

If not, then deleting the /etc/systemd/system/lightdm.service file will leave everything as it was before.

Let me know if it works for you all.

EDIT:
During boot it seems that 'simpledrm' is on /dev/dri/card0.
When 'amdgpu' is loaded it gets node /dev/dri/card1.
This could explain a black screen because lightdm gets the simpledrm node before 'amdgpu' is loaded, and starts off the wrong node

If that is the case and it is consistent across the board then I could try to create a better workaround by checking for the existence of /dev/dri/card1 by hopefully using inotifywait.
Can someone confirm my train of thought ?

5 Likes

What I did:

  • removed quiet + updated grub => GRUB_CMDLINE_LINUX_DEFAULT=""
  • purged arctica-greeter + installed slick-greeter
  • reboot twice => Ubuntu start but autologin doesn't work
  • purged slick-greeter + installed arctica-greeter
  • reboot => Ubuntu start but autologin doesn't work
    thank you for coming

I'll test your stuff monday.

Changing the greeter was not intended to solve your autologin problem.
It was intended to solve the blackscreen problem, which seemed more important but I guess it was minor compared to the autologin problem.

In that case, have you tried this greeter ?

It is in the universe repository which is enabled by default.
remove your current greeter and install this by invoking

sudo apt install lightdm-autologin-greeter
2 Likes
  • added splash + updated grub => GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
  • purged arctica-greeter + installed slick-greeter
  • reboot twice => blackscreen Ubuntu can't start
  • purged slick-greeter + installed arctica-greeter
  • reboot => blackscreen Ubuntu can't start
  • install lightdm-autologin-greeter + reboot => blackscreen Ubuntu can't start
    I edited Grub at boot to remove splash to do changes.

Is your screen always displaying the same specific details every time ( snapshot please ) ?

or, if not,

Would it be too much to ask that you capture a photo of your screen at each iteration, so we can see what we are dealing with ?

Just saw this in another posting.

Maybe you need to reinstall "LightDM" itself ?

For consideration, @ricmarques , @pavlos_kairis , @Philippe , @gordon , @tkn ,

The attached is my log on UM 22.04.1 where there seems to be reporting of deprecation which may be a hint as to what might be causing issues, maybe ?

[+0.13s] DEBUG: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[+0.16s] DEBUG: arctica-greeter.vala:701: HiDPI support: auto
/usr/libexec/arctica-greeter/arctica-greeter-check-hidpi:33: DeprecationWarning: Gdk.Screen.get_primary_monitor is deprecated
  primary = screen.get_primary_monitor()
/usr/libexec/arctica-greeter/arctica-greeter-check-hidpi:35: DeprecationWarning: Gdk.Screen.get_monitor_geometry is deprecated
  rect = screen.get_monitor_geometry(primary)
/usr/libexec/arctica-greeter/arctica-greeter-check-hidpi:36: DeprecationWarning: Gdk.Screen.get_monitor_width_mm is deprecated
  width_mm = screen.get_monitor_width_mm(primary)
/usr/libexec/arctica-greeter/arctica-greeter-check-hidpi:37: DeprecationWarning: Gdk.Screen.get_monitor_height_mm is deprecated
  height_mm = screen.get_monitor_height_mm(primary)
/usr/libexec/arctica-greeter/arctica-greeter-check-hidpi:38: DeprecationWarning: Gdk.Screen.get_monitor_scale_factor is deprecated
  monitor_scale = screen.get_monitor_scale_factor(primary)
arctica-greeter-check-hidpi: Window scale is 1
[+1.00s] DEBUG: arctica-greeter.vala:710: Loading command line options
[+1.04s] DEBUG: unsetenv() is not thread-safe and should not be used after threads are created
[+2.27s] DEBUG: arctica-greeter.vala:769: Launched at-spi-bus-launcher. PID: 4381
[+2.27s] DEBUG: arctica-greeter.vala:780: Starting arctica-greeter 0.99.1.5 UID=114 LANG=en_CA.UTF-8
[+2.27s] DEBUG: arctica-greeter.vala:783: Setting cursor
[+2.55s] DEBUG: arctica-greeter.vala:787: Setting GTK+ settings
[+2.91s] DEBUG: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
[+3.33s] DEBUG: arctica-greeter.vala:810: Creating Arctica Greeter
[+3.33s] DEBUG: Connecting to display manager...
[+3.33s] DEBUG: Wrote 26 bytes to daemon
[+3.33s] DEBUG: Read 8 bytes from daemon
[+3.33s] DEBUG: Read 157 bytes from daemon
[+3.33s] DEBUG: Connected api=1 version=1.30.0 hide-users=false has-guest-account=false default-session=mate show-manual-login=false show-remote-login=true
[+3.65s] DEBUG: arctica-greeter.vala:852: Launched marco WM. PID: 4421
[+3.90s] DEBUG: arctica-greeter.vala:894: Successfully started Indicator Service 'ayatana-indicator-session'
[+3.92s] DEBUG: arctica-greeter.vala:894: Successfully started Indicator Service 'ayatana-indicator-datetime'
[+3.95s] DEBUG: arctica-greeter.vala:894: Successfully started Indicator Service 'ayatana-indicator-power'
[+3.97s] DEBUG: arctica-greeter.vala:894: Successfully started Indicator Service 'ayatana-indicator-sound'
[+3.98s] DEBUG: arctica-greeter.vala:894: Successfully started Indicator Service 'ayatana-indicator-application'
[+3.98s] DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
[+4.17s] DEBUG: arctica-greeter.vala:919: Launched nm-applet. PID: 4433
[+4.17s] DEBUG: arctica-greeter.vala:937: Starting main loop
[+4.17s] DEBUG: settings-daemon.vala:72: Acquired org.gnome.SessionManager
[+4.17s] DEBUG: settings-daemon.vala:98: Acquired org.gnome.ScreenSaver
[+4.17s] DEBUG: settings-daemon.vala:160: All bus names acquired, starting /usr/bin/mate-settings-daemon
[+4.22s] DEBUG: settings-daemon.vala:173: Launched /usr/bin/mate-settings-daemon. PID: 4438

** (mate-settings-daemon:4438): WARNING **: 11:40:59.316: There was a problem when setting QT_FONT_DPI=96: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “Setenv”

** (mate-settings-daemon:4438): WARNING **: 11:40:59.317: There was a problem when setting QT_SCALE_FACTOR=1: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “Setenv”
Window manager warning: Log level 128: unsetenv() is not thread-safe and should not be used after threads are created
[+7.44s] DEBUG: arctica-greeter.vala:125: xsettings is ready
[+7.44s] DEBUG: arctica-greeter.vala:534: Creating background surface
[+7.51s] DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
[+7.52s] DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
[+7.52s] DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
[+7.52s] DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
[+7.53s] DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
[+7.53s] DEBUG: menubar.vala:345: LANG=en_CA.UTF-8 LANGUAGE=en_CA:en
[+7.65s] DEBUG: menubar.vala:377: LANG=en_CA.UTF-8 LANGUAGE=en_CA:en
[+7.73s] DEBUG: Loading users from org.freedesktop.Accounts
[+7.73s] DEBUG: User /org/freedesktop/Accounts/User3001 added
[+8.59s] DEBUG: User /org/freedesktop/Accounts/User1000 added
[+8.60s] DEBUG: user-list.vala:1043: Adding/updating user ericm (ericm)
[+8.61s] DEBUG: Loading sessions from org.freedesktop.DisplayManager
[+8.63s] DEBUG: user-list.vala:871: Adding user to list. User: ericm, background: (null), is_active: false, has_messages: false, session: mate
[+8.63s] DEBUG: user-list.vala:1043: Adding/updating user ericthered ()
[+8.69s] DEBUG: user-list.vala:871: Adding user to list. User: ericthered, background: (null), is_active: false, has_messages: false, session: mate
[+8.69s] DEBUG: main-window.vala:245: Monitor 0 is 1440x900 pixels at 0,0
[+8.69s] DEBUG: main-window.vala:271: MainWindow is 1440x900 pixels
[+8.69s] DEBUG: arctica-greeter.vala:860: Showing greeter
[+8.69s] DEBUG: arctica-greeter.vala:302: Showing main window
[+9.36s] DEBUG: Ignoring configuration file /etc/lightdm/lightdm.conf.d/90-arctica-greeter.conf.DISTRO, it does not have .conf suffix
[+9.36s] DEBUG: Ignoring configuration file /etc/lightdm/lightdm.conf.d/91-arctica-greeter-guest-session.conf.DISTRO, it does not have .conf suffix
[+9.36s] DEBUG: Ignoring configuration file /etc/lightdm/lightdm.conf.d/91-arctica-greeter-guest-session.conf.Oasis, it does not have .conf suffix
[+9.36s] DEBUG: Ignoring configuration file /etc/lightdm/lightdm.conf.d/91-arctica-greeter-mate.conf.DISTRO, it does not have .conf suffix
[+9.38s] DEBUG: Loaded session /usr/share/xsessions/mate.desktop (MATE, This session logs you into MATE)
[+9.38s] DEBUG: Starting authentication for user ericthered...
[+9.38s] DEBUG: Wrote 26 bytes to daemon
[+9.39s] DEBUG: Connected to Application Indicator Service.
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x20000f (arctica-gr)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
[+12.38s] DEBUG: Read 8 bytes from daemon
[+12.38s] DEBUG: Read 40 bytes from daemon
[+12.38s] DEBUG: Prompt user with 1 message(s)
[+12.49s] DEBUG: background.vala:70: Making background /Local/BG__Login_00__Ubuntu-MATE_WordMark_Modifiedv2_1440x900.png at 1440x900
[+12.60s] DEBUG: menubar.vala:547: Adding indicator object 0x56d0132e8300 at position 0
[+12.60s] DEBUG: menubar.vala:547: Adding indicator object 0x56d0132e8500 at position 1
[+12.60s] DEBUG: menubar.vala:547: Adding indicator object 0x56d0132e8700 at position 2
[+12.61s] DEBUG: menubar.vala:547: Adding indicator object 0x56d0132e8900 at position 2
[+12.62s] DEBUG: Request current apps
[+12.62s] DEBUG: Building new application entry: :1.16  with icon: nm-device-wired at position 0
[+12.65s] DEBUG: menubar.vala:547: Adding indicator object 0x56d01344a990 at position 4
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x20000f (arctica-gr)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.

(arctica-greeter:4356): Gtk-WARNING **: 11:41:07.057: gtk_widget_size_allocate(): attempt to allocate widget with width 0 and height -32
[+12.69s] DEBUG: background.vala:570: Regenerating backgrounds
[+12.69s] DEBUG: background.vala:70: Making background #3C3B37 at 1440x900
[+12.69s] DEBUG: background.vala:81: Render of background #3C3B37 complete
[+12.69s] DEBUG: background.vala:70: Making background /Local/BG__Login_00__Ubuntu-MATE_WordMark_Modifiedv2_1440x900.png at 1440x900
[+12.70s] DEBUG: arctica-greeter.vala:285: starting system-ready sound
[+12.75s] DEBUG: background.vala:123: Render of background /Local/BG__Login_00__Ubuntu-MATE_WordMark_Modifiedv2_1440x900.png complete
[+12.78s] DEBUG: background.vala:123: Render of background /Local/BG__Login_00__Ubuntu-MATE_WordMark_Modifiedv2_1440x900.png complete
[+17.58s] DEBUG: Providing response to display manager
[+17.58s] DEBUG: Wrote 27 bytes to daemon
[+17.62s] DEBUG: Read 8 bytes from daemon
[+17.62s] DEBUG: Read 22 bytes from daemon
[+17.62s] DEBUG: Authentication complete for user ericthered with return code 0
[+17.62s] DEBUG: main-window.vala:211: Cleaning up menu bar related processes (i.e. orca, onboard
[+17.62s] DEBUG: Starting session mate
[+17.62s] DEBUG: Wrote 16 bytes to daemon
[+17.64s] DEBUG: Read 8 bytes from daemon
[+17.64s] DEBUG: Read 4 bytes from daemon
[+17.64s] DEBUG: arctica-greeter.vala:932: Got a SIGTERM
[+17.64s] DEBUG: arctica-greeter.vala:940: Cleaning up
[+17.66s] DEBUG: arctica-greeter.vala:964: Successfully stopped Indicator Service 'ayatana-indicator-session' via systemd
[+17.67s] DEBUG: arctica-greeter.vala:964: Successfully stopped Indicator Service 'ayatana-indicator-datetime' via systemd
[+17.69s] DEBUG: arctica-greeter.vala:964: Successfully stopped Indicator Service 'ayatana-indicator-power' via systemd
[+17.71s] DEBUG: arctica-greeter.vala:964: Successfully stopped Indicator Service 'ayatana-indicator-sound' via systemd
[+17.75s] DEBUG: arctica-greeter.vala:964: Successfully stopped Indicator Service 'ayatana-indicator-application' via systemd
[+17.75s] DEBUG: settings-daemon.vala:193: SettingsDaemon exited with return value 0
[+17.75s] DEBUG: arctica-greeter.vala:987: Network Manager Applet exited with return value 0
[+17.75s] DEBUG: arctica-greeter.vala:1003: AT-SPI exited with return value 0
[+17.75s] DEBUG: arctica-greeter.vala:1019: Marco Window Manager exited with return value 0
[+17.75s] DEBUG: arctica-greeter.vala:1037: Exiting

This might be something:

** (mate-settings-daemon:4438): WARNING **: 11:40:59.316: There was a problem when setting QT_FONT_DPI=96: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “Setenv”

** (mate-settings-daemon:4438): WARNING **: 11:40:59.317: There was a problem when setting QT_SCALE_FACTOR=1: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “Setenv”

There must be a file somewhere where someone spelled the word 'setenv' as 'Setenv' which occurs to me as wrong.

I don't know the consequences of this error.
It might cause the bootup skip the rest of the file where this 'Setenv' is called.
Unfortunately, I have ofcourse no idea which file that could be.

2 Likes

Just to be clear, my Desktop is working fine.

I just offered up that log for comparison, on the chance that there might be something applicable in someone else's context. Maybe the lines you hightlighted could be causing Philippe's issue. I too don't know. :frowning:

1 Like

For the moment, I give up. I don't have another clue to continue.