Bug 2024226

Summary: Selecting "Standard Wayland" session gives randomly an Xorg or Wayland session
Product: Red Hat Enterprise Linux 8 Reporter: Olivier Fourdan <ofourdan>
Component: gdmAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED DUPLICATE QA Contact: Peter Kopec <pekopec>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.6CC: chref, hdegoede, rstrode, tpelka
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-01 14:36:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Olivier Fourdan 2021-11-17 16:12:46 UTC
Description of problem:

I am seeing a really weird behavior with NVIDIA prop driver on el8 (gdm-40.0-20.el8.x86_64 gnome-session-wayland-session-3.28.1-13.el8.x86_64 and gnome-session-xsession-3.28.1-13.el8.x86_64).

I get randomly Xorg or Wayland with the "Standard (Wayland display server)" session.

Typically, I was on Wayland, I logged out, re-login staying with the "Standard (Wayland display server)" and got an Xorg session (unexpected), logged out, re-login on "Classic (Wayland display server)" and got Wayland (expected) then logged out again and retried with "Standard (Wayland display server)" again and got… Wayland (expected)!

Version-Release number of selected component (if applicable):

gdm-40.0-20.el8.x86_64
gnome-session-wayland-session-3.28.1-13.el8.x86_64
gnome-session-xsession-3.28.1-13.el8.x86_64

How reproducible:

Random

Steps to Reproduce:
1. Install NVIDIA proprietary driver on el8 current
2. Select the "Standard (Wayland display server)" session 
3. Log in

Actual results:

You may get either Xorg or Wayland if you're lucky.

Expected results:

A Wayland session as requested

Additional info:

Comment 2 Olivier Fourdan 2021-11-17 16:43:07 UTC
Looks like there are two "gnome.desktop" files (one in wayland-sessions and one in xsessions) and GdmSession picks either one or the other of the "gnome.deskop" file:

Nov 17 16:07:23 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:07:23 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:32:22 dell gdm-password][2218]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 16:32:22 dell gdm-password][2218]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 16:34:22 dell gdm-password][2218]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 16:34:22 dell gdm-password][2218]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 16:52:02 dell gdm-password][2218]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 16:52:02 dell gdm-password][2218]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 16:53:32 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:53:32 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:54:45 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:54:45 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:55:32 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 16:55:32 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 17:10:56 dell gdm-password][9174]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 17:10:56 dell gdm-password][9174]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 17:10:57 dell gdm-password][9174]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 17:10:57 dell gdm-password][9174]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: yes
Nov 17 17:11:09 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no
Nov 17 17:11:09 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome.desktop' is wayland session: no

With:

$ rpm -qf /usr/share/wayland-sessions/gnome.desktop 
gnome-session-wayland-session-3.28.1-13.el8.x86_64

$ rpm -qf /usr/share/xsessions/gnome.desktop
gnome-session-xsession-3.28.1-13.el8.x86_64

Could that be the problem maybe?

Comment 5 Ray Strode [halfline] 2021-11-19 15:52:59 UTC
So looking in the log, this part looks particularly interesting:

```
Nov 17 16:53:42 dell gdm[1691]: Gdm: GdmSession: type (null), program? no, seat seat0
Nov 17 16:53:42 dell gdm[1691]: Gdm: GdmSession: 'gnome-wayland.desktop' does not register self
Nov 17 16:53:42 dell gdm[1691]: Gdm: GdmSession: getting session command for file 'gnome-wayland.desktop'
Nov 17 16:53:42 dell gdm[1691]: Gdm: GdmSession: checking if file 'gnome-wayland.desktop' is wayland session: yes
...
Nov 17 16:53:42 dell gdm-password][6693]: Gdm: GdmSessionWorker: start program: /usr/libexec/gdm-x-session --register-session  "gnome-session"
```

So it knows the session is a wayland session but runs it through X anyway! I think we may just need to backport the fix from bug 2009044 (which is a slightly different scenario, but I think may have the same root fix).

Namely, I think this is the fix:

https://gitlab.gnome.org/GNOME/gdm/-/commit/ae75f642859dcfdcfcaaffc617ebe7a68cf0bed7

Comment 7 Ray Strode [halfline] 2021-12-01 14:36:35 UTC

*** This bug has been marked as a duplicate of bug 2009045 ***