New comment by Treeniks on void-packages repository https://github.com/void-linux/void-packages/issues/47125#issuecomment-1809598774 Comment: When I look into gdm's udev rules, I can find these lines: ``` # Check if suspend/resume services necessary for working wayland support is available TEST{0711}!="/usr/bin/nvidia-sleep.sh", GOTO="gdm_disable_wayland" TEST{0711}!="/usr/lib/systemd/system-sleep/nvidia", GOTO="gdm_disable_wayland" ... ``` meaning they specifically disable wayland if a `/usr/bin/nvidia-sleep.sh` file is not found. The Arch Wiki has some info on this: > If the Wayland option is not displayed in GDM, even after [enabling KMS](https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting) and [configuring Wayland](https://wiki.archlinux.org/title/NVIDIA#Wayland), then you most likely have `NVreg_PreserveVideoMemoryAllocations` and [NVIDIA systemd services](https://gitlab.gnome.org/GNOME/gdm/-/commit/51181871e9db716546e9593216220389de0d8b03) disabled. > The still experimental system enables saving all video memory (given enough space on disk or main RAM). The interface is through the `/proc/driver/nvidia/suspend` file as follows: > * write "suspend" (or "hibernate") to `/proc/driver/nvidia/suspend` immediately before writing to the usual Linux `/sys/power/state` file > * write "resume" to `/proc/driver/nvidia/suspend` immediately after waking up, or after an unsuccessful attempt to suspend or hibernate. > > To save and restore all video memory contents, [load](https://wiki.archlinux.org/title/Kernel_modules#Setting_module_options) the nvidia kernel module with the `NVreg_PreserveVideoMemoryAllocations=1` option and [enable](https://wiki.archlinux.org/title/Enable) `nvidia-suspend.service` and `nvidia-hibernate.service`. > [...] > The interaction with `/proc/driver/nvidia/suspend` is handled by the simple Unix shell script at `/usr/bin/nvidia-sleep.sh`, which will itself be called by [systemd](https://wiki.archlinux.org/title/Systemd) or other tools. The [nvidia-utils](https://archlinux.org/packages/?name=nvidia-utils) package ships with the following services (which essentially just call `nvidia-sleep.sh`): `nvidia-suspend.service`, `nvidia-hibernate.service`, `nvidia-resume.service`. The Debian docs on this also have similar instructions: From what I can tell by using `xlocate`, I cannot find any package which includes such services or scripts. I am awfully unqualified for this, but I believe the only way to make this work in Void at the moment is to disable the GDM udev rule entirely (with `ln -s /dev/null /etc/udev/rules.d/61-gdm.rules`) and live with a broken suspend, until a similar `nvidia-utils` package is added. I did however notice that the `/proc/driver/nvidia/suspend` file already has a `suspend hibernate resume` line written in it. Not sure what this does, but maybe by simply adding the `NVreg_PreserveVideoMemoryAllocations=1` kernel module option, suspend can be fixed (or at least improved)? I.e. adding a `/etc/modprobe.d/nvidia-power-management.conf` file (be careful not to name it `nvidia.conf` like my idiot self, that will override `/lib/modprobe.p/nvidia.conf` which blacklists nouveau) with the following content: ``` options nvidia NVreg_PreserveVideoMemoryAllocations=1 ``` (and I believe one has to [reconfigure the linux kernel](https://docs.voidlinux.org/config/kernel.html#install-hooks)?)