open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

nvidia_drm defaulting to modeset=0 causes DRM master contention on hybrid NVIDIA+AMD laptops

Open wintrover opened this issue 6 months ago • 2 comments

NVIDIA Open GPU Kernel Modules Version

All versions (observed on 595.71.05)

Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.

  • [x] I confirm that this does not happen with the proprietary driver package.

Operating System and Version

Linux Mint 22 (Ubuntu 24.04-based), also reproducible on Fedora 41, Arch Linux

Kernel Release

Linux 6.17.0-29-generic x86_64

Please confirm you are running a stable kernel release (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • [x] I am running on a stable kernel release.

Hardware: GPU

NVIDIA RTX 3060 Laptop GPU (GA106M) + AMD Radeon Vega (integrated) ASUS ROG Zephyrus G14 (GA401QM)

Describe the bug

Summary: The nvidia_drm kernel module defaults to modeset=0, which prevents the module from registering with the Linux DRM/KMS subsystem. On hybrid NVIDIA+AMD laptop configurations (dGPU + iGPU), this causes DRM master contention: when the NVIDIA dGPU is loaded but has modesetting disabled, it still claims DRM master, preventing the AMD iGPU from rendering hardware cursor sprites.

Observed behavior:

  • Xorg logs show: drmSetMaster failed: Device or resource busy
  • Cursor disappears when moving between monitors attached to different GPUs
  • 3-monitor vertical stack configuration shows cursor vanishing on specific monitor transitions

Expected behavior:

  • When nvidia_drm is loaded with modeset=0 (default), it should not claim DRM master, allowing the other GPU (AMD iGPU) to handle modesetting without contention.
  • OR: the module should default to modeset=1 on hybrid/multi-GPU systems, or auto-detect multi-GPU configurations.

To Reproduce

  1. Install NVIDIA open kernel modules on a hybrid NVIDIA+AMD laptop (e.g., ASUS ROG Zephyrus G14)
  2. Do NOT add nvidia_drm.modeset=1 to kernel parameters
  3. Configure a multi-monitor setup spanning both GPUs
  4. Move cursor between monitors -> cursor disappears on certain transitions
  5. Check Xorg logs: drmSetMaster failed: Device or resource busy

Workaround

Add the following kernel parameters: nvidia_drm.modeset=1 nvidia_drm.fbdev=1

Or create /etc/modprobe.d/nvidia-drm.conf: options nvidia_drm modeset=1 options nvidia_drm fbdev=1

Then run update-grub && update-initramfs -u and reboot.

Bug Incidence

Constant on hybrid configurations

Additional context

Impact: Affects all hybrid NVIDIA+AMD laptop users who don't know they need to manually set nvidia_drm.modeset=1. This is a common pitfall documented on Arch Wiki, Ubuntu forums, and various Linux community guides.

Relevant official NVIDIA documentation: Chapter 36 DRM KMS: https://download.nvidia.com/XFree86/Linux-x86_64/570.133.07/README/kms.html

Suggested fix: Either:

  1. Change the default value of modeset from 0 to 1 in the nvidia_drm module
  2. Or implement auto-detection: if another GPU (non-NVIDIA) is active in the system, enable modeset automatically
  3. Or at minimum: document this requirement prominently in the kernel module parameters documentation

wintrover avatar May 26 '26 04:05 wintrover

Update: After testing, the nvidia_drm.modeset=1 workaround works on initial cold boot but the issue RECURS after a suspend/resume cycle. On resume, the AMD GPU fails drmSetMaster (2 consecutive failures in Xorg log), and nvidia_drm also fails with 'Failed to get memory pages for NvKmsKapiMemory'. This suggests the DRM master re-negotiation during resume creates a race condition between NVIDIA and AMD in the hybrid GPU topology.

The complementary workaround is to force software cursor on the AMD GPU via Xorg config: /etc/X11/xorg.conf.d/20-swcursor.conf: Section "Device" Identifier "AMD" Driver "modesetting" Option "SWCursor" "true" EndSection

This bypasses the hardware cursor plane entirely, making cursor rendering immune to DRM master state.

Combined fix: nvidia_drm.modeset=1 + SWCursor on AMD = works across cold boot AND suspend/resume.

wintrover avatar May 26 '26 06:05 wintrover

Update: The nvidia_drm.fbdev=1 parameter caused Cinnamon/Xorg to freeze on boot on this ASUS G14 (Linux Mint, hybrid AMD+NVIDIA). This aligns with NVIDIA's own warning in the Wayland Known Issues appendix about fbdev=1 conflicting with simpledrm.

Revised recommendation:

  1. nvidia_drm.modeset=1 only (NOT fbdev=1) - enables DRM KMS for PRIME sync
  2. Skip fbdev=1 unless simpledrm conflicts are actually observed
  3. Combined with SWCursor on AMD GPU for suspend/resume resilience

Original proposed fix with fbdev=1 was overly aggressive and caused boot failure.

wintrover avatar May 26 '26 07:05 wintrover