I’m in the process of configuring NVIDIA card on a fresh install. 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”.
So I thought maybe someone can shed light on this.
The 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.
Th article does say If you want to ensure it is loaded at the earliest possible occasion, or are noticing startup issues
So I’d say if just setting nvidia-drm.modeset=1 works for you, leave it at that.
IMHO the fewer deviations from stock install the better - fewer issues to consider when things go wrong.
On my System, i MUST early load the nvidia modules, because i have in my Systems 2x nvidia 1080ti’s and 1x AMD wx3200, if i want to use one of the nvidia card.
In my System it is the case, that the AMD Driver/module get faster loaded/started as the nvidia cards. And if this happens, X and the Displaymanager grabs the AMD Card. If i specify in my mkinitcpio.conf that i want to early load the nvidia modules, than the nvidia got grabed first. Dunno why.
In my case for example, nvidia-drm.modeset=1 is contraproductive. because if i set that, i cant start any game anymore because the most games outputs an error that they couldnt load the default gpu.
This is what i have observed on my system.
But in my normal usecase, i blacklist every nvidia driver and pass the nvidia gpus to vfio to use them in various VMs.
So, there isnt a standard answer wich is right for every system. It entirely depends what hardware do you have, and how many modules you use. Than sometimes it could be necessary to put nvidia in first place, to be sure that it actually is loaded.
It seems adding the modules to initramfs is the recommended way after all. Barring complicated setups like lunavictum’s above, on modern SSD and NVMe drives it’s best to have those modules in mkinitcpio.conf to minimize the chance of a race condition, where graphical subsystem inititalizes before the GPU driver.