【问题标题】:Problem with OpenGL through SSH connection通过 SSH 连接的 OpenGL 问题
【发布时间】:2020-05-29 10:58:44
【问题描述】:

我正在尝试在客户端/服务器模式下使用软件 (Paraview) 在我的台式机 (linux、debian 10) 上打开客户端并在远程服务器 (linux、CentOS 8) 上进行繁重的计算。该软件需要 OpenGL 3.2 或更高版本的实现,从下面显示的命令 glxinfo 的输出中可以看到,我的机器上安装的软件应该没问题:

myaccount@desktopmachine:$ glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: *GeForce GTX 650 Ti BOOST/PCIe/SSE2 OpenGL core*
profile version string: 4.6.0 NVIDIA 440.82 OpenGL core profile
shading language version string: 4.60 NVIDIA OpenGL core profile
context flags: (none) OpenGL core profile profile mask: core profile
OpenGL core profile extensions: OpenGL version string: 4.6.0 NVIDIA
440.82 OpenGL shading language version string: 4.60 NVIDIA OpenGL context flags: (none) OpenGL profile mask: (none) OpenGL extensions:
OpenGL ES profile version string: **OpenGL ES 3.2** NVIDIA 440.82 OpenGL
ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

问题是,当通过 SSH 连接到远程服务器时,同一命令产生的 OpenGL 是:

myaccount@server:$ glxinfo | grep "OpenGL"
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: *GeForce GTX 650 Ti BOOST/PCIe/SSE2 OpenGL*
version string: **1.4** (2.1.2 NVIDIA 440.82) OpenGL extensions:

所以看起来OpenGL的版本没有正确传输。 我应该怎么做才能解决这个不允许我运行软件的问题?

【问题讨论】:

    标签: linux opengl opengl-es paraview


    【解决方案1】:

    SSH 隧道 X11。 GLX 是做 OpenGL 的 X11 协议扩展,也是将 OpenGL 调用封装到 X11 中的协议,然后通过 SSH 进行隧道传输。

    事情是这样的:

    GLX 只能升级到 OpenGL-1.4(https://www.khronos.org/registry/OpenGL/specs/gl/glx1.4.pdf 第 49 页)。除此之外的所有内容仅由 直接渲染 上下文支持,而 GLX 仅用于设置上下文,但从那里开始,所有与 OpenGL-3.x 及更高版本相关的内容都会绕过 GLX 并直接进入驱动程序。

    当然,理论上 GLX 可以更新为支持 OpenGL-3 及更高版本。但没人打扰。

    您现在的选择是在远程端运行所有内容并仅传输渲染结果。理想情况下,这将通过应用程序创建一个 X-less、无头 OpenGL 上下文,然后将渲染结果复制到 X11 SHM 像素图中来完成(但是在您的典型网络上性能将非常糟糕)。

    我首选的解决方案是使用 Xpra,在远端使用 GPU。

    【讨论】:

    • xpra 解决了我的问题
    【解决方案2】:

    在 ParaView 和 pvserver 的上下文中,您需要使用本地显示,而不是“X11 转发”机制。

    不要在连接时使用-X-Y,然后运行DISPLAY=:0 glxinfoDISPLAY=:0 pvserver。在你的服务器上

    【讨论】:

      猜你喜欢
      • 2021-04-07
      • 2019-11-18
      • 2021-06-18
      • 2016-03-16
      • 2017-04-17
      • 2013-10-29
      • 1970-01-01
      • 2020-09-19
      • 1970-01-01
      相关资源
      最近更新 更多