canonical / nvidia-graphics-drivers

Packaging scripts for nvidia-graphics-drivers in Ubuntu
43 stars 34 forks source link

udev: Enable runtime PM after driver is bound #41

Closed khfeng closed 2 years ago

khfeng commented 2 years ago

We are facing an issue that GDM starts with Wayland instead of Xorg, despite of 61-gdm.rules' gdm-disable-wayland for NVIDIA graphics.

The issue happens because gdm-disable-wayland is executed after GDM has started. The reason why the udev rules takes so long is because the the runtime suspended NVIDIA GFX takes more than 1 second to runtime resume, hence the driver starts the probing routine rather late.

The proper solution is to impose a barrier like systemd-udev-settle.service before GDM, but limits to the GFX device only to avoid waiting for all udev rules are finished.

Since such mechanism isn't available right now, workaround the issue by enabling runtime PM after driver is bound to avoid the runtime resume delay, and hope GDM always starts after the probing is done.

khfeng commented 2 years ago

This is also needed for 460 series.

3v1n0 commented 2 years ago

This is indeed an issue we've experienced a bit, we had some upstream discussion in how to handle this, but I indeed believe that nvidia driver should be the package ensuring that this is happening.

khfeng commented 2 years ago

This workaround isn't ideal, since this patch still doesn't guarantee that NVIDIA driver is probed before GDM starts, as driver probing can happen at any time. However, I can't come up with any better idea now.

The better way is still proper Wayland support from NVIDIA driver.

tseliot commented 2 years ago

I think this is an acceptable workaround for now.