Is there a way to determine connected displays and differ them from on/off?

I want to find out which displays are connected to my graphics card, set priorities for the display and automatically project my computer screen to a prioritized display once it is powered on. So it is important not only to see if the display is physically connected, but also if it’s turned on or off.

Anybody has an idea how to do this? Preferably in some sort of python wrapper of an Nvidia API.

Hello @alexg93 and welcome to the NVIDIA developer community!

Handling displays is very closely intertwined with the operating itself. That means if at all possible you should rather use the OS supplied mechanisms to control Display setup and resolution.

However, if you want to get down to metal, there is the NVIDIA NVAPI, which allows to set all of this programmatically.

I have seen attempts on .NET as well as Python wrappers for this, but never checked closely, so I cannot say if there is some reliable implementation “out there”.

Best of luck with your project!

Thanks for the hint. Unfortunately I dont see how to determine, whether a display is “available” when the screen is currently not projected to it.

NvU32 _NV_GPU_DISPLAYIDS::isActive: 1

NvU32 _NV_GPU_DISPLAYIDS::isCluster: 1

NvU32 _NV_GPU_DISPLAYIDS::isOSVisible: 1


NvU32 _NV_GPU_DISPLAYIDS::isConnected: 1

NvU32 _NV_GPU_DISPLAYIDS::reservedInternal: 10

NvU32 _NV_GPU_DISPLAYIDS::isPhysicallyConnected: 1

All these values change only after I manually select to project the to the screen.
I just need a way to find out, whether a device has been turned on so I can automatically project the screen to it.

Or in other words, when I turn on my TV, I want the screen to be on the TV. When I turn off the TV, I want the screen to be on my Monitor.