Score:1

how to check and confirm a right opengl version with vcxsrv (for using ros2 rviz2)

my flag

i have a remote-host (ubuntu 20.04),

and a local-host (win10 pc, with nv rtx3050ti gpu, updated driver), i started vcxsrv on local-host by(win\cmd):
vcxsrv.exe -multiwindow -clipboard -wgl -ac

then with win\cmd on local-host, i ssh to remote by:

set DISPLAY=localhost:0.0
ssh -Y username@remote-ip

i don't know why it first need set DISPLAY... in cmd then ssh -Y, but it works for the started vcxsrv to display something, e.g., xclock or rqt (one of ros2's gui tools) will display as expected on local-host.

but when i try to start rviz2 (another ros2's gui tool), on ssh\bash i got error like:

...
[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

among which, the key-error should be:

RenderingAPIException: OpenGL 1.5 is not supported in GLRenderSystem

i understand it's something with the opengl version, so i checked the followings, but still found nothing can further do, any help would be appreciate, thx:

glxinfo -B in the ssh prompt(ssh\bash) on local-host(with set DISPLAY... and 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)

then as some suggested, i tried (on ssh\bash)

export LIBGL_ALWAYS_INDIRECT=1
export MESA_GL_VERSION_OVERRIDE=3.3

then got (libGL error disappeared)

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 the ssh\bash (without set DISPLAY... and ssh -Y, just ssh):

Error: unable to open display

directly glxinfo -B in the terminal in remote-host(ubuntu20.04\bash):

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

i know nothing much about how x11/vcxsrv/opengl works, but don't understand why the opengl version is different when i check directly in remote-host or with ssh in local-host.

since other graphic-ui could displayed as expect(xclock, rqt of ros2), but rviz2 of ros2 could not, i think it's the dependency of rviz2 with opengl, but why and how to ensure the right opengl version for my case/env?

thx

David avatar
cn flag
To be clear all these commands and errors are being run on a Windows machine?
furynerd avatar
my flag
hi, these cmds and errors are from `win\cmd`(direct at local win-host), `ssh\bash` (sshed to the remote linux-host), and `remote ubuntu\bash`(direct on the remote-linux-host), to make them more clear, i already edited the question
Score:0
my flag

glad to figure it out, not theoretically clear but quite practical, should start the vcxsrv on local-host (win10) side (win/cmd) with:

vcxsrv.exe  -multiwindow -clipboard -nowgl -ac

where, should use -nowgl other than -wgl at the beginning

furynerd avatar
my flag
update for remote server use-case(ssh with mobaxterm), maybe `sudo apt-get install libosmesa6-dev` should need, as `https://answers.ros.org/question/210688/rviz-and-opengl/`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.