Xorg failed to create screen resources after enabling nvidia_drm.modeset

Hello, I am using an optimus laptop with a GTX 1060 using the proprietary drivers. I need to use nvidia_drm to make external screen work on Wayland (using KDE 5.27). To enable it, I simply added nvidia_drm.modeset=1 to the kernel parameters.

But after setting this parameter, I can’t reach SDDM anymore, it stays on a black screen with a blinking console cursor. If I switch to a TTY and type startx, I get the error (EE) failed to create screen resources(EE).

Wayland works just fine, I can switch to a TTY and type startplasma-wayland to boot up a wayland session, and external monitors work thanks to the nvidia_drm.

I looked through the arch wiki at NVIDIA/Troubleshooting and tried adding



Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
EndSection

to /etc/X11/xorg.conf.d/10-nvidia.conf

I also tried adding

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

to /usr/share/sddm/scripts/Xsetup as explained in the arch wiki at /NVIDIA_Optimus but still no luck.

I don’t really care about X11 as Wayland can replace it for everything I need. I can always disable nvidia_drm and start the x session if I ever need it. Using a workaround to at least make SDDM work would be fine.

Anyone could help me on this please? (I know, yet another nvidia optimus issue…)

Specs:
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.10-1-MANJARO (64-bit)
Processors: 4 × Intel® Core™ i5-7300HQ CPU @ 2.50GHz
Memory: 15,5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 630
Intel driver: Mesa 23.0.2
Nvidia driver: 530.41.03

Welcome to the forum! :wave:

Please post your system info as outlined here:

Please also post the output of:

xrandr

and

cat /etc/X11/mhwd.d/nvidia.conf

Here is some more information. Please tell me if you need something else.

inxi -v7azy (trimmed to keep only relevant info)

System:
  Kernel: 6.2.10-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
  Desktop: KDE Plasma v: 5.27.4 tk: Qt v: 5.15.8 wm: kwin_wayland vt: 2
    dm: SDDM Distro: Manjaro Linux base: Arch Linux
CPU:
  Info: model: Intel Core i5-7300HQ bits: 64 type: MCP arch: Kaby Lake
    gen: core 7 level: v3 note: check built: 2018 process: Intel 14nm family: 6
    model-id: 0x9E (158) stepping: 9 microcode: 0xF0

Graphics part on a wayland session without nvidia_drm:

Graphics:
  Device-1: Intel HD Graphics 630 vendor: Lenovo driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
    empty: none bus-ID: 00:02.0 chip-ID: 8086:591b class-ID: 0300
  Device-2: NVIDIA GP106M [GeForce GTX 1060 Mobile] vendor: Lenovo
    driver: nvidia v: 530.41.03 alternate: nouveau,nvidia_drm non-free: 530.xx+
    status: current (as of 2023-03) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1c20 class-ID: 0300
  Device-3: Bison EasyCamera type: USB driver: uvcvideo bus-ID: 1-6:3
    chip-ID: 5986:06b0 class-ID: 0e02 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.1
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa dri: iris gpu: i915,nvidia display-ID: 0
  Monitor-1: eDP-1 res: 1280x720 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 23.0.2 renderer: Mesa Intel HD Graphics 630 (KBL
    GT2) direct-render: Yes

Same with nvidia_drm:

Graphics:
  Device-1: Intel HD Graphics 630 vendor: Lenovo driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
    empty: none bus-ID: 00:02.0 chip-ID: 8086:591b class-ID: 0300
  Device-2: NVIDIA GP106M [GeForce GTX 1060 Mobile] vendor: Lenovo
    driver: nvidia v: 530.41.03 alternate: nouveau,nvidia_drm non-free: 530.xx+
    status: current (as of 2023-03) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s ports: active: none empty: DP-1,DP-2,HDMI-A-1 bus-ID: 01:00.0
    chip-ID: 10de:1c20 class-ID: 0300
  Device-3: Bison EasyCamera type: USB driver: uvcvideo bus-ID: 1-6:3
    chip-ID: 5986:06b0 class-ID: 0e02 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.1
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: nvidia
    alternate: fbdev,nouveau,nv,vesa dri: iris,nouveau gpu: i915,nvidia
    display-ID: 0
  Monitor-1: eDP-1 res: 1280x720 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 23.0.2 renderer: Mesa Intel HD Graphics 630 (KBL
    GT2) direct-render: Yes

mhwd -li

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
     video-modesetting            2020.01.13                true            PCI

xrandr

Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1920x1080     60.05*+
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1680x1050     59.95  
   1440x900      60.03  
   1280x800      59.99  
   1152x720      59.97  
   960x600       59.96  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  

/etc/X11/mhwd.d/nvidia.conf is empty.

is nvidia-settings installed ?
check

pacman -Qs nvidia-settings

if not add

sudo pacman -S nvidia-settings

It got removed in latest updated and seeing how useless the settings are I did not reinstall it. Now I have, but still nothing changed.

have you reboot ?

Yes I rebooted and started the settings app in an X11 session, then rebooted again using the nvidia_drm param