So this may have been answered elsewhere, but I’m having a hard time finding the answer…
Is there a simple way to detect if a gpu (in a multiple gpu machine) is driving a display from a command line or API perspective? The only thing I can think of is to query the devices and compare available memory, though this would only work for specific known configurations, not in the general sense.
The idea is that I want to run a CUDA-enabled job on a remote machine, but I don’t want to run on a gpu driving the display if possible.
I have found that nVidia uses nvapi.dll in nvcuda.dll. It’s easy to check with any hex viewer by searching for nvAPI library name in so called “CUDA driver”. :)
Here must be some mapping between NvPhysicalGpuHandle and CUdevice!