cnr-isti-vclab / meshlab

The open source mesh processing system
http://www.meshlab.net
GNU General Public License v3.0
4.73k stars 822 forks source link

meshlabserver X dependency #78

Closed sfornengo closed 3 years ago

sfornengo commented 7 years ago

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:

mcallieri commented 7 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.

alexsax commented 7 years ago

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

RuibinMa commented 6 years ago

Also using meshlabserver on server. Hope an official solution will come out.

david-zwicker commented 6 years ago

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!

gerroon commented 5 years ago

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.

enjoybo commented 4 years ago

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:

science-code commented 4 years ago

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 -