Gnome freezes screen when external monitor is connected

Gnome freezes the screen on my laptop when an external monitor is connected. When it is disconnected, it refreshes the screen. (It worked well before the upgrade to Fedora 44)

It’s an NVIDIA Optimus laptop: GP106M [GeForce GTX 1060 Mobile]

However, it works fine with Plasma, so I assume it is not an NVIDIA problem, but a Mutter problem?

inxi -Fzxx

System:
  Kernel: 7.0.4-200.fc44.x86_64 arch: x86_64 bits: 64 compiler: gcc v: 16.1.1
  Desktop: KDE Plasma v: 6.6.4 tk: Qt v: N/A wm: kwin_wayland dm: GDM
    Distro: Fedora Linux 44 (Workstation Edition)
Machine:
  Type: Laptop System: Micro-Star product: GP63 Leopard 8RE v: REV:1.0
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Micro-Star model: MS-16P5 v: REV:1.0 serial: <superuser required>
    part-nu: 16P5.1 Firmware: UEFI vendor: American Megatrends v: E16P5IMS.106
    date: 04/02/2018
Battery:
  ID-1: BAT1 charge: 34.2 Wh (85.9%) condition: 39.8/53.2 Wh (74.7%)
    volts: 11.97 min: 10.86 model: MSI BIF0_9 serial: N/A charging:
    status: charging cycles: N/A
CPU:
  Info: 6-core model: Intel Core i7-8750H bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 384 KiB L2: 1.5 MiB L3: 9 MiB
  Speed (MHz): avg: 800 min/max: 800/4100 cores: 1: 800 2: 800 3: 800 4: 800
    5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800 bogomips: 52799
  Flags-basic: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Micro-Star MSI
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: none
    bus-ID: 00:02.0 chip-ID: 8086:3e9b
  Device-2: NVIDIA GP106M [GeForce GTX 1060 Mobile] vendor: Micro-Star MSI
    driver: nvidia v: 580.159.03 arch: Pascal pcie: speed: 2.5 GT/s lanes: 16
    ports: active: DP-1,HDMI-A-1 empty: none bus-ID: 01:00.0
    chip-ID: 10de:1c20
  Device-3: Bison HD Webcam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-13:7 chip-ID: 5986:211b
  Device-4: ARC Camera driver: snd-usb-audio,uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-4.4.2:11 chip-ID: 05a3:9331
  Device-5: Microdia Dual Mode Camera (8006 VGA) driver: hid-generic,usbhid
    type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 1-4.4.4:12
    chip-ID: 0c45:8006
  Display: wayland server: X.org v: 1.21.1.22 with: Xwayland v: 24.1.11
    compositor: kwin_wayland driver: gpu: i915,nvidia,nvidia-nvswitch
    d-rect: 5760x1080 display-ID: 0
  Monitor-1: DP-1 pos: primary,left model: BenQ GW2480 res: 1920x1080 hz: 60
    dpi: 93 diag: 604mm (23.8")
  Monitor-2: HDMI-A-1 pos: right model: BenQ GL2480 res: 1920x1080 hz: 60
    dpi: 92 diag: 609mm (24")
  Monitor-3: eDP-1 pos: center model: ChiMei InnoLux 0x15d6 res: 1920x1080
    hz: 60 dpi: 142 diag: 394mm (15.5")
  API: EGL v: 1.5 platforms: device: 0 drv: nvidia device: 2 drv: iris
    device: 3 drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia wayland:
    drv: iris x11: drv: iris inactive: device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: intel mesa v: 26.0.6 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.4.341 surfaces: N/A device: 0 type: integrated-gpu
    driver: mesa intel device-ID: 8086:3e9b device: 1 type: discrete-gpu
    driver: nvidia device-ID: 10de:1c20 device: 2 type: cpu
    driver: mesa llvmpipe device-ID: 10005:0000
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor gpu: gputop, intel_gpu_top, lsgpu,
    nvidia-settings, nvidia-smi wl: wayland-info x11: xdriinfo, xdpyinfo,
    xprop, xrandr
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a348
  Device-2: NVIDIA GP106 High Definition Audio driver: snd_hda_intel
    v: kernel pcie: speed: 8 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:10f1
  Device-3: Jieli UACDemoV1.0 driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 bus-ID: 1-4.4.1:10
    chip-ID: 4c4a:4155
  Device-4: ARC Camera driver: snd-usb-audio,uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-4.4.2:11 chip-ID: 05a3:9331
  API: ALSA v: k7.0.4-200.fc44.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.6.4 status: active with: 1: pipewire-pulse
    status: active 2: pipewire-media-session status: off 3: wireplumber
    status: active 4: pipewire-alsa type: plugin 5: pw-jack type: plugin
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:a370
  IF: wlo1 state: up mac: <filter>
  Device-2: Qualcomm Atheros Killer E2400 Gigabit Ethernet
    vendor: Micro-Star MSI driver: alx v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: 3000 bus-ID: 05:00.0 chip-ID: 1969:e0a1
  IF: enp5s0 state: down mac: <filter>
  IF-ID-1: virbr0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) driver: btusb
    v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 1-14:9
    chip-ID: 8087:0aaa
  Report: btmgmt ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 5.1
    lmp-v: 10
Drives:
  Local Storage: total: 2.05 TiB used: 953.24 GiB (45.4%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WD BLACK SN850X 1000GB
    size: 931.51 GiB speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 37.9 C
  ID-2: /dev/sda vendor: SanDisk model: SD9SN8W256G size: 238.47 GiB
    speed: 6.0 Gb/s serial: <filter> temp: 35 C
  ID-3: /dev/sdb vendor: Western Digital model: WD10SPZX-17Z10T0
    size: 931.51 GiB speed: 6.0 Gb/s serial: <filter> temp: 35 C
Partition:
  ID-1: / size: 55.8 GiB used: 43.13 GiB (77.3%) fs: ext4 dev: /dev/sda7
  ID-2: /boot size: 1.9 GiB used: 706.2 MiB (36.2%) fs: ext4 dev: /dev/sda8
  ID-3: /boot/efi size: 96 MiB used: 51.4 MiB (53.6%) fs: vfat
    dev: /dev/sda2
  ID-4: /home size: 907.51 GiB used: 519.14 GiB (57.2%) fs: btrfs
    dev: /dev/nvme0n1p2
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
  ID-2: swap-2 type: partition size: 24 GiB used: 0 KiB (0.0%) priority: -1
    dev: /dev/nvme0n1p1
Sensors:
  System Temperatures: cpu: 51.0 C pch: 44.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB available: 15.45 GiB used: 5.07 GiB (32.8%)
  Processes: 363 Power: uptime: 22m wakeups: 0 Init: systemd v: 259
    default: graphical
  Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 49
    Compilers: clang: 22.1.4 gcc: 16.1.1 Shell: fish v: 4.6.0
    running-in: ghostty inxi: 3.3.40

Nvidia packages

akmod-nvidia-580xx.x86_64                                 3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
kmod-nvidia-580xx-6.19.14-300.fc44.x86_64.x86_64          3:580.159.03-1.fc44                  @commandline
kmod-nvidia-580xx-7.0.4-200.fc44.x86_64.x86_64            3:580.159.03-1.fc44                  @commandline
nvidia-gpu-firmware.noarch                                20260410-1.fc44                      updates
nvidia-modprobe.x86_64                                    3:595.71.05-1.fc44                   rpmfusion-nonfree-updates
nvidia-persistenced.x86_64                                3:595.71.05-1.fc44                   rpmfusion-nonfree-updates
nvidia-settings-580xx.x86_64                              3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx.x86_64                          3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-cuda.x86_64                     3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-cuda-libs.i686                  3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-cuda-libs.x86_64                3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-kmodsrc.x86_64                  3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-libs.i686                       3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-libs.x86_64                     3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-power.x86_64                    3:580.159.03-1.fc44                  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-580xx-xorg-libs.x86_64                3:580.159.03-1.fc44                  rpmfusion-nonfree-updates

Any advice on how to get it working again?

you have to provide more info from the journal

reproduce error and then run
journalctl -b 0 -g 'nvrm|error' --no-hostname --no-pager

I’m out today and don’t have my computer, but I do have the logs that appear when I connect the external monitor.

gnome-shell[7508]: Failed to ensure KMS FB ID on /dev/dri/card1: drmModeAddFB2 failed (L’argument passat no és vàlid) and drmModeAddFB cannot be used as a fallback because format=0x30334241 (AB30).
gnome-shell[7508]: meta_frame_native_release: assertion '!frame_native->kms_update' failed
kernel: nvidia-modeset: ERROR: Invalid request parameters, planePitch or rmObjectSizeInBytes, passed during surface registration
gnome-shell[7508]: Cursor update failed: drmModeAtomicCommit: L’argument passat no és vàlid

The system is configured in Catalan (L’argument passat no és vàlid => Invalid argument. )

I found the solution in the Gnome Mutter repository Regression: External monitor doesn't work since 50.0 (#4725) · Issues · GNOME / mutter · GitLab

For some reason in some Fedora version change I had to define the environment variable MUTTER_DEBUG_USE_KMS_MODIFIERS=0

And now it has been the source of the problem. As they say in the repository, the variable MUST NOT BE DEFINED. After removing it, everything worked properly again.