# Understanding nvidia-drm.modeset=1 (NVIDIA Linux driver modesetting)

**URL:** <https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068>\
**Category:** Linux\
**Created:** [February 21, 2022, 10:26pm UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068 "2022-02-21T22:26:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![birdie](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/birdie/32/10073_2.png) [@birdie](https://forums.developer.nvidia.com/u/birdie)\
**Post date:** [February 21, 2022, 10:26pm UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/1 "2022-02-21T22:26:13Z")

</div>

I have a desktop PC with the only GPU which is NVIDIA’s 1660 Ti.

I’ve enabled modesetting via

```
/etc/modprobe.d/nvidia.conf                                                                                                                                                                                                          
options nvidia-drm modeset=1

```

However I don’t feel or see any difference. My text terminal is still running its initial EFI resolution (I guess it’s 720p or something - hard to say), it takes a few seconds to switch between an [X.org](http://X.org) session and text console.

```
/proc/fb
0 simple

```

and dmesg says:

```auto
Console: colour dummy device 80x25
printk: console [tty0] enabled
pci 0000:08:00.0: vgaarb: setting as boot VGA device
pci 0000:08:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
pci 0000:08:00.0: vgaarb: bridge control possible
vgaarb: loaded
simple-framebuffer simple-framebuffer.0: framebuffer at 0xe1000000, 0x300000 bytes
simple-framebuffer simple-framebuffer.0: format=a8r8g8b8, mode=1024x768x32, linelength=4096
fbcon: Deferring console take-over
simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!
fbcon: Taking over console
Console: switching to colour frame buffer device 128x48
systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
nvidia: loading out-of-tree module taints kernel.
nvidia: module license 'NVIDIA' taints kernel.
nvidia-nvlink: Nvlink Core is being initialized, major device number 248
nvidia 0000:08:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
NVRM: loading NVIDIA UNIX x86_64 Kernel Module 510.47.03 Mon Jan 24 22:58:54 UTC 2022
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 510.47.03 Mon Jan 24 22:51:43 UTC 2022
[drm] [nvidia-drm] [GPU ID 0x00000800] Loading driver
caller os_map_kernel_space.part.0+0x6d/0x90 [nvidia] mapping multiple BARs
[drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:08:00.0 on minor 0

```

The only difference is that I now cannot unload the nvidia kernel module which was possible before.

What am I doing wrong or misunderstanding? I thought the text console would switch to my native monitor resolution and switching between it and [X.org](http://X.org) will be near instant.

The kernel seemingly supports all the required features:

```auto
$ grep CONFIG_DRM config | egrep -v "^#"
CONFIG_DRM=y
CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=300
CONFIG_DRM_PANEL=y
CONFIG_DRM_BRIDGE=y
CONFIG_DRM_PANEL_BRIDGE=y
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

```

I’m **not** using initrd/initramfs.

Found this post: [Kernel mode setting does not work in CONSOLE mode under linux - #4 by aplattner](https://forums.developer.nvidia.com/t/kernel-mode-setting-does-not-work-in-console-mode-under-linux/52745/4) is it still relevant? It’s kinda sad if it is.

And then there’s SIMPLEDRM which should work and I’m getting lost: [510.39.01 on 5.16.0 kernel green screen - #19 by BCS](https://forums.developer.nvidia.com/t/510-39-01-on-5-16-0-kernel-green-screen/200476/19)

It’s not enabled for my Linux config.

---

<div class="post-metadata">

**Author:** ![generix](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/generix/32/16024_2.png) [@generix](https://forums.developer.nvidia.com/u/generix)\
**Post date:** [February 23, 2022, 10:43am UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/2 "2022-02-23T10:43:06Z")

</div>

(Talking about x86 here, keep in mind other arches exist)  
The console/VT is still the old linux framebuffer console (fbcon)  
[https://www.kernel.org/doc/html/latest/fb/fbcon.html](https://www.kernel.org/doc/html/latest/fb/fbcon.html)  
which runs on a simple framebuffer device (fbdev).  
The fbdev would usually be provided by the bios’ vga or efi framebuffer (over some in-kernel fb driver).  
DRM drivers have the possibility to provide a drm based fbdev emulation, like in i915:  
[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/i915/display/intel\_fbdev.c?h=v5.17-rc5](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/i915/display/intel_fbdev.c?h=v5.17-rc5)  
Which can be turned on/off by CONFIG\_DRM\_FBDEV\_EMULATION=y  
[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/i915/display/intel\_fbdev.h?h=v5.17-rc5](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/i915/display/intel_fbdev.h?h=v5.17-rc5)  
NB: the kconfig setting does not provide a general drm fbdev emulation but only enables it in the gpu specific drm driver, if available. You’ll then see in dmesg:

> fb0: switching to inteldrmfb from EFI VGA

The nvidia drm driver does not provide a drm fbdev emulation so the fbcon will stay on e.g. efifb.  
In general, there are more-or-less ongoing works/rfcs over the past decade or so to get rid of fbdev/fbcon/CONFIG\_VT altogether and replace them with something drm only. Some recent discussion, which provides a good insight:  
[https://patchwork.kernel.org/project/linux-fbdev/cover/20210827100027.1577561-1-javierm@redhat.com/#24417083](https://patchwork.kernel.org/project/linux-fbdev/cover/20210827100027.1577561-1-javierm@redhat.com/#24417083)

simpledrm is rather the opposite of this, it provides a minimal drm driver running on the bios provided framebuffer (EFI/VGA) to have a fallback driver for wayland in case no gpu specific drm driver is available. See it as a vesa driver for wayland.

---

<div class="post-metadata">

**Author:** ![aplattner](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aplattner/32/14043_2.png) [@aplattner](https://forums.developer.nvidia.com/u/aplattner)\
**Post date:** [February 24, 2022, 12:03am UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/3 "2022-02-24T00:03:47Z")

</div>

Setting `modeset=1` doesn’t actually install a framebuffer console. All it really does is enable the `DRIVER_MODESET` capability flag in the nvidia-drm devices so that DRM clients can use the various modesetting APIs. In addition to allowing clients that talk to the low-level DRM interface to work, it’s also necessary for some PRIME-related interoperability features.

The downside, if you want to call it that, is that loading nvidia-drm with `modeset=1` causes it to configure and initialize all GPUs immediately rather than waiting for a client to open the `/dev/nvidia*` device files. This means that some options that require a userspace application to configure them before the GPUs are initialized won’t work if they were already configured by nvidia-drm. The big example at the moment is SLI Mosaic, which is enabled by the X driver if /etc/X11/xorg.conf says it should be.

---

<div class="post-metadata">

**Author:** ![generix](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/generix/32/16024_2.png) [@generix](https://forums.developer.nvidia.com/u/generix)\
**Post date:** [February 24, 2022, 7:50am UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/4 "2022-02-24T07:50:04Z")

</div>

> [@aplattner](#):
>
> The big example at the moment is SLI Mosaic, which is enabled by the X driver if /etc/X11/xorg.conf says it should be.

Which should also be noted in the Mosaic chapter of the manual since often this happens:  
[https://forums.developer.nvidia.com/t/i-can-no-longer-can-set-up-a-system-with-cloned-mirrored-monitors-using-2-quadro-k420-cards/204359?u=generix](https://forums.developer.nvidia.com/t/i-can-no-longer-can-set-up-a-system-with-cloned-mirrored-monitors-using-2-quadro-k420-cards/204359)  
It’s noted in the drm kms chapter but nobody that’s affected finds it there.

---

<div class="post-metadata">

**Author:** ![birdie](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/birdie/32/10073_2.png) [@birdie](https://forums.developer.nvidia.com/u/birdie)\
**Post date:** [February 24, 2022, 6:54pm UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/5 "2022-02-24T18:54:24Z")

</div>

@aplattner

Thanks!

Are there any plans (I know I know you cannot talk about the future) to enable fb emulation in NVIDIA drivers, so that I could run my text console at a native resolution?

BTW, I’ve still noticed a single positive change: resume is now quite faster. Previously it took 2-3 seconds, now I get my Xorg’s unlock screen almost instantly after I resume. I wonder if it’s real or I’m imagining things.

---

<div class="post-metadata">

**Author:** ![birdie](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/birdie/32/10073_2.png) [@birdie](https://forums.developer.nvidia.com/u/birdie)\
**Post date:** [February 24, 2022, 6:55pm UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/6 "2022-02-24T18:55:08Z")

</div>

Can’t mark two replies as answers so I’ll just say big thank you!

---

<div class="post-metadata">

**Author:** ![aplattner](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aplattner/32/14043_2.png) [@aplattner](https://forums.developer.nvidia.com/u/aplattner)\
**Post date:** [February 24, 2022, 7:20pm UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/7 "2022-02-24T19:20:04Z")

</div>

Not currently, since installing a framebuffer console pins the kernel modules so they can’t be unloaded. We still (for better or worse) support shutting down GPU clients, unloading the kernel modules, installing a different driver, and starting everything back up without rebooting. If nvidia-drm is always in use because it’s driving a framebuffer console, then that won’t work.

It’s theoretically possible to remove the framebuffer console device in order to unload nvidia-drm.ko, but there’s no mechanism for the system to switch back to something like simplefb or efifb so the console just goes blank if you do that.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [March 10, 2022, 7:20pm UTC](https://forums.developer.nvidia.com/t/understanding-nvidia-drm-modeset-1-nvidia-linux-driver-modesetting/204068/8 "2022-03-10T19:20:33Z")

</div>

Closed on March 10, 2022, 7:20pm UTC

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