Desktop Duplication on Hybrid Graphics Systems

The Desktop Duplication API allows applications to access frame-by-frame updates to the desktop image associated with a particular DXGI output as a DXGI surface. For hybrid graphics systems, there is a well-known issue that occurs when an application is run on one GPU but attempts to duplicate output from another GPU that is merely acting as a shim for the first. In the case of hybrid graphics laptops, this corresponds to the application being run on the discrete GPU and duplicating the laptop display which is generally connected to an integrated GPU. IDXGIOutput1::DuplicateOutput will fail with DXGI_ERROR_UNSUPPORTED.

Microsoft’s recommended fix for this error is to run the application on the appropriate GPU; in the case of hybrid laptops, this will usually correspond to the integrated (low-power) GPU. Fortunately for application developers, there are programmatic ways of forcing an executable to run on a certain GPU. For NVIDIA Optimus systems, you can use NVAPI to create an application profile and set the relevant flag. For AMD PowerXpress systems, the situation is murkier. Finally, in Windows 10 Build 17093, Microsoft introduced an abstraction that overrides any vendor-specific GPU preference. This abstraction is configurable by programmatically setting a registry value.

Continue reading