Which CUDA device is the priary display? How can I tell Which CUDA device is the priary display?

I want to automatically run code on all CUDA devices except the one running the primary display.

How can I tell (programatically) which cuda device id corresponds to the prmary display? Or indeed
if a cuda device has any dispay attached to it?

I’ve searched, but cant find anything. Thanks in advance.

I want to automatically run code on all CUDA devices except the one running the primary display.

How can I tell (programatically) which cuda device id corresponds to the prmary display? Or indeed
if a cuda device has any dispay attached to it?

I’ve searched, but cant find anything. Thanks in advance.

If you obtain the properties of a device using cudaGetDeviceProperties() function, then you can check the kernelExecTimeoutEnabled field. A true value indicates that the watchdog is active and that device is attached to a display.

If you obtain the properties of a device using cudaGetDeviceProperties() function, then you can check the kernelExecTimeoutEnabled field. A true value indicates that the watchdog is active and that device is attached to a display.

Aha! Brilliant. I read through the members of cudaDeviceProp three times without seeing it. Many thanks seibert.

Aha! Brilliant. I read through the members of cudaDeviceProp three times without seeing it. Many thanks seibert.