Skip to content

Commit

Permalink
Rework of the NVIIDA Wayland guide
Browse files Browse the repository at this point in the history
Signed-off-by: Oro <93224879+orowith2os@users.noreply.github.com>
  • Loading branch information
orowith2os authored and mrshmllow committed Sep 18, 2022
1 parent c9daa1a commit 20f6320
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crystal-linux/nvidiawayland.mdx
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
title: How to make GNOME Wayland work on an NVIDIA GPU
title: How to make GNOME Wayland work on a NVIDIA GPU
---
Sometimes, GDM disables GNOME Wayland when it detects you have an NVIDIA GPU. If you want to force-enable GNOME Wayland, you first have to enable DRM [kernel mode setting](https://wiki.archlinux.org/title/Kernel_mode_setting) (KMS) on the NVIDIA driver so Wayland is able to run. To do this, you need to add a kernel parameter to tell the NVIDIA driver to enable KMS. The kernel parameter you need to add is `nvidia_drm.modeset=1`.

## GRUB
For example, if you are using GRUB, there should be a file called `/etc/default/grub` and there should be a line in that file that looks like this.
For example, if you are using GRUB, there should be a file called `/etc/default/grub`. In there should be a line in that file that looks like this:
```
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
```
You want to append the new kernel parameter at the end of the line, between the quotes. Parameters are separated by spaces, so put a space after the last parameter and append the parameter there. Make sure to edit the file with super-user permissions (like with `sudo`) or you might get errors writing the file.
You want to append the new kernel parameter at the end of the line, between the quotes. Parameters are separated by spaces, so put a space after the last parameter and append the parameter there. Make sure to edit the file with super-user permissions (with `sudo`) or you will get errors writing the file.

### Example
```
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia_drm.modeset=1"
```
After you do that, you want to make sure GRUB knows that you have changed your kernel parameters. So you need to rebuild your GRUB configuration file. To rebuild your GRUB configuration file, run `sudo grub-mkconfig -o /boot/grub/grub.cfg` and your GRUB configuration should have the new kernel parameter and you can apply it by rebooting your system.
After you add the kernel parameter, you want to make sure GRUB knows that you have changed your kernel parameters. To do this, you need to rebuild your GRUB configuration file. To rebuild your GRUB configuration file, run `sudo grub-mkconfig -o /boot/grub/grub.cfg`, and your GRUB configuration should have the new kernel parameter and you can use it by rebooting your system.

## What to do after you add the kernel parameter.
After you add the kernel parameter, that might be all you need to do to get GNOME Wayland working. Check if you can access GNOME Wayland and if you can't, try these other steps.
After you add the kernel parameter and restart, that might be all you need to do to get GNOME Wayland working. Check if you can access GNOME Wayland and if you can't, try these other steps.

GDM uses some chipset dependent [udev rules](https://gitlab.gnome.org/GNOME/gdm/-/blob/main/data/61-gdm.rules.in) to see if it should force Xorg usage instead of letting you use Wayland. If you want to force-enable Wayland, run this command.
```
sudo ln -s /dev/null /etc/udev/rules.d/61-gdm.rules
```
This command should symlink *nothing* to GDM's udev rules. Rules in `/etc/udev/rules.d/` should overwrite rules in `/usr/lib/udev/rules.d` (which are shipped by the package its self and managed by your package manager).
This command should symlink GDM's udev rules to *nothing*. Rules in `/etc/udev/rules.d/` should overwrite rules in `/usr/lib/udev/rules.d` (which are shipped by the package itself and managed by your package manager).


After that, try and reboot and check if GNOME Wayland works. If it still doesn't work, you need to add some modules to your initramfs for early boot modesetting. There should be a file (in Arch based distributions) called `/etc/mkinitcpio.conf`. In that file, there should be a `MODULES` line. On that line, there should be some parentheses. Between them, you can add kernel modules you want built into your initramfs (each module is separated by a space). We want to add some NVIDIA modules to our initramfs so it can be loaded early in the boot process. So add these modules to the file. Make sure to edit this file with super-user permissions.
After that, reboot and see if GNOME Wayland works. If it still doesn't work, you need to add some modules to your initramfs for early boot modesetting. There should be a file (in Arch based distributions) called `/etc/mkinitcpio.conf`. In that file, there should be a `MODULES` line. On that line, there should be some parentheses. Between them, you can add kernel modules you want built into your initramfs (each module is separated by a space). We want to add some NVIDIA modules to our initramfs so it can be loaded early in the boot process. So add these modules to the file. Make sure to edit this file with super-user permissions.
```
nvidia nvidia_modeset nvidia_uvm nvidia_drm
```
Expand All @@ -41,3 +41,4 @@ sudo mkinitcpio -P
```

And after that, reboot and GNOME Wayland *should* be working!
If it still doesn't work, your GPU might not support Wayland on the proprietary NVIDIA drivers. There is no fix for this other than using the nouveau driver, which doesn't support everything that the proprietary NVIDIA driver does.

0 comments on commit 20f6320

Please sign in to comment.