Optimus stopped working (failed to create dri2 screen)

Hi everyone,

I had a pretty stable graphics / optimus setup for a while which I have documented here: Sharing experiences with working Nvidia Optimus, HiDPI (4k), Nvidia-Exec, Fractional Scaling on Gnome

However, for a few months optimus has stopped working now. Here is my inxi -G

Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Hewlett-Packard
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: DP-1,
    DP-2, HDMI-A-1, HDMI-A-2, HDMI-A-3 bus-ID: 00:02.0 chip-ID: 8086:3e9b
  Device-2: NVIDIA GP107GLM [Quadro P1000 Mobile] driver: nvidia
    v: 550.107.02 arch: Pascal pcie: speed: 2.5 GT/s lanes: 16 ports:
    active: none empty: DP-3,DP-4,HDMI-A-4 bus-ID: 01:00.0 chip-ID: 10de:1cbb
  Device-3: Chicony HP HD Camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-7:2 chip-ID: 04f2:b5e7
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
    compositor: gnome-shell v: 46.4 driver: X: loaded: nvidia failed: intel
    dri: i965 gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: AU Optronics 0x33eb res: 3840x2160 dpi: 284
    diag: 394mm (15.5")
  API: EGL v: 1.5 platforms: device: 0 drv: iris device: 2 drv: swrast gbm:
    drv: iris surfaceless: drv: iris wayland: drv: iris x11: drv: iris
    inactive: device-1
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.1.6-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel UHD Graphics 630 (CFL
    GT2) device-ID: 8086:3e9b display-ID: :0.0
  API: Vulkan v: 1.3.279 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: nvidia device-ID: 10de:1cbb device: 1
    type: integrated-gpu driver: mesa intel device-ID: 8086:3e9b

I use nvidia-exec to turn my gpu on and off (and turn my pascal nvidia gpu on / off without reboot etc), which worked well in the past, but I don’t think my issue is related to it and maybe more to the intel gpu or acpi. Here is the log when I activate my GPU, in the past this didn’t give me errors. If I plug in my external monitor, my system hangs.

Aug 24 16:00:05 nk-zbook nvx[963]: 2024-08-24 16:00:05,732 [INFO] client connected
Aug 24 16:00:05 nk-zbook nvx[963]: 2024-08-24 16:00:05,733 [INFO] handle on
Aug 24 16:00:05 nk-zbook nvx[963]: 2024-08-24 16:00:05,733 [INFO] turn on
Aug 24 16:00:05 nk-zbook nvx[963]: 2024-08-24 16:00:05,733 [INFO] pci rescan
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: [10de:1cbb] type 00 class 0x030000 PCIe Endpoint
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 0 [mem 0x00000000-0x00ffffff]
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 1 [mem 0x00000000-0x0fffffff 64bit pref]
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 3 [mem 0x00000000-0x01ffffff 64bit pref]
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 5 [io  0x0000-0x007f]
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: ROM [mem 0x00000000-0x0007ffff pref]
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: Max Payload Size set to 256 (was 128, max 256)
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: Enabling HDA controller
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: vgaarb: bridge control possible
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: vgaarb: VGA device added: decodes=io+mem,owns=none,locks=none
Aug 24 16:00:05 nk-zbook kernel: i915 0000:00:02.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=none:owns=io+mem
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.1: [10de:0fb9] type 00 class 0x040300 PCIe Endpoint
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.1: BAR 0 [mem 0x00000000-0x00003fff]
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.1: Max Payload Size set to 256 (was 128, max 256)
Aug 24 16:00:05 nk-zbook kernel: pcieport 0000:00:01.0: ASPM: current common clock configuration is inconsistent, reconfiguring
Aug 24 16:00:05 nk-zbook nvx[963]: 2024-08-24 16:00:05,953 [INFO] pci devices
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 1 [mem 0x80000000-0x8fffffff 64bit pref]: assigned
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 3 [mem 0x90000000-0x91ffffff 64bit pref]: assigned
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 0 [mem 0xe5000000-0xe5ffffff]: assigned
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: ROM [mem 0xe6000000-0xe607ffff pref]: assigned
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.1: BAR 0 [mem 0xe6080000-0xe6083fff]: assigned
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.0: BAR 5 [io  0x4000-0x407f]: assigned
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.1: extending delay after power-on from D3hot to 20 msec
Aug 24 16:00:05 nk-zbook kernel: pci 0000:01:00.1: D0 power state depends on 0000:01:00.0
Aug 24 16:00:05 nk-zbook kernel: snd_hda_intel 0000:01:00.1: enabling device (0000 -> 0002)
Aug 24 16:00:05 nk-zbook kernel: snd_hda_intel 0000:01:00.1: Disabling MSI
Aug 24 16:00:05 nk-zbook kernel: snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client
Aug 24 16:00:05 nk-zbook kernel: snd_hda_intel 0000:01:00.1: Applying patch firmware 'hda-jack-retask.fw'
Aug 24 16:00:05 nk-zbook kernel: input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input36
Aug 24 16:00:05 nk-zbook kernel: input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input37
Aug 24 16:00:05 nk-zbook kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input38
Aug 24 16:00:05 nk-zbook kernel: input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input39
Aug 24 16:00:06 nk-zbook systemd-udevd[460]: /usr/lib/udev/rules.d/69-mixxx-usb-uaccess.rules:61 Unknown group 'uaccess', ignoring.
Aug 24 16:00:06 nk-zbook gnome-shell[2458]: [INFO   ][Another window session manager] Session 745721744.json saved to /home/nils/.config/another-window-session-manager/currentSession/gnome-terminal-server/745721744.json!
Aug 24 16:00:06 nk-zbook snapd[1214]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Aug 24 16:00:06 nk-zbook snapd[1214]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Aug 24 16:00:06 nk-zbook snapd[1214]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Aug 24 16:00:06 nk-zbook snapd[1214]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Aug 24 16:00:06 nk-zbook systemd[1185]: Reached target Sound Card.
Aug 24 16:00:06 nk-zbook nvx[963]: 2024-08-24 16:00:06,378 [INFO] devices: [Config(name: NVIDIA Corporation - GP107GLM [Quadro P1000 Mobile], bus: 0000:01:00.0, bridge: 0000:00:01.0), Config(name: NVIDIA Corporation - GP107GL High Definition Audio Controller, bus: 0000:01:00.1, bridge: 0000:00:01.0)]
Aug 24 16:00:06 nk-zbook nvx[963]: 2024-08-24 16:00:06,378 [INFO] turn on device NVIDIA Corporation - GP107GLM [Quadro P1000 Mobile] - 0000:01:00.0 - 0000:00:01.0
Aug 24 16:00:06 nk-zbook nvx[963]: 2024-08-24 16:00:06,378 [INFO] turn on device NVIDIA Corporation - GP107GL High Definition Audio Controller - 0000:01:00.1 - 0000:00:01.0
Aug 24 16:00:06 nk-zbook nvx[963]: 2024-08-24 16:00:06,378 [INFO] load modules
Aug 24 16:00:06 nk-zbook nvx[963]: 2024-08-24 16:00:06,378 [INFO] load module nvidia_modeset
Aug 24 16:00:07 nk-zbook gnome-shell[2458]: [INFO   ][Another window session manager] Session 745721744.json saved to /home/nils/.config/another-window-session-manager/currentSession/gnome-terminal-server/745721744.json!
Aug 24 16:00:07 nk-zbook kernel: nvidia: module license 'NVIDIA' taints kernel.
Aug 24 16:00:07 nk-zbook kernel: Disabling lock debugging due to kernel taint
Aug 24 16:00:07 nk-zbook kernel: nvidia: module license taints kernel.
Aug 24 16:00:08 nk-zbook kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 509
Aug 24 16:00:08 nk-zbook kernel: 
Aug 24 16:00:08 nk-zbook kernel: nvidia 0000:01:00.0: enabling device (0000 -> 0003)
Aug 24 16:00:08 nk-zbook kernel: nvidia 0000:01:00.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=none:owns=none
Aug 24 16:00:08 nk-zbook kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  550.107.02  Wed Jul 24 23:53:00 UTC 2024
Aug 24 16:00:08 nk-zbook kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  550.107.02  Wed Jul 24 23:24:27 UTC 2024
Aug 24 16:00:08 nk-zbook nvx[963]: 2024-08-24 16:00:08,393 [INFO] result: 0 b''
Aug 24 16:00:08 nk-zbook nvx[963]: 2024-08-24 16:00:08,393 [INFO] load module nvidia_uvm
Aug 24 16:00:09 nk-zbook kernel: nvidia_uvm: module uses symbols nvUvmInterfaceDisableAccessCntr from proprietary module nvidia, inheriting taint.
Aug 24 16:00:09 nk-zbook kernel: nvidia-uvm: Loaded the UVM driver, major device number 507.
Aug 24 16:00:09 nk-zbook nvx[963]: 2024-08-24 16:00:09,476 [INFO] result: 0 b''
Aug 24 16:00:09 nk-zbook nvx[963]: 2024-08-24 16:00:09,476 [INFO] load module nvidia_drm
Aug 24 16:00:09 nk-zbook systemd-udevd[460]: /usr/lib/udev/rules.d/69-mixxx-usb-uaccess.rules:61 Unknown group 'uaccess', ignoring.
Aug 24 16:00:09 nk-zbook kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
Aug 24 16:00:09 nk-zbook gnome-shell[2458]: Failed to hotplug secondary gpu '/dev/dri/renderD129': GDBus.Error:System.Error.ENODEV: No such device
Aug 24 16:00:09 nk-zbook kernel: ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20230628/nsarguments-61)
Aug 24 16:00:10 nk-zbook kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
Aug 24 16:00:10 nk-zbook kernel: nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,242 [INFO] result: 0 b''
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,242 [INFO] load module nvidia
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,246 [INFO] result: 0 b''
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,246 [INFO] load module nouveau
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: libEGL warning: egl: failed to create dri2 screen
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: libEGL warning: egl: failed to create dri2 screen
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: libEGL warning: egl: failed to create dri2 screen
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: Device '/dev/dri/card0' prefers shadow buffer
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: Added device '/dev/dri/card0' (nvidia-drm) using atomic mode setting.
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: g_hash_table_steal_extended: assertion 'hash_table != NULL' failed
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: libEGL warning: egl: failed to create dri2 screen
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: libEGL warning: egl: failed to create dri2 screen
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,279 [INFO] result: 0 b''
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,279 [INFO] pci devices
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: libEGL warning: egl: failed to create dri2 screen
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: Failed to initialize accelerated iGPU/dGPU framebuffer sharing: No EGL display
Aug 24 16:00:10 nk-zbook gnome-shell[2458]: Created gbm renderer for '/dev/dri/card0'
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' high priority at nice level 0.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' RT at priority 20.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' high priority at nice level 0.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' RT at priority 20.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' high priority at nice level 0.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' RT at priority 20.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' high priority at nice level 0.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 2 threads of 2 processes of 1 users.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Successfully made thread 2489 of process 2458 owned by '1000' RT at priority 20.
Aug 24 16:00:10 nk-zbook rtkit-daemon[1447]: Supervising 3 threads of 3 processes of 1 users.
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,634 [INFO] devices: [Config(name: NVIDIA Corporation - GP107GLM [Quadro P1000 Mobile], bus: 0000:01:00.0, bridge: 0000:00:01.0), Config(name: NVIDIA Corporation - GP107GL High Definition Audio Controller, bus: 0000:01:00.1, bridge: 0000:00:01.0)]
Aug 24 16:00:10 nk-zbook nvx[963]: 2024-08-24 16:00:10,634 [INFO] status: on

If you have any pointers it would be super helpful,

Thanks!


Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text