X resolution issue

I have quite some issues with getting my X resolution persistent with nvidia.

When configuring the monitor with nvidia-settings the applications are fine and the file also seems to look ok:

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

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

Section "Files"
EndSection

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

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

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung Odyssey G95NC"
    HorizSync       275.0 - 275.0
    VertRefresh     48.0 - 120.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce RTX 3080"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DP-0"
    Option         "metamodes" "7680x2160_120 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

When I restart the session I get thrown back to 3840x1080.

When quering xrandr:

[beat@smolboi:~]$ xrandr -q
Screen 0: minimum 8 x 8, current 7680 x 2160, maximum 32767 x 32767
HDMI-0 disconnected primary (normal left inverted right x axis y axis)
DP-0 connected 7680x2160+0+0 (normal left inverted right x axis y axis) 1mm x 1mm
   3840x1080     59.97 + 119.97
   7680x2160    120.00*   59.99
   5120x1440    119.97    59.98
   3840x2160    119.88    59.94    29.97
   2560x1440    120.00    59.95
   1920x1080    119.88    60.00    59.94
   1680x1050     59.95
   1600x900      60.00
   1440x900      59.89
   1280x1024     75.02    60.02
   1280x800      59.81
   1280x720      60.00    59.94
   1152x864      75.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32
   720x480       59.94
   640x480       75.00    59.94
DP-1 disconnected (normal left inverted right x axis y axis)
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)
DP-5 disconnected (normal left inverted right x axis y axis)
None-2-1 connected (normal left inverted right x axis y axis)
   1024x768      60.00 +
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)

my nvidia config is pretty much what nixos wiki is proposing for defaults.

also I’m running gdm which seems to use the same low resolution, for which I neither have found a way so far to set it correctly.

is the nixos xserver module overriding the settings? I also tried to set it with xrandrHeads but that did not work at all. (Would that be the preferred approach to set X configurations?)

hey,
you can try setting the resolution for the xserver manually. There is a services.xserver.resolutions option

1 Like

Thank you a bunch. That seems exactly what I was looking for. I’ll try it later this week when I go back to migrating my system to nixos and reply with the outcome.