External monitor not working properly with gnome and nvidia dual GPU

  1. both native and external monitors run in 1080p @ 144hz
  2. if i try to move the external monitor from right to left in the display settings, the external monitor freezes.
  3. when screenlock gets activated, external monitor will not wake up anymore and in the settings it is disabled.
  4. i also had issue where external monitor randomly froze. this was semi-fixed with removing google chrome’s hardware acceleration. more info here: External monitor (primary) behind laptop freezes frequently

i have been using the same system and installation couple of years without any issues.

System:
  Kernel: 6.1.9-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=1edf72db-d3e8-47d1-9201-a5cfa27e1efb rw quiet
    udev.log_priority=3
  Desktop: GNOME v: 43.2 tk: GTK v: 3.24.36 wm: gnome-shell dm: GDM v: 43.0
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: Micro-Star product: GF65 Thin 10SDR v: REV:1.0
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Micro-Star model: MS-16W1 v: REV:1.0 serial: <superuser required>
    UEFI: American Megatrends v: E16W1IMS.50B date: 05/19/2020
Battery:
  ID-1: BAT1 charge: 46.7 Wh (92.1%) condition: 50.7/51.3 Wh (98.8%)
    volts: 12.6 min: 11.4 model: MSI Corp. MS-16W1 type: Li-ion serial: N/A
    status: not charging
  Device-1: hidpp_battery_0 model: Logitech MX Keys Wireless Keyboard
    serial: <filter> charge: 55% (should be ignored) rechargeable: yes
    status: discharging
  Device-2: hidpp_battery_1 model: Logitech Wireless Mouse MX Master 3
    serial: <filter> charge: 100% (should be ignored) rechargeable: yes
    status: discharging
Memory:
  RAM: total: 31.17 GiB used: 3.23 GiB (10.4%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i7-10750H bits: 64 type: MT MCP arch: Comet Lake
    gen: core 10 level: v3 note: check built: 2020 process: Intel 14nm family: 6
    model-id: 0xA5 (165) stepping: 2 microcode: 0xF4
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 3035 high: 4793 min/max: 800/5000 scaling:
    driver: intel_pstate governor: powersave cores: 1: 2600 2: 2951 3: 4698
    4: 2600 5: 2600 6: 2600 7: 2600 8: 2600 9: 3188 10: 2600 11: 4793 12: 2600
    bogomips: 62431
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush
    clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu
    fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs
    ibrs_enhanced ida intel_pt invpcid invpcid_single lahf_lm lm mca mce
    md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx ospke pae pat
    pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pku pln pni popcnt pse pse36 pts
    rdrand rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1
    sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust
    tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt
    xsaves xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
    filling, PBRSB-eIBRS: SW sequence
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Micro-Star MSI
    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:9bc4
    class-ID: 0300
  Device-2: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] vendor: Micro-Star MSI
    driver: nvidia v: 525.85.05 alternate: nouveau,nvidia_drm non-free: 525.xx+
    status: current (as of 2022-12) arch: Turing code: TUxxx
    process: TSMC 12nm FF built: 2018-22 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:2191
    class-ID: 0300
  Display: x11 server: X.Org v: 21.1.6 with: Xwayland v: 22.1.7
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa dri: iris gpu: i915 display-ID: :1
    screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x286mm (40.00x11.26")
    s-diag: 1055mm (41.55")
  Monitor-1: HDMI-1-0 pos: primary,right res: 1920x1080 hz: 144 dpi: 93
    size: 527x296mm (20.75x11.65") diag: 604mm (23.8") modes: N/A
  Monitor-2: eDP-1 pos: left res: 1920x1080 hz: 144 dpi: 142
    size: 344x193mm (13.54x7.6") diag: 394mm (15.53") modes: N/A
  API: OpenGL v: 4.6 Mesa 22.3.4 renderer: Mesa Intel UHD Graphics (CML GT2)
    direct render: Yes
Audio:
  Device-1: Intel Comet Lake PCH cAVS vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    bus-ID: 00:1f.3 chip-ID: 8086:06c8 class-ID: 0403
  Sound API: ALSA v: k6.1.9-1-MANJARO running: yes
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.65 running: yes
Network:
  Device-1: Intel Comet Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:06f0 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Micro-Star MSI driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: 3000 bus-ID: 04:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp4s0 state: down mac: <filter>
  IF-ID-1: br-43524aa4e9b7 state: up speed: 10000 Mbps duplex: unknown
    mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  IP v6: <filter> scope: link
  IF-ID-2: docker0 state: down mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  IF-ID-3: veth4423070 state: up speed: 10000 Mbps duplex: full mac: <filter>
  IF-ID-4: veth52bca71 state: up speed: 10000 Mbps duplex: full mac: <filter>
  IF-ID-5: veth606a363 state: up speed: 10000 Mbps duplex: full mac: <filter>
  IF-ID-6: vetha21809f state: up speed: 10000 Mbps duplex: full mac: <filter>
  IF-ID-7: vethab753c7 state: up speed: 10000 Mbps duplex: full mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-14:5
    chip-ID: 8087:0026 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
  Device-1: luks-cab6c7fd-4b0a-4197-8b19-d8f2119cc7e4 maj-min: 254:0
    type: LUKS dm: dm-0 size: 427.62 GiB
  Components:
  p-1: nvme1n1p3 maj-min: 259:4 size: 427.62 GiB
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 1.38 TiB used: 621.05 GiB (44.1%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:1 vendor: Samsung
    model: SSD 970 EVO Plus 1TB size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 3B2QEXM7 temp: 33.9 C
  ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Western Digital model: PC SN530
    SDBPNPZ-512G-1032 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 21111000 temp: 34.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 48.83 GiB size: 47.76 GiB (97.81%) used: 36.19 GiB (75.8%)
    fs: ext4 dev: /dev/nvme1n1p2 maj-min: 259:3 label: N/A
    uuid: 1edf72db-d3e8-47d1-9201-a5cfa27e1efb
  ID-2: /boot/efi raw-size: 500 MiB size: 499 MiB (99.80%)
    used: 296 KiB (0.1%) fs: vfat dev: /dev/nvme1n1p1 maj-min: 259:2
    label: NO_LABEL uuid: 3ED8-9B8B
  ID-3: /disk raw-size: 931.51 GiB size: 915.82 GiB (98.31%)
    used: 499.93 GiB (54.6%) fs: ext4 dev: /dev/nvme0n1 maj-min: 259:1
    label: disk uuid: fd9709f4-de6f-4289-b2e3-61b5ac58233e
  ID-4: /home raw-size: 427.62 GiB size: 419.83 GiB (98.18%)
    used: 84.93 GiB (20.2%) fs: ext4 dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-cab6c7fd-4b0a-4197-8b19-d8f2119cc7e4 label: N/A
    uuid: a62fb052-0601-468e-81d4-1fd028bc804b
Swap:
  Alert: No swap data was found.
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 1-2:2 info: Genesys Logic Hub ports: 4 rev: 2.1 speed: 480 Mb/s
    power: 100mA chip-ID: 05e3:0610 class-ID: 0900
  Device-1: 1-3:3 info: Logitech Unifying Receiver type: Keyboard,Mouse,HID
    driver: logitech-djreceiver,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s
    power: 98mA chip-ID: 046d:c52b class-ID: 0300
  Device-2: 1-4:4 info: Logitech Unifying Receiver type: Keyboard,Mouse,HID
    driver: logitech-djreceiver,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s
    power: 98mA chip-ID: 046d:c52b class-ID: 0300
  Device-3: 1-14:5 info: Intel AX201 Bluetooth type: Bluetooth driver: btusb
    interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 8087:0026
    class-ID: e001
  Hub-3: 2-0:1 info: Super-speed hub ports: 8 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-4: 2-2:2 info: Genesys Logic Hub ports: 4 rev: 3.2 speed: 5 Gb/s
    chip-ID: 05e3:0626 class-ID: 0900
Sensors:
  System Temperatures: cpu: 51.0 C pch: 51.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 352 Uptime: 7m wakeups: 5 Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman
  pkgs: 1709 libs: 476 tools: gnome-software,pamac,yay pm: flatpak pkgs: 0
  Shell: Zsh v: 5.9 running-in: gnome-terminal inxi: 3.3.24
> 0000:01:00.0 (0300:10de:2191) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2021.11.04               false            PCI
          video-nvidia            2021.11.04               false            PCI
    video-nvidia-470xx            2021.11.04               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:04:00.0 (0200:10ec:8168) Network controller Realtek Semiconductor Co., Ltd.:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI


> 0000:00:02.0 (0300:8086:9bc4) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2021.11.04               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
eDP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080    144.15*+  60.01    59.97    59.96    60.20    59.93  
   1680x1050     59.95    59.88  
   1400x1050     74.76    59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     85.02    75.02    60.02  
   1400x900      59.96    59.88  
   1280x960      85.00    60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      59.99    59.97    59.81    59.91  
   1152x864      75.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      85.00    75.05    60.04    85.00    75.03    70.07    60.00  
   1024x768i     86.96  
   960x720       85.00    75.00    60.00  
   928x696       75.00    60.05  
   896x672       75.05    60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   832x624       74.55  
   960x540       59.96    59.99    59.63    59.82  
   800x600       85.00    75.00    70.00    65.00    60.00    85.14    72.19    75.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       74.76    59.98  
   800x450       59.95    59.82  
   640x512       85.02    75.02    60.02  
   700x450       59.96    59.88  
   640x480       85.09    60.00    85.01    72.81    75.00    59.94  
   720x405       59.51    58.99  
   720x400       85.04  
   684x384       59.88    59.85  
   640x400       59.88    59.98    85.08  
   576x432       75.00  
   640x360       59.86    59.83    59.84    59.32  
   640x350       85.08  
   512x384       85.00    75.03    70.07    60.00  
   512x384i      87.06  
   512x288       60.00    59.92  
   416x312       74.66  
   480x270       59.63    59.82  
   400x300       85.27    72.19    75.12    60.32    56.34  
   432x243       59.92    59.57  
   320x240       85.18    72.81    75.00    60.05  
   360x202       59.51    59.13  
   360x200       85.04  
   320x200       85.27  
   320x180       59.84    59.32  
   320x175       85.27  
HDMI-1-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080    143.98*+ 119.98   119.88    99.93    60.00    59.94    50.00  
   3840x2160     59.94    50.00    29.97    25.00    23.98  
   1280x1024     75.02  
   1280x720      59.94  
   1024x768     119.99    75.03    60.00  
   800x600      119.97    75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480      120.01    75.00    59.94    59.93  
  1280x1024 (0x52) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1024x768 (0x69) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x6b) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x86) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x87) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  640x480 (0x9a) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x9b) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

i hope somebody can finally help me out.

➜  ~ cat /etc/modprobe.d/mhwd-gpu.conf 
##
## Generated by mhwd - Manjaro Hardware Detection
##
 
blacklist nouveau
blacklist ttm
blacklist drm_kms_helper
blacklist drm
➜  ~ cat /etc/modules-load.d/mhwd-gpu.conf 
##
## Generated by mhwd - Manjaro Hardware Detection
##
 
nvidia

shouldn’t /etc/modules-load.d/mhwd-gpu.conf contain also nvidia-drm?

edit: adding this line has no effect!

one small note:

if i unplug and replug the hdmi cable, the external monitor wakes up and correct configuration gets loaded. this issue does not happen when rebooting. only after the screenlock has been active for a while. machine does no go into suspension during this.