Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: X won't start after cold reboot, but starts after rebooting out of Ubuntu (Read 1793 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

X won't start after cold reboot, but starts after rebooting out of Ubuntu

I have an HP Envy x360 15-ee0xxx laptop (Ryzen 4700U processor and AMD graphics).
I am using Ubuntu, but wanted to escape systemd and decided to try Artix.
If I boot into Ubuntu 20.04 (cold or warm) and then do a warm reboot into Artix, X happily starts and runs.
But if I do a cold reboot, Artix boots but X does not start.

In Xorg.0.log, the "warm reboot" case has the following line
  
Code: [Select]
(II) xfree86: Adding drm device (/dev/dri/card0)
whereas the cold boot case doesn't have it.

After that, the warm case goes on with
  
Code: [Select]
(II) Applying OutputClass "AMDgpu" to /dev/dri/card0
       loading driver: amdgpu
   (==) Matched amdgpu as autoconfigured driver 0
   (==) Matched ati as autoconfigured driver 1
and various more drivers, whereas the cold case starts with
  
Code: [Select]
(==) Matched ati as autoconfigured driver 0

The cold case goes on to use the Radeon driver, instead of the amdgpu driver, and eventually X gives up, saying
 
Code: [Select]
(EE) Unable to find a valid framebuffer device

The other possibly-relevant difference is that in the warm case, the log file has
 
Code: [Select]
(II) xfree86: Adding drm device (/dev/dri/card0)
whereas the cold case has
 
Code: [Select]
(EE) open /dev/dri/card0: No such file or directory

My hunting here and on the internet at large has revealed nothing.

Does anyone have any words of wisdom for me here?

Thanks.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #1

Does anyone have any words of wisdom for me here?

  Maybe.

If you picked s6, and haven't done so, update the system.

We had a s6 race condition with cgroups when we retired eudev fork, but it is fixed.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #2
  Maybe.

If you picked s6, and haven't done so, update the system.

We had a s6 race condition with cgroups when we retired eudev fork, but it is fixed.

Thanks for the suggestion, but I picked OpenRC.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #3
In the cold boot case, does /dev/dri/card0 really not exist? That's pretty bad. No clue why this would happen but that's the root of the issue of course.

 

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #4
@zsd Can you provide more details? What are the kernel and relevant package (X.Org, drivers...) versions on Ubuntu and Artix?

What exact drivers are you using and are you loading or blacklisting specific drivers on Ubuntu and Artix? Are both systems up to date?

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #5
To Dudemanguy:

By the time I get logged in to a console, /dev/dri/card0 does exist, and all the files/dirs under /dev/dri are the same as when booted into Ubuntu.

However, your comment gave me an idea... I checked the time on /var/run/acpid.socket; in my first message I didn't include the fact that in the cold boot case I also get
Code: [Select]
(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
and I saw that the first date/time in Xorg.0.log was pretty much the same as the last mod date on /var/run/acpid.socket (which existed by the time I got logged in).  So perhaps there is a race condition in OpenRC too.

I tried typing ^S during a cold boot while the boot messages are coming up on the screen, and when things stopped scrolling I waited a few seconds and then types ^Q to let things go.  And, I got a working X session.
I then cold-rebooted a few times, with repeated success.  And then I cold-rebooted twice more with failures.

So perhaps I need a more reliable way of telling the system to delay starting X for a second or two.
Being an Artix (and OpenRC) n00b, is there some "Right" way of doing this?  I'm tempted to put a "sleep 2"
in /etc/runlevels/default/lightdm, but that seems like a  grotesque hack.  Still, if it works at least it would get me going.

Thoughts?

Thanks very much.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #6
It sounds like to me that somehow all your devices in /dev are not detected/mounted before lightdm starts. I am unfortunately not really familiar with the openrc booting sequence but in theory it should be fixable at least. If you are using the parallel option with openrc, maybe turn it off and give it a try?

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #7
@zsd Can you provide more details? What are the kernel and relevant package (X.Org, drivers...) versions on Ubuntu and Artix?

What exact drivers are you using and are you loading or blacklisting specific drivers on Ubuntu and Artix? Are both systems up to date?

I am running an up-to-date version of Artix as of about two hours ago: the kernel is 5.14.14-artix1-1.

Ubuntu (20.04) is also up to date, but being 20.04 "up to date" means some things are quote old compared to Artix.  On Ubuntu today's kernel is 5.11.0-38-generic and xorg is 1:7.7+19ubuntu14

I am not blacklisting any drivers that I can imagine being relevant (parport_pc, pcmcia_core, ..., (incidentally, the 1990s called and wants their hardware back), a bunch of file systems I don't use, and that's about it.  Ubuntu blacklists lots of things by default, and the most notable looking things are frame buffer drivers.  But since I now have X start up correctly on *some* cold boots, and (perhaps oddly) on all warm boots from Ubuntu, blacklisted drivers wouldn't have been my first place to look, but perhaps you have some knowledge about that which I don't have.

In any case, if you think some more specific details would help, please ask and I'll see what other info I can supply.


Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #8
It sounds like to me that somehow all your devices in /dev are not detected/mounted before lightdm starts. I am unfortunately not really familiar with the openrc booting sequence but in theory it should be fixable at least. If you are using the parallel option with openrc, maybe turn it off and give it a try?
It sounds like to me that somehow all your devices in /dev are not detected/mounted before lightdm starts. I am unfortunately not really familiar with the openrc booting sequence but in theory it should be fixable at least. If you are using the parallel option with openrc, maybe turn it off and give it a try?

Not an OpenRC expert. Try to add this line in /etc/init.d/lightdm::depend()

Code: [Select]
after  udev-settle

and cold restart the system.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #9
It sounds like to me that somehow all your devices in /dev are not detected/mounted before lightdm starts. I am unfortunately not really familiar with the openrc booting sequence but in theory it should be fixable at least. If you are using the parallel option with openrc, maybe turn it off and give it a try?
Thanks for the suggestion.  I did that, and in three consecutive cold boots, X successfully started.  And the difference in startup time was not noticeable (but I wasn't using a stopwatch).  Thanks for that suggestion, it is much appreciated.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #10
Not an OpenRC expert. Try to add this line in /etc/init.d/lightdm::depend()

Code: [Select]
after  udev-settle

and cold restart the system.
Thanks for the suggestion.  I re-edited and put rc_parallel="YES" back in, and put the above depend in.
Speaking as an OpenRC n00b, that seemed like the way to go, but sadly X once again failed, whining about "Open ACPI failed" and using the Radeon driver.

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #11
Thanks for the suggestion.  I re-edited and put rc_parallel="YES" back in, and put the above depend in.
Speaking as an OpenRC n00b, that seemed like the way to go, but sadly X once again failed, whining about "Open ACPI failed" and using the Radeon driver.

Thanks for testing. You''re using lightdm? If yes, can you post your /etc/init.d/lightdm?

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #12
Perhaps firmware could be relevant, say firmware for the card is loaded in Ubuntu, but not in Artix, it might stay there for a while but then revert to the default firmware, or Artix might have a different version that doesn't work so well.
You might check if you needed packages for firmware and amd / ati radeon if you did a base install, not sure which ones exactly:
xf86-video-amdgpu
xf86-video-ati
linux-firmware
The Arch wiki page may help if you haven't read it already:
https://wiki.archlinux.org/title/AMDGPU
(But if it's really a timing issue just ignore that  :D )

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #13
Thanks for testing. You''re using lightdm? If yes, can you post your /etc/init.d/lightdm?
Here it is... (after I added the 'after udev-settle' to it, but made no other changes).
Code: [Select]
#!/usr/bin/openrc-run

supervisor=supervise-daemon
command="/usr/bin/lightdm"

depend() {
    need localmount

    after bootmisc consolefont modules netmount
    after ypbind autofs openvpn gpm lircmd
    after quota keymaps acpid
    after udev-settle
    before alsasound
    want logind
    use xfs
    provide xdm
}

Re: X won't start after cold reboot, but starts after rebooting out of Ubuntu

Reply #14
Here it is... (after I added the 'after udev-settle' to it, but made no other changes).
Code: [Select]
#!/usr/bin/openrc-run

supervisor=supervise-daemon
command="/usr/bin/lightdm"

depend() {
    need localmount

    after bootmisc consolefont modules netmount
    after ypbind autofs openvpn gpm lircmd
    after quota keymaps acpid
    after udev-settle
    before alsasound
    want logind
    use xfs
    provide xdm
}


Still looks like a synchronization problem to me. If you want, boot the system twice, one with rc_parallel="YES" and another one without and check /var/log/rc.log to see the order of services brought up. Interesting comments from rc.conf.

# Set to "YES" if you want the rc system to try and start services
# in parallel for a slight speed improvement. When running in parallel we
# prefix the service output with its name as the output will get
# jumbled up.
# WARNING: whilst we have improved parallel, it can still potentially lock
# the boot process. Don't file bugs about this unless you can supply
# patches that fix it without breaking other things!


To play safe, maybe you should leave parallel option to "NO".