GetDisplayConfig only returns NVIDIA connected displays

Hi,

After multiple tests on Optimus laptops and dGPU desktop PCs, it seems the NvAPI_DISP_GetDisplayConfig function only returns PathInfo objects for the display targets connected to the NVIDIA card itself. It won’t return any other display targets plugged in to non-NVIDIA GPU video adapaters . Can you please confirm this is supposed to happen?

What this means is that if I capture the NvAPI_DISP_GetDisplayConfig PathInfos array, then attempt to use that same array as an input to NvAPI_DISP_SetDisplayConfig, NvAPI_DISP_SetDisplayConfig fails with a NV_STATUS of -5 (Invalid arguments).

During my testing, if I have test on a desktop PC with the displays only connected to a NVIDIA dGPU, then putting the PathInfo output of the NvAPI_DISP_GetDisplayConfig function into NvAPI_DISP_SetDisplayConfig works perfectly. The screen layout is updated as it should be. But if there is any non-NVIDIA display connected to a PC then NvAPI_DISP_SetDisplayConfig fails with a NV_STATUS of -5 (Invalid arguments).

I have tried this with a tweaked version of DisplayConfiguration.cpp sample code from your NvAPI driver pack, as well as some custom C# code that I have developed here and I get the same problems in both versions, so I know its not a problem with my code: NVIDIAInfo/NVIDIAInfo/NVIDIALibrary.cs at feature-revamp-displayconfig · terrymacdonald/NVIDIAInfo · GitHub

My guess is that the NvAPI_DISP_GetDisplayConfig function is only returning NVIDIA connected displays instead of returning all connected displays. I expect that this is causing issues when I then use that same PathInfo array in NvAPI_DISP_SetDisplayConfig, as it is expecting a pathinfo array containing all connected displays (when it only contains NVIDIA connected displays). NvAPI_DISP_SetDisplayConfig is then returning an error as the PathInfo array is ‘incorrect’.

Can you please confirm that NvAPI_DISP_GetDisplayConfig is supposed to only return the displaytargets connected to the NVIDIA GPUs in the PC?

Thanks
Terry

Also, can you please confirm that NvAPI_DISP_SetDisplayConfig is only supposed to be given NVIDIA connected display targets?

And can you please confirm that the output of NvAPI_DISP_GetDisplayConfig (the PathInfos array) is able to be used directly as the input to NvAPI_DISP_SetDisplayConfig without any changes needed?

Dear @terry.macdonald

Thank you for sharing the details about your experiments.
Here’re some answers:
Q: Is NvAPI_DISP_GetDisplayConfig only supposed to return the display targets connected to NVIDIA GPUs in the PC?
Ans: Yes, it returns only targets connected to NVIDIA GPUs.

Q: Is NvAPI_DISP_SetDisplayConfig only supposed to be given NVIDIA connected display targets?
Ans: Yes, that is correct.

Q: Can the output of NvAPI_DISP_GetDisplayConfig be provided directly as an input to NvAPI_DISP_SetDisplayConfig?
Ans: We have passed this to our technical team and we will get back to you after initial investigation.

Thank you.
NVAPI Forum Moderator