[nvidia-prime] switches between xorg and wayland session

Bug #1925238 reported by Iain Lane
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-drivers-common (Ubuntu)
Confirmed
High
Alberto Milone
Hirsute
Won't Fix
High
Alberto Milone
Impish
Won't Fix
High
Alberto Milone

Bug Description

I have noticed this on a hirsute install from today's RC media (20210420) with ubuntu-drivers-common 1:0.8.9.1.

The first boot is always xorg, and nvidia mode is selected.

After that reboots are *usually* wayland, but sometimes they are xorg too.

Performance mode is selected in nvidia-settings, which is supposed to mean nvidia & therefore xorg but it's not working. Selecting it explicitly doesn't help either.

What is the default meant to be - probably ondemand?

Seems like it's somehow nondeterministic. Attaching some logs.

Tags: iso-testing
Revision history for this message
Iain Lane (laney) wrote :
Revision history for this message
Iain Lane (laney) wrote :

From the first boot

Revision history for this message
Iain Lane (laney) wrote :

From the first boot

Revision history for this message
Iain Lane (laney) wrote :

From the second boot

Revision history for this message
Iain Lane (laney) wrote :

From the second boot

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1925238

tags: added: iso-testing
Iain Lane (laney)
description: updated
tags: added: rls-hh-incoming
Revision history for this message
Iain Lane (laney) wrote :

From looking at the code it seems like we're writing Xorg config files - at least this probably needs updating to know about Wayland

Revision history for this message
Iain Lane (laney) wrote :

Hey Alberto, would you mind taking a look at this please? Feels to me like there might be some updates needed for wayland-by-default here..?

Changed in ubuntu-drivers-common (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
Iain Lane (laney)
tags: removed: rls-hh-incoming
Changed in ubuntu-drivers-common (Ubuntu Hirsute):
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Alberto Milone (albertomilone) wrote :

If you use intel mode, then GDM will default to Wayland, since no NVIDIA driver is detected. Would you rather have users rely on X11 even in intel mode?

Revision history for this message
Iain Lane (laney) wrote :

No, they should be on "ubuntu" and that is Wayland if wayland works and Xorg if it doesn't.

The problem is that changing the setting doesn't appear to have any effect at least from what I can see. For example look at the screenshot attached here.

Do you see this kind of thing on a hybrid machine with hirsute or is it all OK for you?

Revision history for this message
Alberto Milone (albertomilone) wrote :

I don't get that at all (see the attached screenshot).

Detection seems to work well here:

giu 01 16:05:52 dell-g7 systemd[1725]: Starting GNOME Shell on Wayland...
giu 01 16:05:52 dell-g7 systemd[1725]: Starting GNOME Shell on X11...
giu 01 16:05:52 dell-g7 systemd[1725]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2001.scope: Succeeded.
giu 01 16:05:52 dell-g7 systemd[1725]: <email address hidden>: Control process exited, code=exited, status=2/INVALIDARGUMENT
giu 01 16:05:52 dell-g7 systemd[1725]: <email address hidden>: Skipped due to 'exec-condition'.
giu 01 16:05:52 dell-g7 systemd[1725]: Condition check resulted in GNOME Shell on Wayland being skipped.

Revision history for this message
Iain Lane (laney) wrote : Re: [Bug 1925238] Re: [nvidia-prime] switches between xorg and wayland session

ack. Is yours the "ubuntu" session? i.e. auto-detection, the default,
not "ubuntu-xorg" which is manually selecting "Ubuntu on Xorg" from gdm.
Check $DESKTOP_SESSION. I can confirm that if I pick ubuntu-xorg then
nvidia-smi looks like yours.

I see from `lsmod` that nvidia is loaded - apparently that's not enough
to get it to be used though. I would have expected the udev rule
(61-gdm.rules) to have fired here and caused gdm-disable-wayland to run,
so that I got Xorg and things running on the nvidia GPU; is that a valid
expectation?

On Tue, Jun 01, 2021 at 02:22:34PM -0000, Alberto Milone wrote:
> I don't get that at all (see the attached screenshot).
>
> Detection seems to work well here:
>
> giu 01 16:05:52 dell-g7 systemd[1725]: Starting GNOME Shell on Wayland...
> giu 01 16:05:52 dell-g7 systemd[1725]: Starting GNOME Shell on X11...
> giu 01 16:05:52 dell-g7 systemd[1725]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2001.scope: Succeeded.
> giu 01 16:05:52 dell-g7 systemd[1725]: <email address hidden>: Control process exited, code=exited, status=2/INVALIDARGUMENT
> giu 01 16:05:52 dell-g7 systemd[1725]: <email address hidden>: Skipped due to 'exec-condition'.
> giu 01 16:05:52 dell-g7 systemd[1725]: Condition check resulted in GNOME Shell on Wayland being skipped.
>
> ** Attachment added: "Screenshot from 2021-06-01 16-08-04.png"
> https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1925238/+attachment/5501675/+files/Screenshot%20from%202021-06-01%2016-08-04.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1925238
>
> Title:
> [nvidia-prime] switches between xorg and wayland session
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1925238/+subscriptions

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Alberto Milone (albertomilone) wrote :

yes, it is the ubuntu session (I wasn't given a choice on login).

Can you try replacing "DRIVER" with "DRIVERS" in /lib/udev/rules.d/61-gdm.rules , please?

Revision history for this message
Iain Lane (laney) wrote :

hmm, yeah, that seems to work!

Why is that, can you explain why the other one doesn't work so we can
forward it upstream (the udev rule is upstream)?

Follow up question - we'll want to be dropping this file won't we, once
nvidia actually supports wayland. What happens with prime then?

On Thu, Jun 03, 2021 at 09:07:50AM -0000, Alberto Milone wrote:
> yes, it is the ubuntu session (I wasn't given a choice on login).
>
> Can you try replacing "DRIVER" with "DRIVERS" in
> /lib/udev/rules.d/61-gdm.rules , please?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1925238
>
> Title:
> [nvidia-prime] switches between xorg and wayland session
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1925238/+subscriptions

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Alberto Milone (albertomilone) wrote :

Here is the difference:

DRIVER
Match the driver name of the event device. Only set this key for devices which are bound to a driver at the time the event is generated.

DRIVERS
Search the devpath upwards for a matching device driver name.

https://www.freedesktop.org/software/systemd/man/udev.html

I assume the device is not always bound to the driver when the event is generated.

Revision history for this message
Iain Lane (laney) wrote :

Yeah, I read the man page too, but it wasn't understandable to me. If
you understand it more, could you prepare a change for upstream? I can't
just paste those two entries there to them, that's not enough
information.

Any hints on the second question about when wayland does start working,
what prime support is supposed to do then?

On Fri, Jun 04, 2021 at 05:42:53AM -0000, Alberto Milone wrote:
> Here is the difference:
>
> DRIVER
> Match the driver name of the event device. Only set this key for devices which are bound to a driver at the time the event is generated.
>
> DRIVERS
> Search the devpath upwards for a matching device driver name.
>
> https://www.freedesktop.org/software/systemd/man/udev.html
>
>
> I assume the device is not always bound to the driver when the event is generated.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1925238
>
> Title:
> [nvidia-prime] switches between xorg and wayland session
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1925238/+subscriptions

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Alberto Milone (albertomilone) wrote :

I think we need better detection code upstream, since the NVIDIA 470 driver will have full Wayland (and accelerated XWayland) support, and the udev rule should take this into account.

Revision history for this message
Iain Lane (laney) wrote :

Ok, let's keep this bug report about the udev rule. We will need to make sure 470 works properly with prime, I'll follow up with that separately.

So would you be able to prepare a merge proposal please? 🙏🙏🙏🙏🙏

Changed in ubuntu-drivers-common (Ubuntu Hirsute):
importance: Undecided → High
Changed in ubuntu-drivers-common (Ubuntu Impish):
importance: Undecided → High
Revision history for this message
Sebastien Bacher (seb128) wrote :

Alberto, that's fixed now right?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-drivers-common (Ubuntu Hirsute):
status: New → Confirmed
Changed in ubuntu-drivers-common (Ubuntu Impish):
status: New → Confirmed
Changed in ubuntu-drivers-common (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

The Hirsute Hippo has reached End of Life, so this bug will not be fixed for that release.

Changed in ubuntu-drivers-common (Ubuntu Hirsute):
status: Confirmed → Won't Fix
Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 21.10 (Impish Indri) has reached end of life, so this bug will not be fixed for that specific release.

Changed in ubuntu-drivers-common (Ubuntu Impish):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers