OpenGL over Windows Remote 的当前状态和解决方案 [英] Current state and solutions for OpenGL over Windows Remote

查看:27
本文介绍了OpenGL over Windows Remote 的当前状态和解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案取决于用例,答案分散在网络的广阔深处.当我开始研究这个时,我希望这是一篇写给编码员和非编码员的文章.

Solutions for this are dependent on the use case and answers are fragmented across the vast depths of the net. This is a write-up I wish existed when I started researching this, both for coders and non-coders.

Windows 的 RDP 会话不会暴露显卡,至少不会直接暴露.例如,您无法更改桌面分辨率,而显卡驱动程序通常只是禁用它们的设置菜单.因此,启动高于 v1.1 的 OpenGL 上下文会失败.尤其是在支持 IRC 中,经常建议不要使用 WindowsRemote".不幸的是,这不是许多人的选择.在许多企业环境中,Windows Remote 是一种经常使用的工具,并且应用程序也必须在那里工作.

A RDP session of Windows does not expose the graphics card, at least not directly. For instance you cannot change the desktop resolution and GraphicsCard drivers usually just disable their setting menus. Starting a OpenGL context higher than v1.1 fails because of this. The, especially in support IRCs, often suggested "Don't use WindowsRemote" is unfortunately not an option for many. In many corporate environments Windows Remote is a constantly used tool and an app has to work there as well.

您可以启动 OpenGL 程序,让它看到显卡,创建一个 opengl 上下文,然后通过 WindowsRemote 连接.这总是有效的,因为 Windows 远程只是传输窗口内容.这可以通过以下方式完成:

You can start the OpenGL program, allowing it to see the graphics card, create an opengl context and then connect via WindowsRemote. This always works, as Windows remote just transfers the window content. This can be accomplished by:

  • 一个批处理脚本,用于关闭会话并启动程序,允许您连接到已运行的程序.(来源)
  • 使用VNC或其他方式远程进入机器,启动程序,然后切换到Windows Remote.(简单 VNC 程序,也带有 便携式客户端)
  • A batch script, that closes the session and starts the program, allowing you to connect to the program already running. (Source)
  • Using VNC or other to remote into the machine, start the program and then switch to Windows Remote. (Simple VNC programm, also with a portable client)

(仅适用于 OpenGL ES)将 OpenGL 转换为 DirectX.DirectX 在 Windows Remote 下完美运行,甚至在出现故障时在 DX11 中内置了软件渲染回退.

(Only for OpenGL ES)Translate OpenGL to DirectX. DirectX works under Windows Remote flawselly and even has a Software rendering fallback built into DX11 if something fails.

  • 使用 ANGLE 项目在运行时执行此操作.这就是 QT 官方建议你所做的以及 Chrome 和 Firefox 如何实现 WebGL.(来源)
  • Use the ANGLE Project to do this at run-time. This is what QT officially suggests you do and how Chrome and Firefox implement WebGL. (Source)

切换到软件渲染作为后备.例如,一些 CAD 软件(如 3dsMax)会这样做:

Switch to software rendering as a fall back. Some CAD software like 3dsMax does this for instance:

  • 在 SDL2 下,您可以使用 SDL_CreateSoftwareRenderer(Source)
  • 在 GLFW 3.3 版下将发布 OSMesa(Mesa 的离屏渲染),同时您可以使用 -DGLFW_USE_OSMESA=TRUE 构建 Github 版本,但我个人仍然很难让它运行(来源)
  • 直接使用 Mesa 的 LLVM 管道进行快速 OpenGL 实现.(来源)

杂项:

  • 使用 OpenGL 1.1:Windows 内置了 OpenGL 1.1 和早些时候.一些游戏引擎有一个内置的回退到这个,因此在 Windows Remote 下工作.
  • 显然有一个中间件,它甚至允许在 Windows Remote 上使用 OpenGL 4,但它是更大软件包的一部分,并且是一种商业解决方案.(来源)

非常感谢任何其他解决方案或更正.

Any other solutions or corrections are greatly appreciated.

[10] 英伟达 ->https://www.khronos.org/news/permalink/nvidia-provides-opengl-accelerated-remote-desktop-for-geforce-5e88fc2035e342.98417181

[10] Nvidia -> https://www.khronos.org/news/permalink/nvidia-provides-opengl-accelerated-remote-desktop-for-geforce-5e88fc2035e342.98417181

推荐答案

根据这篇文章 现在 RDP 似乎在 Windows 10 和 Windows Server 2016 上处理较新版本的 Direct3D 和 OpenGL,但默认情况下它被组策略禁用.

According to this article it seems that now RDP handles newer versions of Direct3D and OpenGL on Windows 10 and Windows Server 2016, but by default it is disabled by Group Policy.

我认为出于性能原因,使用硬件显卡已被禁用,而 RDP 使用仅提供一些基线功能的软件模拟显卡驱动程序.

I suppose that for performance reasons, using a hardware graphics card is disabled, and RDP uses a software-emulated graphics card driver that provides only some baseline features.

我在尝试通过 Windows 的标准远程桌面运行 Ultimaker CURA 时偶然发现了这个问题10 客户端到 Windows 10 主机.Cura 大喊无法初始化 OpenGL 2.0 上下文".我还注意到 Repetier Host 的预览"窗口运行速度非常慢,并且 Repetier 只检测到 OpenGL 1.1 卡.非常符合唯一基线功能"的描述.

I stumbled upon this problem when trying to run Ultimaker CURA over standard Remote Desktop from a Windows 10 client to a Windows 10 host. Cura shouted "cannot initialize OpenGL 2.0 context". I also noticed that Repetier Host's "preview" window runs terribly slow, and Repetier detects only an OpenGL 1.1 card. Pretty much fits the "only baseline features" description.

通过运行 gpedit.msc 然后导航到

By running gpedit.msc then navigating to

本地计算机策略计算机配置管理模板Windows 组件远程桌面服务远程桌面会话主机远程会话环境

Local Computer PolicyComputer ConfigurationAdministrative TemplatesWindows ComponentsRemote Desktop ServicesRemote Desktop Session HostRemote Session Environment

和改变的价值

为所有远程桌面服务会话使用硬件图形适配器

Use hardware graphics adapters for all Remote Desktop Services sessions

我能够成功运行 Ultimaker CURA via 没有任何问题,现在 Repetier-Host显示 OpenGL 4.6,一切最终都快速正常运行.

I was able to successfully run Ultimaker CURA via with no issues, and Repetier-Host now displays OpenGL 4.6, and everything finally runs fast as it should.

来自 genpfault 的注释:像往常一样,此策略保存在 HKLM 注册组中

Note from genpfault: As usual, this Policy is kept in the HKLM registry group in

HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindows NTTerminal Services

REG_DWORD:bEnumerateHWBeforeSW 设置为 1 以在 RDP 中使用 GPU 开启.

Set REG_DWORD:bEnumerateHWBeforeSW to 1 to turn ON using GPUs in RDP.

这篇关于OpenGL over Windows Remote 的当前状态和解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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