Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873160 - gnome-base/gdm-43.0 61-gdm.rules checks for ENV{NVIDIA_PRESERVE_VIDEO_MEMORY_ALLOCATIONS}!="1" to enable wayland on nvidia
Summary: gnome-base/gdm-43.0 61-gdm.rules checks for ENV{NVIDIA_PRESERVE_VIDEO_MEMORY_...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://gitlab.gnome.org/GNOME/mutter...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-27 09:54 UTC by Thomas Scheiblauer
Modified: 2023-11-15 15:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Scheiblauer 2022-09-27 09:54:48 UTC
When NVreg_PreserveVideoMemoryAllocations in modeprobe.d is set to 0, gdm will disable wayland in /lib/udev/rules.d/61-gdm.rules, therefore x11-drivers/nvidia-drivers should set it to 1 when emerged with the "wayland" USE-flag.

Reproducible: Always

Steps to Reproduce:
1. install x11-drivers/nvidia-drivers and gnome-base/gdm with "wayland" USE-flag
2. try to open a Wayland session
3.
Actual Results:  
Wayland sessions are not available from gdm when using the nvidia proprietary driver.

Expected Results:  
Possibility to open wayland sessions from gdm when using the nvidia proprietary driver.

Related bug: https://bugs.gentoo.org/873154
Comment 1 Ionen Wolkens gentoo-dev 2022-09-27 10:13:12 UTC
This has been known to cause issues with elogind for several users (partly due to lack of nvidia hooks) and not convinced I want to unexpectedly turn this back on at the moment even with USE=wayland (perhaps not even using wayland) -- doesn't help that I don't have a proper setup to test this at the moment (maybe if had some feedback).

Would rather leave it up to users to edit their nvidia.conf as they see fit.

Regardless of if that'd be good or not, that gdm is checking sleep-related stuff to enable wayland makes little sense to me -- this is just adding obscure ways in which wayland will be disabled based on how users setup sleep features.
Comment 2 Thomas Scheiblauer 2022-09-27 10:55:08 UTC
(In reply to Ionen Wolkens from comment #1)
> Would rather leave it up to users to edit their nvidia.conf as they see fit.

In this case I would at least add an explaining elog entry into pkg_postinst() to make people aware of this  issue, since enabling the "wayland" USE-flag alone would not be enough for starting Wayland sessions with this driver.
Comment 3 Ionen Wolkens gentoo-dev 2022-09-27 11:00:33 UTC
(In reply to Thomas Scheiblauer from comment #2)
> In this case I would at least add an explaining elog entry into
> pkg_postinst() to make people aware of this  issue, since enabling the
> "wayland" USE-flag alone would not be enough for starting Wayland sessions
> with this driver.
I consider this to be a gdm issue more than a nvidia-drivers issue, and I think gdm should be the one to do something about it.
Comment 4 Ionen Wolkens gentoo-dev 2022-09-27 11:12:04 UTC
(In reply to Ionen Wolkens from comment #3)
> (In reply to Thomas Scheiblauer from comment #2)
> > In this case I would at least add an explaining elog entry into
> > pkg_postinst() to make people aware of this  issue, since enabling the
> > "wayland" USE-flag alone would not be enough for starting Wayland sessions
> > with this driver.
> I consider this to be a gdm issue more than a nvidia-drivers issue, and I
> think gdm should be the one to do something about it.
As a reminder, this is entirely gdm-specific, this doesn't stop you from using wayland with e.g. sddm+plasma, sway, etc... And I'm not quite sure why it wants to disable wayland based on sleep settings.
Comment 5 Ivo Šmerek 2022-11-11 18:43:08 UTC
I upgraded to gdm-43.0 today and also got my Wayland session unavailable. I'm glad I found those two reported bugs. I had to change the lookup path for "system-sleep/nvidia" and set NVIDIA_PRESERVE_VIDEO_MEMORY_ALLOCATIONS variable to 1. But found another problem.

```
IMPORT{program}="/bin/sh -c 'echo NVIDIA_HIBERNATE=`systemctl is-enabled nvidia-hibernate`'"
ENV{NVIDIA_HIBERNATE}!="enabled", GOTO="gdm_disable_wayland"
IMPORT{program}="/bin/sh -c 'echo NVIDIA_RESUME=`systemctl is-enabled nvidia-resume`'"
ENV{NVIDIA_RESUME}!="enabled", GOTO="gdm_disable_wayland"
IMPORT{program}="/bin/sh -c 'echo NVIDIA_SUSPEND=`systemctl is-enabled nvidia-suspend`'"
ENV{NVIDIA_SUSPEND}!="enabled", GOTO="gdm_disable_wayland"
```

These lines in the rules file (right after the one with MEMORY_ALLOCATIONS check) basically disable Wayland session for anyone with the OpenRC system since there isn't a systemctl utility. I had to comment out these lines to enable the Wayland session again.
Comment 6 Pacho Ramos gentoo-dev 2022-11-20 08:46:01 UTC
It seems the setting is here to avoid problems like:
https://gitlab.gnome.org/GNOME/mutter/-/issues/1942
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3583
Comment 7 Pacho Ramos gentoo-dev 2022-11-20 08:46:17 UTC
(In reply to Pacho Ramos from comment #6)
> It seems the setting is here to avoid problems like:
*needed