Skip to content

Instantly share code, notes, and snippets.

@gdesatrigraha
Last active November 24, 2023 06:43
Show Gist options
  • Save gdesatrigraha/0451317a0efd67f1f9e06785ba87801e to your computer and use it in GitHub Desktop.
Save gdesatrigraha/0451317a0efd67f1f9e06785ba87801e to your computer and use it in GitHub Desktop.
fixing monitor resolution on linux with nvidia GPU

Fix monitor resolution on linux with nvidia GPU because the monitor EDID information is unavailable.
This fix assume we are using multiple monitor setup with the same monitor, so we can grab the EDID information of the monitor, from the other monitor attached to another output port (D-SUB, DVI, HDMI, DisplayPort)

In my setup, I have 3 Dell S2415H attached to D-SUB, HDMI, and DVI port.
The monitor which was attached to the D-SUB port (VGA-0), doesn't has any EDID information available, thus I was unable to use the native 1920x1080 resolution.

Step to overcome the situation:

  • install nvidia driver
  • dump binary monitor EDID data using nvidia-settings:
    • run the nvidia-settings app
    • choose monitor which has correct EDID information (I selected DVI-D0 monitor)
    • on the right bottom corner, there is a Acquire EDID... button
    • save the EDID in binary format to some location (ie: /etc/X11/dell-s2415h-edid.bin)
  • get the display name of the monitor which doesn't has the EDID information:
    • use nvidia-xconfig --query-gpu-info command
    • it will show my Display Device 0 (CRT-0) doesn't has any EDID information available
    • the CRT-0 will be the display name of the monitor which we will use when updating the xorg.conf
  • if we don't have any xorg.conf yet in /etc/X11/xorg.conf, we can generate one using nvidia-settings from the XServer Display Configuration page
  • edit the xorg.conf, and on the Device section, add this line Option "CustomEDID" "CRT-0:/etc/X11/dell-s2415h-edid.bin"

The final xorg.conf will have something like this:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 710"
    Option         "CustomEDID" "CRT-0:/etc/X11/dell-s2415h-edid.bin"
EndSection

Reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment