[390.77/396.54] Metamodes viewportin regression with NVS 510

Running on Red Linux 7.2. Using a NVS 510 graphics card with 3 UHD 32 inch monitors connected. My xorg.conf file specifies the 3 monitors be treated as one logical display but I am scaling output using a viewportin setting of 2584x1458 on all 3 monitors. The Screen section of my xorg.conf file looks like this:

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
Option “ModeDebug” “true”
Option “Stereo” “0”
Option “nvidiaXineramaInfoOrder” “DFP-5, DFP-4, DFP-7”
Option “metamodes” “DP-5: nvidia-auto-select +0+0 {viewportin=2584x1458}, DP-4: nvidia-auto-select +2584+0 {viewportin=2584x1458}, DP-7: nvidia-auto-select +5168+0 {viewportin=2584x1458}”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection

This worked fine with driver version 367.35 but fails with version 390.77 and 396.54.
The Xorg.0.log file shows the following error on X server startup:

[ 1128.179] (II) NVIDIA(0): Using MetaMode string: “DP-5: nvidia-auto-select +0+0
[ 1128.179] (II) NVIDIA(0): {viewportin=2584x1458}, DP-4: nvidia-auto-select +2584+0
[ 1128.179] (II) NVIDIA(0): {viewportin=2584x1458}, DP-7: nvidia-auto-select +5168+0
[ 1128.179] (II) NVIDIA(0): {viewportin=2584x1458}”
[ 1128.179] (II) NVIDIA(0): Requested modes:
[ 1128.179] (II) NVIDIA(0):
[ 1128.179] (II) NVIDIA(0): “DP-5:nvidia-auto-select+0+0{viewportin=2584x1458},DP-4:nvidia-auto-select+2584+0{viewportin=2584x1458},DP-7:nvidia-auto-select+5168+0{viewportin=2584x1458}”
[ 1128.179] (WW) NVIDIA(0): No valid modes for
[ 1128.179] (WW) NVIDIA(0): “DP-5:nvidia-auto-select+0+0{viewportin=2584x1458},DP-4:nvidia-auto-select+2584+0{viewportin=2584x1458},DP-7:nvidia-auto-select+5168+0{viewportin=2584x1458}”;
[ 1128.179] (WW) NVIDIA(0): removing.
[ 1128.179] (WW) NVIDIA(0):
[ 1128.179] (WW) NVIDIA(0): Unable to validate any modes; falling back to the default mode
[ 1128.179] (WW) NVIDIA(0): “nvidia-auto-select”.

Running nvidia-settings I noticed that the closest native mode was 2560x1600. When I changed my xorg.conf metamodes line to use this viewport setting and restarted X. It worked. But it’s not the setting I need to use.

What happened after driver version v367.35 to cause this issue?

Looks like some parsing bug was introduced. From the looks of it, the metamode setting should still work.
Please check if this is now case sensitive, replace viewportin with ViewPortIn.
If that doesn’t work, add the ViewPortOut specifying the native resolution of your monitors, e.g.

DP-5: nvidia-auto-select +0+0 {ViewPortIn=2584x1458,ViewPortOut=3840x2160}

If that still doesn’t work, replace nvidia-auto-select with the native resolution.

I tried each of the following:

  1. Replaced viewportin with ViewPortIn
    This failed with the same “No valid modes” error.

  2. Using 1, added in the ViewPortOut setting.
    This generated a “Malformed ViewPortOut string ‘3840x2160’, ignoring” message.
    Then got the same modes error.

  3. Using 2, replaced nvidia-auto-select with 3840x2160
    This failed with the same “No valid modes” error.

  4. Using 3, removed ViewPortOut setting like this: DP-5: 3840x2160 +0+0 {ViewPortIn=2584x1158}
    This failed with the same “No valid modes” error.

  5. Using 4, changed ViewPortIn back to all lowercase.
    This failed with the same “No valid modes” error.

Any other suggestions?

Please try with ViewPortOut=3840x2160+0+0 and attach the full Xorg.0.log.

Finally getting back to investigate this again. We found a workaround for a 3x32 inch HD monitor configuration. Used a viewportin setting of 2560x1600 instead of 2584x1458. Here is the full section from the xorg.conf file:

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
Option “Stereo” “0”
Option “nvidiaXineramaInfoOrder” “DFP-5, DFP-4, DFP-7”
Option “metamodes” “DP-5: nvidia-auto-select +0+0 {viewportin=2560x1600}, DP-4: nvidia-auto-select +2560+0 {viewportin=2560x1600}, DP-7: nvidia-auto-select +5120+0 {viewportin=2560x1600}”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection

I see there are new drivers available (410.73 released, 415.13 beta). Both have this in the release notes:

“Fixed a bug that caused vkGetPhysicalDeviceDisplayPropertiesKHR() to occasionally return incorrect values for physicalResolution.”

Might this fix this issue?

No, I don’t think so, this only affect Vulkan.
But I think I know what’s going on taking a second look at it. AFAIK, Xserver modes have to have a vertical and horizontal resolution that’s a multiple of 8. Your previous setting of 2584x1158 does not comply with that requirement, so it has rather been a bug that the nvidia driver applied those irregular modes before.

Installed the 410.73 driver version and reset our metamodes setting to our desired 2584x1458 scaling. On reboot we saw the “no valid modes” failure. I changed the viewportin to 2584x1464 (both divisible by 8) and this failed as well. I brought up nvidia-settings and noticed support for a native scaled resolution of 2560x1440. I set the viewportin to this resolution and this worked. This appears to be a better workaround since the X and Y values are closer to our desired resolution. Here is the updated meta modes line that worked:

Option “metamodes” “DP-5: nvidia-auto-select +0+0 {viewportin=2560x1440}, DP-4: nvidia-auto-select +2560+0 {viewportin=2560x1440}, DP-7: nvidia-auto-select +5120+0 {viewportin=2560x1440}”