Skip to main content
Topic: [SOLVED] Setting nvidia_drm in mkinitcpio and grub causes xorg to crash (Read 509 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Setting nvidia_drm in mkinitcpio and grub causes xorg to crash

Hi All.

Todya, I  upgraded to the new nvidia 550.54.14-1 drivers. I was excited because it was supposed to fix some issues on wayland. I have river wm installed and it has had bad stuttering since I installed wayland for the first time a few months ago. I had hoped the update would fix it (it didn't, I suspect there might be something I configured wrong).

Additionally, today's update caused xorg to crash. Ever since I configured for wayland, xorg had had a few race conditions when logging in, causing me to have to simply restart the x server (either by logging in again, or logging into a separate TTY and using startx). This time, however, it simply would not start at all no matter what I tried.

I went back to my notes on my wayland installation, and decided simply to reverse them to see if that would remedy the problem. And indeed, it worked, I'm currently using an Xorg session. Trying to trace down my problem I believe comes down to setting nvidia-drm=1 in the /etc/default/grub file's section, GRUB_CMDLINE_LINUX_DEFAULT,  before regenerating the grub config using sudo grub-mkconfig -o /boot/grub/grub.cfg. I also added nvidia_drm to the MODULES section of the /etc/mkinitcpio.conf, before regenerating the initramfs using mkinitcpio -P.

It seems I can only have a stuttery wayland session or a working Xorg session, but not both (like before today's update). As I mentioned before, I believe this has more to do with me making a mistake in the initial configuration of getting wayland up and running than anything to do with either xorg, wayland, or even nvidia. I followed the ArchWiki's guide on how to set it up: https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting

Here are the relevant lines in each file that is related to the configuration prior to my changes to get xorg to work properly.

Code: [Select]
# /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia_drm.modeset=1"

Code: [Select]
# /etc/mkinitcpio.conf
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

I don't think this is related, but I did remove this from the /etc/environment file as well when troubleshooting. It may or may not be related to xorg starting:

Code: [Select]
# /etc/environment
GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia
ENABLE_VKBASALT=1
LIBVA_DRIVER_NAME=nvidia

Any ideas on why setting nvidia_drm is causing xorg to crash? I'd like to eventually also get the stuttering to stop on wayland (i've tried sway as well with the same stuttering effect), but that is a separate (but possibly related) issue. I suspect that solving this issue will solve the other.

Any help, as always, is greatly appreciated. ☮️

EDIT: Well, I "solved" the issue by simply leaving the grub and initramfs settings as is (without the above settings), and instead just opted to adjuts them in modprobe.d:

Code: [Select]
# /etc/modprobe.d/nvidia_drm.conf
options nvidia_drm modeset=1 fbdev=1