NvAPI_Mosaic_SetDisplayGrids sometimes fails when display supports more than 40 resolutions

NvAPI_Mosaic_SetDisplayGrids sometimes fails to apply a simple 1x1 display grid when certain resolutions are used. Some valid resolutions succeed, but some fail.

I believe this is because the display settings array is capped to 40:

// Set a reasonable max number of display settings to support
// so arrays are bound.
#define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40

If I call NvAPI_Mosaic_GetSupportedTopoInfo, any resolution listed in the returned ‘displaySettings’ array can be used in NvAPI_Mosaic_SetDisplayGrids without issue.
However, when a display supports more than 40 resolutions, any resolution that is excluded from the ‘displaySettings’ will fail.

I suspect I can workaround the issue by squashing the EDID down to 40 or fewer resolutions I need, but there has to be a better way than applying custom EDIDs?

Hello @daniel.m

Thank you for contacting NVIDIA developer forum.
Our team has received your query. We will get back to you with the required details.

Thanks,
NVAPI Forum Moderator

Note that this issue can sort of be reproduced with configureMosaic.exe:

  • Load the attached EDID file for an ASUS 4K 144hz monitor
  • Use configureMosaic to attempt to set a simple 1x1 grid with a resolution of 1920x1200 120hz on this display:
    configureMosaic.exe set rows=1 cols=1 out=0,0 gridPos=0,0 res=1920,1200,120
  • configureMosaic will “succeed” but sets a resolution of 1920x1200 @ 100hz instead of 120hz

1920x1200 @100hz is one of the 40 resolutions returned by NvAPI_Mosaic_GetSupportedTopoInfo, so I suspect configureMosaic is falling back to the nearest “supported” resolution.

Note that you can manually set the 1920x1200 120hz resolution through Windows Display Settings or the Nvidia Control Panel. It only fails with configureMosaic or the NvAPI_Mosaic_SetDisplayGrids call.

edid.txt (1.1 KB)

Thanks @daniel.m ,
These details are really useful. We will let you know when we have some updates on this issue.