Rendering vision sensors on a remote cluster

Typically: "How do I... ", "How can I... " questions
Post Reply
eomar
Posts: 4
Joined: 25 Mar 2020, 10:31

Rendering vision sensors on a remote cluster

Post by eomar »

Hi,

As part of my project, I am currently trying to render images with vision
sensors on a remote cluster while running CoppeliaSim headlessly. I seem to
be facing an issue with OpenGL rendering of the vision sensors, which
immediately causes the following crash:

Code: Select all

@@
lib: 1
lic: 1

CoppeliaSim Edu V4.0.0. (rev. 4)
Using the default Lua library.
Add-on script 'simAddOnScript-addOnScriptDemo.lua' was loaded.
Add-on script 'simAddOnScript-b0RemoteApiServer.lua' was loaded.
Add-on script 'simAddOnScript_PyRep.lua' was loaded.
Simulator launched.
Plugin 'Geometric': loading...
Plugin 'Geometric': load succeeded.
Plugin 'Assimp': loading...
Plugin 'Assimp': warning: replaced variable 'simAssimp'
Plugin 'Assimp': load succeeded.
Plugin 'BlueZero': loading...
Plugin 'BlueZero': warning: replaced variable 'simB0'
Plugin 'BlueZero': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Bwf': loading...
Plugin 'Bwf': load succeeded.
Plugin 'CodeEditor': loading...
CodeEditor: cannot load in headless mode
Error with plugin 'CodeEditor': load failed (failed initialization).
Plugin 'Collada': loading...
CoppeliaSim runs in headless mode. Cannot start 'Collada' plugin.
Error with plugin 'Collada': load failed (failed initialization).
Plugin 'ConvexDecompose': loading...
Plugin 'ConvexDecompose': load succeeded.
Plugin 'CustomUI': loading...
CustomUI: doesn't work in headless mode
Error with plugin 'CustomUI': load failed (failed initialization).
Plugin 'DynamicsBullet-2-78': loading...
Plugin 'DynamicsBullet-2-78': load succeeded.
Plugin 'DynamicsBullet-2-83': loading...
Plugin 'DynamicsBullet-2-83': load succeeded.
Plugin 'DynamicsNewton': loading...
Plugin 'DynamicsNewton': load succeeded.
Plugin 'DynamicsOde': loading...
Plugin 'DynamicsOde': load succeeded.
Plugin 'DynamicsVortex': loading...
Plugin 'DynamicsVortex': load succeeded.
Plugin 'ExternalRenderer': loading...
Plugin 'ExternalRenderer': load succeeded.
Plugin 'ICP': loading...
Plugin 'ICP': warning: replaced variable 'simICP'
Plugin 'ICP': load succeeded.
Plugin 'Image': loading...
Error with plugin 'Image': load failed (could not load). The plugin probably couldn't load dependency libraries. For additional infos, modify the script 'libLoadErrorCheck.sh', run it and inspect the output.
Plugin 'K3': loading...
Plugin 'K3': load succeeded.
Plugin 'Lic': loading...
Plugin 'Lic': load succeeded.
Plugin 'LuaCommander': loading...
LuaCommander: cannot find the statusbar widget
Error with plugin 'LuaCommander': load failed (failed initialization).
Plugin 'LuaRemoteApiClient': loading...
Plugin 'LuaRemoteApiClient': load succeeded.
Plugin 'Mtb': loading...
Plugin 'Mtb': load succeeded.
Plugin 'OMPL': loading...
Plugin 'OMPL': warning: replaced variable 'simOMPL'
Plugin 'OMPL': load succeeded.
Plugin 'OpenGL3Renderer': loading...
Plugin 'OpenGL3Renderer': load succeeded.
Plugin 'OpenMesh': loading...
Plugin 'OpenMesh': load succeeded.
Plugin 'Qhull': loading...
Plugin 'Qhull': load succeeded.
Plugin 'RRS1': loading...
Plugin 'RRS1': load succeeded.
Plugin 'ReflexxesTypeII': loading...
Plugin 'ReflexxesTypeII': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Plugin 'SDF': loading...
SDF: doesn't work in headless mode
Error with plugin 'SDF': load failed (failed initialization).
Plugin 'SurfaceReconstruction': loading...
Plugin 'SurfaceReconstruction': warning: replaced variable 'simSurfRec'
QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled
Falling back to using screens root_visual.
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled


Error: signal 11:

/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_Z11_segHandleri+0x28)[0x2b77c13fb2f8]
/lib64/libc.so.6(+0x362f0)[0x2b776aab12f0]
/lib64/libc.so.6(+0x16eff1)[0x2b776abe9ff1]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_Z15initGl_ifNeededv+0x110)[0x2b77c15af880]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_ZN19COffscreenGlContextC1EiiiP9QGLWidgetii+0x92)[0x2b77c15fa4a2]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_ZN20CVisionSensorGlStuffC2EiiibP9QGLWidgetbbii+0x74)[0x2b77c15fb224]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_ZN13CVisionSensor45createGlContextAndFboAndTextureObjectIfNeededEb+0x153)[0x2b77c12c3bc3]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_ZN13CVisionSensor13detectEntity2Eibbbb+0x1c6)[0x2b77c12c3df6]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_ZN13CVisionSensor44detectVisionSensorEntity_executedViaUiThreadEibbbb+0x75)[0x2b77c12c4005]
/cluster/home/eomar/CoppeliaSim_Edu_V4_0_0_Ubuntu16_04/libcoppeliaSim.so.1(_ZN9CUiThread27__executeCommandViaUiThreadEP16SUIThreadCommandS1_+0x2434)[0x2b77c1563924]
QMutex: destroying locked mutex
Plugin 'SurfaceReconstruction': load succeeded.
Plugin 'Urdf': loading...
CoppeliaSim runs in headless mode. Cannot start 'Urdf' plugin.
Error with plugin 'Urdf': load failed (failed initialization).
Plugin 'Vision': loading...
Plugin 'Vision': load succeeded.
Using the 'Geometric' plugin.
Initializing the ODE physics engine in plugin 'DynamicsOde'...
Engine version: 0.12
Plugin version: 12
Initialization successful.
ERROR: Failed creating an offscreen QOpenGLContext. Switching to a hidden QGLWidget.
To give more context, I am running CoppeliaSim 16.04 together with PyRep on
a cluster. I am able to run CoppeliaSim headlessly on the cluster using
Xvfb/xvfb-run when there are no vision sensors in the scene. When I add the
vision sensors, then the simulator crashes because the OpenGL context
platform cannot be created. I am not sure if this issue has to do with Qt
(it seems to load all of the plugins) or a missing configuration on the
cluster (related to GLX/EGL).

I have tried some fixex recommended in these other threads without success:
- https://forum.coppeliarobotics.com/viewtopic.php?t=1319
- https://forum.coppeliarobotics.com/viewtopic.php?t=8291

While a missing/incomplete configuration seems more likely, I was able to verify that GLX is enabled and available on the cluster using glxinfo/glxgears. From what I understand, the GLX extension should be available, but for some reason CoppeliaSim does not find it. Do you have an idea why this would happen?

Thanks a lot in advance,
Omar

eomar
Posts: 4
Joined: 25 Mar 2020, 10:31

Re: Rendering vision sensors on a remote cluster

Post by eomar »

Hi,

It turns out that the issue was due to an incomplete configuration on the cluster. Since I had to use Xvfb to run CoppeliaSim headlessly and Xvfb only supports software rendering, the crash happened because the libraries that support software rendering were not fully installed.

In my case, the cluster is running CentOS 7 and the relevant packages are mesa-libGL and mesa-dri-drivers. Installing them makes it possible to render vision sensor images in CoppeliaSim.

Closing this now as the issue is resolved. Thanks,
Omar

coppelia
Site Admin
Posts: 7977
Joined: 14 Dec 2012, 00:25

Re: Rendering vision sensors on a remote cluster

Post by coppelia »

Thanks for the precision Omar. Your first messages somehow slipped through...

Cheers

Post Reply