Xorg loading incorrectly

Hey I’m new to the forum, new to Linux and a recent Windows convert. I signed up to hopefully get some help with my issue.

I use a dual monitor setup, so the ‘switch display’ Meta+P shortcut from KDE daemon is really useful to me. The problem is it always resets my external monitors refresh rate to default 60hz when I want to always keep it at 144hz.

I’ve checked xorg’s log and each change the refresh rate is set to “auto” rather than what I specify in my nvidia.conf.

How to repeat:
Simply change display config with Meta+P

What’s expected:
For each monitor to select my correct refresh rate set in my nvidia.conf

What actually happens:
(See log) xorg loads 2560x1440 Auto mode rather than 144hz.

What I’ve tried to fix:

  1. Originally had my .conf in: /etc/X11/Xorg.conf but read FAQ that it needs instead to be /etc/X11/mhwd.d/nvidia.conf instead. Moving it here its still not being applied correctly.
  2. In KDE display manager, set resolution and apply.

What I suspect is the problem:
Either something is being done by KDE itself to override my .conf and switch my display to the default of 60hz, or my Xorg isn’t being read correctly.

A quick and dirty fix may be to edit what my default refresh rate is so it resets to 144hz instead of 60hz each time. But more preferably I’d like to figure out why my config doesn’t seem to be loading. Does anyone know how I can make 144hz the default refresh rate, or preferably how I can debug why my nvidia.conf isn’t being used on a display change?

Xorg log:

[tim@BEAST ~]$ cat /var/log/Xorg.0.log | grep DP-1
[    12.659] (II) NVIDIA(0): Setting mode "DP-1: nvidia
-auto-select @2560x1440 +1920+0 {ViewPortIn=2560x1440,
[    13.538] (II) NVIDIA(0): Setting mode "DP-1: nvidia
-auto-select @2560x1440 +0+0 {ViewPortIn=2560x1440, Vie
[    72.390] (II) NVIDIA(0): Setting mode "DP-1: nvidia
-auto-select @2560x1440 +1920+0 {ViewPortIn=2560x1440,
[    72.484] (II) NVIDIA(0): Setting mode "DP-0: nvidia
-auto-select @1920x1080 +0+0 {ViewPortIn=1920x1080, Vie
wPortOut=1920x1080+0+0}, DP-1: nvidia-auto-select @2560
x1440 +1920+0 {ViewPortIn=2560x1440, ViewPortOut=2560x1

nvidia.conf in /etc/X11/mhwd.d:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 460.73.01

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"

Section "Files"

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG Electronics 32GK650G"
    HorizSync       88.0 - 222.0
    VertRefresh     30.0 - 144.0
    Option         "DPMS"

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060"

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-2"
    Option         "metamodes" "DP-1: 2560x1440_144 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24

[tim@BEAST ~]$ inxi -G
  Device-1: NVIDIA GP106BM [GeForce GTX 1060 Mobile 
  driver: nvidia v: 460.73.01 
  Device-2: Chicony HP Wide Vision FHD Camera 
  type: USB driver: uvcvideo 
  Display: x11 server: X.Org 1.20.11 driver: 
  loaded: nvidia resolution: 1: 1920x1080~120Hz 
  2: 2560x1440~60Hz 
  OpenGL: renderer: GeForce GTX 1060/PCIe/SSE2 
  v: 4.6.0 NVIDIA 460.73.01

[tim@BEAST ~]$ xrandr
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 381mm x 214mm
   1920x1080    120.15*+  60.13  
DP-1 connected 2560x1440+1920+0 (normal left inverted right x axis y axis) 697mm x 392mm
   2560x1440     59.95*+ 144.00   120.00    99.95    84.98  
   1024x768      60.00  
   800x600       60.32  
   640x480       59.94  
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)

Operating System: Manjaro Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.10.34-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz
Memory: 15.5 GiB of RAM
Graphics Processor: GeForce GTX 1060/PCIe/SSE2

System is a HP Omen 17" laptop using integrated 120hz display and external 144hz LG 32GK650G 144hz gsync monitor connected via display port.

So what is it about KDE that’s changing my monitor refresh rate to default using the Meta+P shortcut?

Xorg is being read okay, since it sticks on reboot. However this shortcut keeps putting my monitor back to 60hz.

In the logs when I switch xrandr shows it choose ‘Nvidia auto select’ instead of my preferred or metamode resolution.

If I manually set refresh rate using xrandr or each display manager (KDE/Nvidia) its not a problem. Its only the Meta+P thats the issue.