From b2d6ccee16df921af515efd559dcf59d5b2d0d99 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 14 Feb 2022 17:03:09 -0500 Subject: data: Don't race with vendor nvidia driver at startup The vendor nvidia driver has two modules loaded at startup. It's not uncommon for the second module to still be loading when GDM starts. Our udev rule relies on the second module to set up GDM's boot configuration. This commit adds some synchronization to stall GDM a bit if the vendor driver is still coming up. https://gitlab.gnome.org/GNOME/gdm/-/issues/763 --- data/61-gdm.rules.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'data/61-gdm.rules.in') diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in index e9c72697..9451c12e 100644 --- a/data/61-gdm.rules.in +++ b/data/61-gdm.rules.in @@ -9,6 +9,15 @@ DRIVERS=="simple-framebuffer", GOTO="gdm_nomodeset_end" IMPORT{cmdline}="nomodeset", GOTO="gdm_disable_wayland" LABEL="gdm_nomodeset_end" +# The vendor nvidia driver has mutiple modules that need to be loaded before GDM can make an +# informed choice on which way to proceed, so force GDM to wait until NVidia's modules are +# loaded before starting up. +KERNEL!="nvidia", GOTO="gdm_nvidia_end" +SUBSYSTEM!="module", GOTO="gdm_nvidia_end" +ACTION!="add", GOTO="gdm_nvidia_end" +RUN+="@bindir@/touch /run/udev/gdm-waiting-on-udev" +LABEL="gdm_nvidia_end" + # Disable wayland when nvidia modeset is disabled or when drivers are a lower # version than 470, # For versions above 470 but lower than 510 prefer Xorg, @@ -30,10 +39,14 @@ GOTO="gdm_end" LABEL="gdm_prefer_xorg" RUN+="@libexecdir@/gdm-runtime-config set daemon PreferredDisplayServer xorg" -GOTO="gdm_end" +GOTO="gdm_stop_waiting_on_udev" LABEL="gdm_disable_wayland" RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false" +GOTO="gdm_stop_waiting_on_udev" + +LABEL="gdm_stop_waiting_on_udev" +RUN+="@bindir@/rm -f /run/udev/gdm-waiting-on-udev" GOTO="gdm_end" LABEL="gdm_end" -- cgit v1.2.1