gl_depth_sim icon indicating copy to clipboard operation
gl_depth_sim copied to clipboard

Running this package headlessly?

Open haudren opened this issue 4 years ago • 3 comments

Hello,

Is it possible to run this package entirely headlessly? By that I mean on a server machine and without any display connected. I think the use of GLFW makes it difficult, but I was wondering if anyone had run into similar issues.

Maybe it would be useful as well for #13 ?

Thanks!

haudren avatar May 06 '21 07:05 haudren

I haven't ever tried running this package headless, but this GLFW documentation indicates that it's possible to create a context with a hidden window that never gets displayed. This might be close to what you're looking for

marip8 avatar May 06 '21 18:05 marip8

This is a little bit different: as far as I understand this still creates a window and will crash if there is no display connected.

Indeed this seems to be already set: https://github.com/Jmeyer1292/gl_depth_sim/blob/6a810a869dd4ec7dacb54b104fc8aa4ee3986860/src/gl_depth_sim/sim_depth_camera.cpp#L156

But if you run unset DISPLAY to simulate a headless environment, the examples crash with:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to create GLFW window

I will have a look and see if it's possible to replace GLFW with regular EGL, as is done in pyrender.

haudren avatar May 07 '21 00:05 haudren

As a follow-up to this issue, I have created a fork here: https://github.com/ascentai/gl_depth_sim

The main differences are:

  • I merged #12 because it was easier for testing
  • I removed the GLFW dependency and replaced it with EGL

This allows to run headlessly, and solves my use case. I'm ready to PR back here, but those are fairly changes, would you be open to merging?

haudren avatar May 12 '21 07:05 haudren