When to use early loading DRM (Direct Rendering Manager) kernel mode setting for NVIDIA?

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.

My feeling is that these steps are not generally necessary, for instance I have nvidia-drm.modeset=1 set in my grub already, without having to do anything special.

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.

1 Like

In my opinion, it is easier to handle if you only add it to grubs kernel line.
And if it works for you… no need to complicate your configs :wink:

I haven’t done any testing on this but I have read it is needed if you are using plymouth.

That being said, I don’t currently have any nvidia Linux installs running so I am not sure if nvidia-drm.modeset=1 also solves this problem.

Harhar. This is easy to answer: It depends.

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.


That is a long winded way of saying If you want to ensure it is loaded at the earliest possible occasion, or are noticing startup issues

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.

See my posts on NVIDIA and Arch forums.


Thanks for doing the digging and thus enlightening me.

:thinking: Interesting, thanks for sharing your findings.

My pleasure :slight_smile: @daab @lucidae

This has been my thought also.

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