我有一个远程主机(ubuntu 20.04),
和一个本地主机(win10 pc,带有nv rtx3050ti gpu,更新的驱动程序),我在本地主机by(win\cmd
)上启动了vcxsrv
:vcxsrv.exe -multiwindow -clipboard -wgl -ac
。
然后,使用本地主机上的win\cmd
,我可以通过以下方式远程处理:
set DISPLAY=localhost:0.0
ssh -Y username@remote-ip
我不知道为什么它首先需要set DISPLAY...
中的cmd
,然后是ssh -Y
,但是它可以让已启动的vcxsrv
显示一些东西,例如xclock
或rqt
(ros2 2‘S gui工具之一)将按预期在本地主机上显示。
但是,当我尝试启动rviz2
(另一个ros2 2‘S gui工具)时,在ssh\bash
上我得到了如下错误:
...
[ERROR] [1665571456.729849309] [rviz2]: RenderingAPIException: OpenGL 1.5 is not supported in GLRenderSystem::initialiseContext at /tmp/binarydeb/ros-galactic-rviz-ogre-vendor-8.5.1/.obj-x86_64-linux-gnu/ogre-v1.12.1-prefix/src/ogre-v1.12.1/RenderSystems/GL/src/OgreGLRenderSystem.cpp (line 1201)
...
...
...
terminate called after throwing an instance of 'std::runtime_error'
what(): Unable to c
其中,关键错误应该是:
RenderingAPIException: OpenGL 1.5 is not supported in GLRenderSystem
我知道这是opengl版本的一些东西,所以我检查了下面的内容,但是仍然发现没有什么可以做进一步的,任何帮助都会很感激。
glxinfo -B
在本地主机上的ssh提示符(ssh\bash
)中(带有set DISPLAY...
和ssh -Y
):
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
name of display: localhost:10.0
display: localhost:10 screen: 0
direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2
OpenGL version string: 1.4 (4.6.0 NVIDIA 512.96)
然后,正如一些人建议的那样,我尝试了(在ssh\bash
上)
export LIBGL_ALWAYS_INDIRECT=1
export MESA_GL_VERSION_OVERRIDE=3.3
然后got (libGL error
消失了)
name of display: localhost:10.0
display: localhost:10 screen: 0
direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2
OpenGL version string: 1.4 (4.6.0 NVIDIA 512.96)
glxinfo -B
in ssh\bash
(没有set DISPLAY...
和ssh -Y
,只是ssh
):
Error: unable to open display
在远程主机(ubuntu20.04\bash
)的终端中直接使用D31
:
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa/X.org (0xffffffff)
Device: llvmpipe (LLVM 12.0.0, 256 bits) (0xffffffff)
Version: 21.0.3
Accelerated: no
Video memory: 31893MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.0.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.1 Mesa 21.0.3
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
我对x11/vcxsrv/opengl的工作原理不太了解,但是当我在远程主机中检查directly
或在本地主机中使用ssh
时,我不明白为什么opengl版本是不同的。
由于其他图形用户界面可以显示为expect(xclock
,rqt
of ros2
),但rviz2
of ros2
不能,我认为这是rviz2
与opengl
的依赖,但为什么和如何确保正确的opengl版本适合我的情况/env?
thx
发布于 2022-10-13 03:08:25
很高兴弄清楚,理论上不太清楚,但很实际,应该从vcxsrv
on local-host
(win10) side (win/cmd
)开始:
vcxsrv.exe -multiwindow -clipboard -nowgl -ac
应该在开始时使用-nowgl
而不是-wgl
。
https://askubuntu.com/questions/1435037
复制相似问题