2
votes

The problem: calling IDXGIOutput1::DuplicateOutput method returns DXGI_ERROR_UNSUPPORTED when you run an application using discrete graphics controller on a machine with switchable graphics.

This answer shed some light on the issue. In short, the discrete graphics renders only a part of the screen and sends the data to the framebuffer of the intergrated graphics controller -- in other words all output always goes through the integrated graphics controller. It seems that this is why DuplicateOutput returns DXGI_ERROR_UNSUPPORTED.

I wrote a sample that gets all outputs and their videoadapters using winapi (EnumDisplayDevices function) & directx (IDXGIFactory::EnumAdapters method & IDXGIAdapter::EnumOutputs method) to compare on a machine with switchable graphics (Intel HD 4600 & NVIDIA 840M). This is the result:

enter image description here

Not sure how much correct is my may of comparison, but you can see that winapi says that DISPLAY1 belongs to Intel card and directx says DISPLAY1 belongs to NVIDIA card. One solution would be to duplicate the output of Intel card (because everything goes through it) but EnumOutputs returns no outputs for it.

Currently there is a workaround: always run an application that uses Duplication API using the integrated graphics controller.

The question: how to make DuplicateOutput work with the discrete graphics controller on a laptop with switchable graphics? Or it is a limitation of the Desktop Duplication API?

1
How is your workaround a workaround? If the desktop is running on the integrated card, wouldn't it make sense that you'd need to duplicate using that adapter to begin with? What's your goal in duplicating the desktop using the discrete adapter?MooseBoys
@MooseBoys, my goal is just duplicate the screen, it does not matter using which adapter. usage of the integrated or discrete adapter is determined by NVIDIA settings, not by me as a developer. by default for a heavy WPF app the discrete adapter will be selected and only its dxgi object will have the output (duplicating which returns DXGI_NOT_SUPPORTED because actually everything goes through the integrated adapter -- see the picture). so the workaround is to ask the user to force usage of Intel card in NVIDIA Control panel. and the question is whether there is a way without workaroundscyril.andreichuk

1 Answers

4
votes

solved:

unfortunately this issue occurs because the Desktop Duplication API does not support being run against the discrete GPU on a Microsoft Hybrid system. By design, the call fails together with error code DXGI_ERROR_UNSUPPORTED in such a scenario.

To work around this issue, run the application on the integrated GPU instead of on the discrete GPU on a Microsoft Hybrid system.

from here: https://support.microsoft.com/en-us/kb/3019314