Closed sfornengo closed 3 years ago
There are some filters using renering context & GPU (e.g. Ambient Occlusion), that were neeed as batch-able operations. This is why we had to include a rendering context in the initialization of MeshLabServer.
We do not have an "official" workaround for this.
A possible permanent fix could be to have a command-line parameter controlling if context-dependant filters are allowed or not. At the moment, however, this is not on our immediate priority queue. I'm sorry :( . We will announce when we will fix it.
~What worked for me, when trying to run meshlabserver headlessly, was to pass in the arguments -platform offscreen
. I got the idea from here: https://stackoverflow.com/questions/17979185/qt-5-1-qapplication-without-display-qxcbconnection-could-not-connect-to-displ~
~So I used /usr/bin/meshlabserver -platform offscreen <options>
.~
UPDATE: Never mind. That didn't end up working. Nor did the Xvfb solution from above, since it the OpenGL context doesn't load properly. It needs some additional settings.
After a full week of searching, here's the one liner that did work for me:
xvfb-run -a -s "-screen 0 800x600x24" meshlabserver <ARGS>
.
Also using meshlabserver on server. Hope an official solution will come out.
The solution using proposed by @alexsax did not work for me. If I run xvfb-run -a -s "-screen 0 800x600x24" meshlabserver <ARGS>
, meshlabserver immediately quits with the error GLEW Init: failed!
.
The other proposed option of using meshlabserver -platform offscreen
didn't work either. Without xvfb-run, I immediately ran into a Segmentation fault. Combining the two options, I obtained the following error:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 17
Current serial number in output stream: 18
In any case, I was not able to run meshlabserver
in headless mode. A fix or even a fork of meshlab without GUI support would be much appreciated!
The other proposed option of using
meshlabserver -platform offscreen
didn't work either.
This does not throw the original error of "Error in XMLFile: filter_measure.xml - line: -1, column: -1 - " for me but processing is never finished, takes forever and I end up killing it.
Using meshlabserver on a headless server doesn't work because of X dependency. However this is not expected. I found some proposed workarounds on the web:
- using Xvfb: https://sourceforge.net/p/meshlab/discussion/499532/thread/46e8b626/
- fix code: https://sourceforge.net/p/meshlab/discussion/499532/thread/6c3eebe2/ Is there a preferred way ? Waiting for a real fix... Did you try the second workaround? I want to try this workaround but don't know how to do that.
Additional info: even if the error is raised, the simplification (decimation) still works for meshes in .OBJ format, but fails for meshes in .STL format.
Loading Plugins:
Current Plugins Dir is: /usr/lib/meshlab/plugins
Error in XMLFile: filter_measure.xml - line: -1, column: -1 -
Error in XMLFile: filter_mutualinfo.xml - line: -1, column: -1 -
Using meshlabserver on a headless server doesn't work because of X dependency. However this is not expected. I found some proposed workarounds on the web: