Desktop Duplication and C++ AMP incompatible?
<p>I want to capture and compress the screen on the GPU.  C++ AMP and DXGI Desktop Duplication each work individually, but don't seem to work together.</p>

<p><strong>Example:</strong></p>

<p><a href="https://code.msdn.microsoft.com/windowsdesktop/Desktop-Duplication-Sample-da4c696a" rel="nofollow noreferrer">This project</a> works great, but adding minimal C++ AMP code near the top of DesktopDuplication.cpp makes it fail:</p>

<pre><code>#include &lt;amp.h&gt;
//void f() { Concurrency::direct3d::create_accelerator_view( nullptr ); }
//void f() { Concurrency::accelerator default_acc; }
void f() { Concurrency::accelerator::get_all(); }
</code></pre>

<p>Even though <code>f()</code> is never called, <code>m_Factory-&gt;CreateSwapChainForHwnd(...)</code> returns <code>E_ACCESSDENIED</code>. (The commented versions of <code>f()</code> produce the same result.)</p>

<p>In my own project, <code>IDXGIOutput1::DuplicateOutput()</code> returns <code>DXGI_ERROR_UNSUPPORTED</code> when I attempt to use C++ AMP.</p>

<p>What's going on?</p>

<hr>

<p>Update: In the NVIDIA Control Panel, changing the "Preferred graphics processor" to "Integrated graphics" works. (But, using the NVIDIA card is <em>much</em> preferred.)</p>