DirectX11桌面复制不适用于NVIDIA [英] DirectX11 Desktop duplication not working with NVIDIA

查看:485
本文介绍了DirectX11桌面复制不适用于NVIDIA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也尝试使用



我还发现了有关stackoverflow的答案明确表明,使用支持复制功能的桌面复制API无法完成此操作微软支持网站上的票据 https://support.microsoft.com/en-us/help/3019314/error-generated-when-desktop-duplication-api-capable-application-is-ru



票中的报价




之所以会发生此问题,是因为DDA不支持在Microsoft Hybrid系统上针对
的离散GPU运行。按照设计,在这种
情况下,调用
会失败,并显示错误代码DXGI_ERROR_UNSUPPORTED。


某些应用程序可以在我的机器上同时以两种模式(集成图形和离散)在Windows上有效地复制桌面。 ( https://www.youtube.com/watch?v=bjE6qXd6Itw



我已经查看了计算机上 Virtual Desktop 的安装文件夹,并可以看到以下感兴趣的DLL

  SharpDX.D3DCompiler.dll 
SharpDX.Direct2D1.dll
SharpDX.Direct3D10.dll
SharpDX.Direct3D11.dll
SharpDX.Direct3D9.dll
SharpDX.dll
SharpDX.DXGI.dll
SharpDX.Mathematics。 dll

这可能表明该应用程序正在使用DXGI复制桌面,或者可能是



无论如何,问题仍然存在,在这两种模式下是否还有其他有效的台式机复制方法?

解决方案

可能的原因是桌面复制API的某些内部限制,如针对独立GPU运行支持桌面复制API的应用程序时生成错误


...当应用程序尝试针对Microsoft Hybrid系统上的离散GPU复制桌面映像时,该应用程序可能无法正确运行,或者可能会产生以下错误之一:




  • 无法使用0x80070005创建Windows交换链

  • CDesktopCaptureDWM:IDXGIOutput1 :: DuplicateOutput失败:0x887a0004


本文并未建议其他解决方法,只是使用了不同的GPU(没有更详细的信息


要变通解决此问题,请在集成GPU而不是离散GPU上运行应用程序在Microsoft混合系统上。



I'm trying too use DirectX desktop duplication API.

I tried running exmaples from

http://www.codeproject.com/Tips/1116253/Desktop-Screen-Capture-on-Windows-via-Windows-Desk

And from

https://code.msdn.microsoft.com/windowsdesktop/Desktop-Duplication-Sample-da4c696a

Both of these are examples of screen capture using DXGI.

I have NVIDIA GeForce GTX 1060 with Windows 10 Pro on the machine. It has Intel™ Core i7-6700HQ processor.

These examples work perfectly fine when NVIDIA Control Panel > 3D Settings is selected to Auto select processor.

However if I set the setting manually to NVIDIA Graphics Card the samples stop working.

Error occurs at the following line.

//IDXGIOutput1* DxgiOutput1
hr = DxgiOutput1->DuplicateOutput(m_Device, &m_DeskDupl);

Error in hr(HRESULT) is DXGI_ERROR_UNSUPPORTED 0x887A0004

I'm new to DirectX and I don't know the issue here, is DirectX desktop duplication not supported on NVIDIA ?

If that's the case then is there a way to select a particular processor at the start of program so that program can run with any settings ?

#Edit

After looking around I asked the developer (Evgeny Pereguda) of the second sample project on codeproject.com

Here's a link to the discussion https://www.codeproject.com/Tips/1116253/Desktop-Screen-Capture-on-Windows-via-Windows-Desk?msg=5319978#xx5319978xx

Posting the screenshot of the discussion on codeproject.com in case original link goes down

I also found an answer on stackoverflow which unequivocally suggested that it could not be done with the desktop duplication API referring to support ticket at microsoft's support site https://support.microsoft.com/en-us/help/3019314/error-generated-when-desktop-duplication-api-capable-application-is-ru

Quote from the ticket

This issue occurs because the DDA 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.

However there are some applications which are efficiently duplicating desktop on windows in both modes (integrated graphics and discrete) on my machine. (https://www.youtube.com/watch?v=bjE6qXd6Itw)

I have looked into the installation folder of the Virtual Desktop on my machine and can see following DLLs of interest

SharpDX.D3DCompiler.dll
SharpDX.Direct2D1.dll
SharpDX.Direct3D10.dll
SharpDX.Direct3D11.dll
SharpDX.Direct3D9.dll
SharpDX.dll
SharpDX.DXGI.dll
SharpDX.Mathematics.dll

Its probably an indication that this application is using DXGI to duplicate desktop, or may be the application is capable of selecting a specific processor before it starts.

Anyway the question remains, is there any other efficient method of duplicating desktop in both modes?

解决方案

The likely cause is certain internal limitation for Desktop Duplication API, described in Error generated when Desktop Duplication API-capable application is run against discrete GPU:

... when the application tries to duplicate the desktop image against the discrete GPU on a Microsoft Hybrid system, the application may not run correctly, or it may generate one of the following errors:

  • Failed to create windows swapchain with 0x80070005
  • CDesktopCaptureDWM: IDXGIOutput1::DuplicateOutput failed: 0x887a0004

The article does not suggest any other workaround except use of a different GPU (without more specific detail as for whether it is at all achievable programmatically):

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

这篇关于DirectX11桌面复制不适用于NVIDIA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆