[focal] Wayland session is not available when a laptop has an Nvidia card an Intel card is in use

Bug #1862531 reported by Dmitrii Shcherbakov
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gdm3 (Ubuntu)
Won't Fix
Low
Unassigned
nvidia-prime (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

A Wayland session present at /usr/share/wayland-sessions/ubuntu-wayland.desktop is not displayed at the login screen when a system has an iGPU (Intel) and dGPU (Nvidia) and Intel iGPU is used:

prime-select query
intel

Only sessions at /usr/share/xsessions are present.

➜ ~ ls /usr/share/xsessions
remmina-gnome.desktop ubuntu.desktop

➜ ~ ls /usr/share/wayland-sessions
ubuntu-wayland.desktop

The root cause is the existence of a udev rule in 61-gdm.rules that runs gdm-disable-wayland when an nvidia driver is loaded in combination with LP: #1848326 (see this comment specifically https://bugs.launchpad.net/ubuntu/+source/nvidia-prime/+bug/1848326/comments/7).

dpkg -S /lib/udev/rules.d/61-gdm.rules
gdm3: /lib/udev/rules.d/61-gdm.rules

grep nvidia /lib/udev/rules.d/61-gdm.rules
# disable Wayland when using the proprietary nvidia driver
DRIVER=="nvidia", RUN+="/usr/lib/gdm3/gdm-disable-wayland"

When I comment it out and reboot, I get the right menu entry and am able to observe the right session type:

➜ ~ grep nvidia /lib/udev/rules.d/61-gdm.rules
# disable Wayland when using the proprietary nvidia driver
#DRIVER=="nvidia", RUN+="/usr/lib/gdm3/gdm-disable-wayland"

➜ ~ loginctl
SESSION UID USER SEAT TTY
      2 1000 dima seat0 tty2

1 sessions listed.

➜ ~ loginctl show-session 2 -p Type
Type=wayland

System info:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04
Codename: focal

➜ ~ dpkg -l | grep gdm3
ii gdm3 3.34.1-1ubuntu1 amd64 GNOME Display Manager

➜ ~ dpkg -l | grep nvidia-prime
ii nvidia-prime 0.8.13 all Tools to enable NVIDIA's Prime

➜ ~ dpkg -l | grep nvidia-driver
ii nvidia-driver-440 440.59-0ubuntu1 amd64 NVIDIA driver metapackage

summary: - Wayland session is not available when a laptop has an Nvidia card an
- Intel card is in use
+ [focal] Wayland session is not available when a laptop has an Nvidia
+ card an Intel card is in use
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report.

That udev rule causing the problem is unfortunately something that upstream won't let us replace. I have tried replacing it with smarter mutter logic and (so far) it's been rejected:

https://gitlab.gnome.org/GNOME/mutter/merge_requests/625

tags: added: focal
Changed in gdm3 (Ubuntu):
status: New → Won't Fix
Changed in nvidia-prime (Ubuntu):
status: New → Invalid
tags: added: nvidia-drm.modeset
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Although we can always try again and search for a third solution, if you would like to open a new bug upstream?

https://gitlab.gnome.org/GNOME/gdm/issues

Changed in gdm3 (Ubuntu):
status: Won't Fix → Incomplete
importance: Undecided → Low
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

Hi Daniel, thank you for the quick response and prior work.

I think the upstream check for the nvidia driver in 61-gdm.rules is too broad to be useful as the nvidia driver might be loaded for other reasons (e.g. CUDA usage or hw accelerated video encoding/decoding while nvidia-drm.ko is blacklisted) so I believe I can come up with an issue upstream.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

BTW, we don't want to remove the udev rule because removing it causes a bigger problem for more people: bug 1705369

So a general fix like https://gitlab.gnome.org/GNOME/mutter/merge_requests/625 would need to exist before the udev rule can be removed.

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

I see, thanks for the clarification.

I will need to read through other cases as well.

tags: removed: champagne
Revision history for this message
Sebastien Bacher (seb128) wrote :

The wayland session isn't a critical feature, that doesn't need to be rls tracked

tags: added: rls-ff-notfixing
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gdm3 (Ubuntu) because there has been no activity for 60 days.]

Changed in gdm3 (Ubuntu):
status: Incomplete → Expired
Changed in gdm3 (Ubuntu):
status: Expired → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.