How to detect what devices have monitor conencted?

How to detect what devices have monitor connected? (We can have 4 cards with 2 monitors connected to some of them, right?)

I am going to send 50-100ms jobs to these devices, and 1500ms to the ones which have no monitor, so that screen would refresh often, and it would not annoy end user.

Any suggestions?

I don’t think there’s any way to do that from within CUDA, because it would mean tying CUDA to the Windows display model pretty thoroughly. I’d probably just figure it out from outside of your CUDA application and save it as a configuration option somewhere.

Well, mapping of CUDA device_id and something from the outer would might be a problem.

I remember reading something on “vertical retrace interrupt” long long ago… Whenever there is a vertical retrace (the electron gun is shut off during this period when it re-positions to the top-left portion of your screen from the right bottom) the graphics card would be informed about it – Graphics programmers use this window to modify video memory to minimize the flicker…

This is one such technique… Not sure if this still holds water in today’s LCD monitor case and others…

Probably you could just wait for the vertical retrace interrupt to happen and timeout if not to find whether monitor is connected or not…

– edit –

The vertical retrace could be auto-calculated by the graphics card depending on dot-clock, resolution and so on – IN that case , the above method is useless…