Ubuntu 21.10 - "Failed to grab modeset ownership" with 495.44

Plus one more (and bit wired observation). When it hangs pressing RESET button on chase does not reset box - fans starts to spin like during initial boot and that’s all - (once I’ve got impression like there was something like monitor entering black mode). I need to power off and on box. I’m really very puzzled with the recent finding. Checked pressing RESET from X session and it works correctly,

Does anyone have a workable procedure for avoiding this bug until NVidia can nail down and fix? Revert to previous version of driver? I have not changed my hardware, and things ran fine on previous OS/driver versions. Now I have severe performance degradation, memory leaks, abound, and need to reboot several times per day. I used to run this hardware configuration without swap, without needing swap, and now I’m out of ram running only basic Desktop apps and no heavy graphical programs such as games. The state of things now is completely intolerable.

dmesg promised above

PS: I use driver version 470.86 as appropriate for the 780Ti

I’ve now been running with

  • Ubuntu 21.10 with mainline 5.15.12-051512-generic
  • intel_iommu=on
  • NVIDIA Driver Version: 495.46

It has been 3 days, I am yet to see a modset error… I’ll continue to monitor.

I have AMD processor (Ryzen 3 3200G, but I don’t use built in graphics). Perhaps this depends on other components.
I have Asus PRIME X470-PRO ATX motherboard

I also had nvidia.modeset=1 as a kernel parameter. This parameter is both necessary for Wayland, and for the error to occur.
The error occurs after each boot, I do not have to wait for that at all.

I have discovered that one particularly detrimental setting to performance on my machine was the EHCI handoff support being set to on in my motherboard’s bios, when it should have been off. No word on whether this fixes the problem as I changed to 450-server Ubuntu package to avoid the bug discussed in this thread.

HI All,
The warning message is expected. When a client (such as the modesetting driver) attempts to open our DRM device node while modesetting permission is already acquired by something else (like the NVIDIA X driver), it has to fail, but the kernel won’t let us return a failure after v5.9-rc1, so we print this message. It won’t impact functionality of the NVIDIA X driver that already has modesetting permission. Safe to ignore as long as long as you didn’t need the other client to actually get modesetting permission. If you want to suppress the error, you would need to find which client is attempting to open the NVIDIA DRM device node and prevent it from doing so.

2 Likes

Don’t know if could be related, but with same issue of modesetting with kernel 5.15.16 when at the same time are registered crashes with kwin after login with sddm.
I’m using Gentoo distribution with a personal profile based on latest stable branch and this kind of crashes happen randomly. This is happening for a long time, so maybe a concurrency bug?
Associated bug report for KDE:
https://bugs.kde.org/show_bug.cgi?id=448968

Could you share what is the likely candidate or give some tips where to report it?

Not a solution, but a workaround.
After boot, when all I get is a black screen:

  1. Switch to console (Ctrl-Alt-F1) and login as root
  2. init 3 # shut down X
  3. init 5 # restart X
  4. Switch back to graphical login (Ctrl-Alt-F7)

Works for me on openSUSE Tumbleweed.

I have the same issue, wondered what was causing it until I ran into this accidentally … top often also shows nvidia-modeset taking 2% cpu usage endlessly

In some cases opening the mode setting device may be intentional. As example when we have HMD ( Head mount display). I got this error message with SteamVr and with UnrealEditor with openXR Monado-service.

In Ubuntu 20.04 X server crashes with nvidia-driver-510 and nvidia-driver-495 when i start SteamVR with this message on dmesg console. Only combination that i have got working is nvidia-driver-470 with HMD mapped as Option “AllowHMD” “yes”

I had this issue appear when I disabled the iGPU (i965) to test Wayland on my machine. Turns out, it went away went I re-enabled the iGPU in the BIOS, and booted back to X11.

I have the same problem. My gui is affected by it ie. pixelated and flickering screen. If you google the issue, it seems to be quite common. It would be nice to have a real solution as opposed to some hand waving …

I get “[drm:nv_drm_master_set [nvidia_drm]] ERROR [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership” when trying to suspend ubuntu 20.04 and it won’t suspend it simply shows the login screen

I updated ubuntu yesterday and this porblem is gone. I couldn’t suspend my laptop before or even change my screen brightness, now all of a suden everything works as expected. Here’s some info, perhaps it might help

>>> lsb_release -a
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal


>>> uname -a
Linux Hostname 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux


>>> dpkg -l | grep nvidia
ii  libnvidia-cfg1-515:amd64                      515.48.07-0ubuntu1                         amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-515                          515.48.07-0ubuntu1                         all          Shared files used by the NVIDIA libraries
rc  libnvidia-compute-510:amd64                   510.60.02-0ubuntu0.20.04.2                 amd64        NVIDIA libcompute package
rc  libnvidia-compute-510-server:amd64            510.73.05-0ubuntu0.20.04.1                 amd64        NVIDIA libcompute package
ii  libnvidia-compute-515:amd64                   515.48.07-0ubuntu1                         amd64        NVIDIA libcompute package
ii  libnvidia-compute-515:i386                    515.48.07-0ubuntu1                         i386         NVIDIA libcompute package
ii  libnvidia-container-tools                     1.10.0-1                                   amd64        NVIDIA container runtime library (command-line tools)
ii  libnvidia-container1:amd64                    1.10.0-1                                   amd64        NVIDIA container runtime library
ii  libnvidia-decode-515:amd64                    515.48.07-0ubuntu1                         amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-515:i386                     515.48.07-0ubuntu1                         i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-515:amd64                    515.48.07-0ubuntu1                         amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-515:i386                     515.48.07-0ubuntu1                         i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-515:amd64                     515.48.07-0ubuntu1                         amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-515:amd64                      515.48.07-0ubuntu1                         amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-515:i386                       515.48.07-0ubuntu1                         i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-515:amd64                        515.48.07-0ubuntu1                         amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-515:i386                         515.48.07-0ubuntu1                         i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ml-dev                              10.1.243-3                                 amd64        NVIDIA Management Library (NVML) development files
rc  nvidia-compute-utils-510-server               510.73.05-0ubuntu0.20.04.1                 amd64        NVIDIA compute utilities
ii  nvidia-compute-utils-515                      515.48.07-0ubuntu1                         amd64        NVIDIA compute utilities
ii  nvidia-container-toolkit                      1.10.0-1                                   amd64        NVIDIA container runtime hook
ii  nvidia-cuda-dev                               10.1.243-3                                 amd64        NVIDIA CUDA development files
rc  nvidia-dkms-510-server                        510.73.05-0ubuntu0.20.04.1                 amd64        NVIDIA DKMS package
ii  nvidia-dkms-515                               515.48.07-0ubuntu1                         amd64        NVIDIA DKMS package
ii  nvidia-docker2                                2.11.0-1                                   all          nvidia-docker CLI wrapper
ii  nvidia-driver-515                             515.48.07-0ubuntu1                         amd64        NVIDIA driver metapackage
rc  nvidia-kernel-common-510-server               510.73.05-0ubuntu0.20.04.1                 amd64        Shared files used with the kernel module
ii  nvidia-kernel-common-515                      515.48.07-0ubuntu1                         amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-515                      515.48.07-0ubuntu1                         amd64        NVIDIA kernel source package
ii  nvidia-modprobe                               515.48.07-0ubuntu1                         amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-prime                                  0.8.16~0.20.04.2                           all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                               515.48.07-0ubuntu1                         amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-515                              515.48.07-0ubuntu1                         amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                       0.18build1                                 all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-515                 515.48.07-0ubuntu1                         amd64        NVIDIA binary Xorg driver


>>> dmesg | grep nvidia
...
[19419.742319] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
...


>>> tail /var/log/apt/history.log
Start-Date: 2022-07-13  14:37:51
Commandline: apt upgrade
Install: linux-hwe-5.15-headers-5.15.0-41:amd64 (5.15.0-41.44~20.04.1, automatic), linux-image-5.15.0-41-generic:amd64 (5.15.0-41.44~20.04.1, automatic), linux-modules-extra-5.15.0-41-generic:amd64 (5.15.0-41.44~20.04.1, automatic), linux-modules-5.15.0-41-generic:amd64 (5.15.0-41.44~20.04.1, automatic), linux-headers-5.15.0-41-generic:amd64 (5.15.0-41.44~20.04.1, automatic)
Upgrade: linux-headers-generic-hwe-20.04:amd64 (5.13.0.52.59~20.04.31, 5.15.0.41.44~20.04.13), xserver-common:amd64 (2:1.20.13-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.3), xserver-xorg-core:amd64 (2:1.20.13-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.3), xserver-xorg-legacy:amd64 (2:1.20.13-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.3), linux-image-generic-hwe-20.04:amd64 (5.13.0.52.59~20.04.31, 5.15.0.41.44~20.04.13), linux-generic-hwe-20.04:amd64 (5.13.0.52.59~20.04.31, 5.15.0.41.44~20.04.13), xserver-xephyr:amd64 (2:1.20.13-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.3), xwayland:amd64 (2:1.20.13-1ubuntu1~20.04.2, 2:1.20.13-1ubuntu1~20.04.3), code:amd64 (1.69.0-1657183742, 1.69.1-1657615746), linux-firmware:amd64 (1.187.31, 1.187.32)

Hi, PLEASE I NEED HELP
i have a the same problem with Ubuntu 18.04 and NVIDIA Gforce 3060 (Dirver 515.48.07)
When i start videos with 60 fps, the PC crush and reboot after 2 or 3 minutes.
using vi /var/log/kern.log
i detect this error just before the crush :
[drm:nv_drm_master_set [nvidia_drm]] ERROR [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Please my project is blocked and waiting a solution
Please Help

I have also this issue

Aug 21 00:12:39 donutloop kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Aug 21 00:12:39 donutloop kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Aug 21 00:12:39 donutloop kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Aug 21 00:12:39 donutloop kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership

Exactly same issue here.

$ sudo dmesg -T | grep nvidia
[Sat Oct 15 17:49:04 2022] Command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-50-generic root=UUID=0bf4fa89-a3c7-4f77-ab88-d1c8493705f1 ro quiet splash nvidia-drm.modeset=1 vt.handoff=7
[Sat Oct 15 17:49:04 2022] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-50-generic root=UUID=0bf4fa89-a3c7-4f77-ab88-d1c8493705f1 ro quiet splash nvidia-drm.modeset=1 vt.handoff=7
[Sat Oct 15 17:49:36 2022] nvidia: loading out-of-tree module taints kernel.
[Sat Oct 15 17:49:36 2022] nvidia: module license ‘NVIDIA’ taints kernel.
[Sat Oct 15 17:49:36 2022] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[Sat Oct 15 17:49:36 2022] nvidia-nvlink: Nvlink Core is being initialized, major device number 511
[Sat Oct 15 17:49:36 2022] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[Sat Oct 15 17:49:37 2022] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 520.61.05 Thu Sep 29 05:29:37 UTC 2022
[Sat Oct 15 17:49:37 2022] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[Sat Oct 15 17:49:38 2022] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
[Sat Oct 15 17:49:43 2022] audit: type=1400 audit(1665836383.666:2): apparmor=“STATUS” operation=“profile_load” profile=“unconfined” name=“nvidia_modprobe” pid=984 comm=“apparmor_parser”
[Sat Oct 15 17:49:43 2022] audit: type=1400 audit(1665836383.666:3): apparmor=“STATUS” operation=“profile_load” profile=“unconfined” name=“nvidia_modprobe//kmod” pid=984 comm=“apparmor_parser”
[Sat Oct 15 17:56:51 2022] [drm:nv_drm_master_set [nvidia_drm]] ERROR [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership

$ cat /etc/issue
Ubuntu 22.04.1 LTS \n \l

$ uname -r
5.15.0-50-generic
$ cat /sys/module/nvidia/version
520.61.05

$ nvidia-smi
Sat Oct 15 18:06:06 2022
±----------------------------------------------------------------------------+
| NVIDIA-SMI 520.61.05 Driver Version: 520.61.05 CUDA Version: 11.8 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce … Off | 00000000:01:00.0 On | N/A |
| 28% 44C P0 24W / 100W | 56MiB / 4096MiB | 1% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 2101 G /usr/lib/xorg/Xorg 55MiB |
±----------------------------------------------------------------------------+

Disabled Wayland as suggested by some forums. Still the same problem.

Here is my X11 configuration:
$ cat /etc/X11/xorg.conf

nvidia-xconfig: X configuration file generated by nvidia-xconfig

nvidia-xconfig: version 520.61.05

nvidia-settings: X configuration file generated by nvidia-settings

nvidia-settings: version 510.47.03

Section “ServerLayout”
Identifier “Layout0”
Screen 0 “Screen0” 0 0
InputDevice “Keyboard0” “CoreKeyboard”
InputDevice “Mouse0” “CorePointer”
Option “Xinerama” “0”
EndSection

Section “Files”
EndSection

Section “InputDevice”

# generated from default
Identifier     "Mouse0"
Driver         "mouse"
Option         "Protocol" "auto"
Option         "Device" "/dev/psaux"
Option         "Emulate3Buttons" "no"
Option         "ZAxisMapping" "4 5"

EndSection

Section “InputDevice”

# generated from default
Identifier     "Keyboard0"
Driver         "kbd"

EndSection

Section “Monitor”
Identifier “Monitor0”
VendorName “Unknown”
ModelName “Samsung S23B370”
HorizSync 30.0 - 81.0
VertRefresh 50.0 - 75.0
Option “DPMS”
EndSection

Section “Device”
Identifier “Device0”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “NVIDIA GeForce GTX 1650 SUPER”
EndSection

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
Option “Stereo” “0”
Option “nvidiaXineramaInfoOrder” “DFP-1”
Option “metamodes” “1920x1080_60 +0+0”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection

$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 36 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Vendor ID: GenuineIntel
Model name: Intel(R) Core™ i7-3770 CPU @ 3.40GHz
CPU family: 6
Model: 58
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
Stepping: 9
CPU max MHz: 3900.0000
CPU min MHz: 1600.0000
BogoMIPS: 6819.74
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush d
ts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_per
fmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq
dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2a
pic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb p
ti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
xsaveopt dtherm ida arat pln pts md_clear flush_l1d
Virtualization features:
Virtualization: VT-x
Caches (sum of all):
L1d: 128 KiB (4 instances)
L1i: 128 KiB (4 instances)
L2: 1 MiB (4 instances)
L3: 8 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-7
Vulnerabilities:
Itlb multihit: KVM: Mitigation: VMX disabled
L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Meltdown: Mitigation; PTI
Mmio stale data: Not affected
Retbleed: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
, PBRSB-eIBRS Not affected
Srbds: Vulnerable: No microcode
Tsx async abort: Not affected

Motherboard: Asus P8Z77-V PRO
Graphics card: Asus TUF Gaming Geforce GT 1650 Super

I have already tried different drivers (default 515 driver by Ubuntu 22.04, nvidia 515 driver, nvidia 520 driver). Issue persists. Display does not refresh and has black screen for most of the part.

I have removed all the Ubuntu shipped nvidia drivers as I hit nvidia_uvm undefined symbol issue.

$ dpkg -l | grep nvidia-5.15
ii linux-signatures-nvidia-5.15.0-48-generic 5.15.0-48.54 amd64 Linux kernel signatures for nvidia modules for version 5.15.0-48-generic
ii linux-signatures-nvidia-5.15.0-50-generic 5.15.0-50.56+1 amd64 Linux kernel signatures for nvidia modules for version 5.15.0-50-generic

Please help.

( Ubuntu 22.04.1 Nvidia 525.60.11 Kernel: 5.15.0-56-generic )

I have the line “options nvidia-drm modeset=1” in three files:

grep --include=*.conf -rnw ‘/’ -e “nvidia-drm” 2>/dev/null

“/usr/lib/modprobe.d/nvidia-kms.conf:3:options nvidia-drm modeset=1
“/etc/modprobe.d/nvidia-graphics-drivers-kms.conf:3:options nvidia-drm modeset=1
“/etc/modprobe.d/nvidia-nomodset.conf:1:options nvidia-drm modeset=1

If the lines are commented out, the error message disappears.
If you leave this uncommented in at least one of the files, the error message will appear again.

1 Like

I have the same issue in Debian when I’m using gdm and Gnome with ASUS TUF F17 (Nvidia 3060):

  • Error printed by dmesg: [drm:drm_new_set_master [drm]] ERROR [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
  • Fans are working differently (the laptop overheats more these days before how it was before and I’m not doing anything more CPU or GPU intensive than before)
  • When I change to console and back to graphics, keyboards are no longer working (CTRL+SHIFT+F1, CTRL+SHIFT+F2, CTRL+SHIFT+F3, …)
  • Output printed by the command: grep --include=*.conf -rnw ‘/’ -e “nvidia-drm” 2>/dev/null
    also mentions those options but in another configuration file:
    /etc/modprobe.d/supergfxd.conf:6:options nvidia-drm modeset=1

Commenting out that line fixed it for me, I checked and it worked. Good answer freeavagames.

3 Likes