0

I'm trying to set a custom resolution for my primary display, one that the monitor doesn't advertise as available. On Windows I could set a custom resolution in the NVIDIA Control Panel, and then switch to it from the command line using qres.

Now that I'm on Linux, I'm looking to make a custom mode for my display, and switch to it whenever I want using xrandr. But all the guides I've found fail me, ending up in a "BadMatch" error.

ellitedev@twrreborn:~$ xrandr
Screen 0: minimum 8 x 8, current 3640 x 2580, maximum 32767 x 32767
DP-0 connected 1080x1920+0+660 left (normal left inverted right x axis y axis) 531mm x 298mm
   1920x1080     60.00*+ 144.00   119.98   119.88   100.00    99.93    74.99    59.94    50.00  
   1440x900     119.85  
   1280x1024    119.96    75.02    60.02  
   1280x960      99.78  
   1280x720      60.00    59.94    50.00  
   1024x768     119.99    75.03    60.00  
   800x600      119.97    99.66    75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480      119.52    75.00    59.94    59.93  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected (normal left inverted right x axis y axis)
   1280x768      59.99 +
   1920x1080     60.00    59.94    50.00  
   1360x768      60.02  
   1360x765      60.00  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
HDMI-0 connected primary 2560x1080+1080+1080 (normal left inverted right x axis y axis) 798mm x 334mm
   2560x1080     59.98*+  74.99    50.00  
   3840x2160     29.97    25.00    23.98  
   2560x1440     59.95  
   1920x1080     75.00    60.00    59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      60.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 connected 1920x1080+1400+0 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080     60.00*+  59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94  
DVI-D-1-0 disconnected (normal left inverted right x axis y axis)
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
DP-1-0 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)
ellitedev@twrreborn:~$ cvt 2400 1080 60
# 2400x1080 59.97 Hz (CVT) hsync: 67.16 kHz; pclk: 216.00 MHz
Modeline "2400x1080_60.00"  216.00  2400 2552 2808 3216  1080 1083 1093 1120 -hsync +vsync
ellitedev@twrreborn:~$ xrandr --newmode "2400x1080_60.00"  216.00  2400 2552 2808 3216  1080 1083 1093 1120 -hsync +vsync
ellitedev@twrreborn:~$ xrandr --addmode HDMI-0 "2400x1080_60.00"
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  65
  Current serial number in output stream:  66

I want to make sure that all my other displays stay intact when I change this one display.

I know this might be a copy of other posts, but I am at my wits end.

1 Answer 1

0

I've found the solution! I got the base of what I need to know from a forum post, and a YouTube video.

In the forum post, I found the specific option I need to add to my xorg configuration. Since I'm on Pop!_OS, I figured out that I could find the one I needed in /usr/share/X11/xorg.conf.d/. The file I actually had to change was 10-nvidia.conf. I figured this was the case because in the YouTube video, I gleamed that xorg loads the config at boot, in file name order. And since I had nvidia drivers, I figure it would be the file named nvidia.

Now the line I had to add was:

Option "ModeValidation" "AllowNon60hzmodesDFPModes, NoEDIDDFPMaxSizeCheck, NoVertRefreshCheck, NoHorizSyncCheck, NoDFPNativeResolutionCheck, NoMaxSizeCheck, NoMaxPClkCheck,  AllowNonEdidModes, NoEdidMaxPClkCheck"

Now my config looks like this:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "ModeValidation" "AllowNon60hzmodesDFPModes, NoEDIDDFPMaxSizeCheck, NoVertRefreshCheck, NoHorizSyncCheck, NoDFPNativeResolutionCheck, NoMaxSizeCheck, NoMaxPClkCheck,  AllowNonEdidModes, NoEdidMaxPClkCheck"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

After saving this config and rebooting, I was able to successfully add custom modes to my displays :) I hope this helps others who are confused.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .