When it makes sense to load NVIDIA modules into initramfs? (DRM kernel mode setting)

I’m in the process of configuring NVIDIA card on Arch system. I followed the instructions of the Arch wiki article’s “DRM kernel mode setting” section, and after adding nvidia-drm.modeset=1 kernel boot parameter in the bootloader config file, it fixed my OpenGL rendering (which used open, Mesa renderer before the change).

The subsection “Early loading” then talks about loading DRM “at the earliest possible occasion” by adding nvidia modules to the initramfs, and proceeds to the instructions on how to do it. What it doesn’t cover is “why”.

Can someone please shed light on this?

My main question is why would you want to add nvidia modules to initramfs? Is it generally recommended? Any examples of when this could be useful? Or is it only needed when you’re having issues?

It’s also unclear whether nvidia-drm.modeset=1 method becomes redundant when employing this “early loading” method.

Nowadays, the driver should be added to the initrd for a simple reason: timing. Modern pcie ssd systems boot so fast that without loading it from initrd chances are high that the driver isn’t initialized when the Xserver/Wayland compositor has already started so you end up with a broken graphics system.

1 Like

Thanks for clarifying this @generix. So for simple setups, running one NVIDIA GPU and OS installed on SSD or NVMe, it’s a best practice to include those modules into the initrd (initramfs).

Sidenotes: things like ‘early kms’ and stuff don’t apply to the nvidia driver since it provides neither fbdev nor kms console. The console will always be running on vga fb or efifb depending on boot method (bios/efi).
nvidia-drm.modeset=1 thus doesn’t have any influence on the console but this is needed for wayland and enabling prime sync on hybrid graphics systems.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.