EGL OpenGL headless rendering

Discussion in 'Visualization' started by arpit, Jan 13, 2018.

  1. I am trying to the EGL OpenGL rendering to remove dependency on X11 for my server. I installed the nvidia driver with --install-libglvnd option. I compile the record.cpp with egl. After compilation, I get the following error
    ERROR: Could not initialize EGL, error 0x3003
    I tried to track the error in record.cpp. The error is in initialization of the EGL display in line 112. The error code suggests that it a bad allocation error as per EGL/egl.h here. However I wasn't able to resolve it or track down the source of the problem further.

    Ubuntu- 17.04
    Nvidia driver - 375.26
    $echo $DISPLAY
    localhost:12.0

    Could the team post the libraries required to do headless rendering on clusters? Detailed instructions the setup used to verify headless rendering would be super helpful to setup for others as well.

    Thank you
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    This sounds like a generic X11/EGL/NVidia issue unrelated to MuJoCo. Can you try to initialize EGL and open a rendering context without using MuJoCo? This is the best way to track down rendering issues on a specific system.

    Are you linking with the EGL version of GLEW btw? That is essential.
     
  3. I used `g++ $(COMMON) -DMJ_EGL record.cpp -lmujoco150 -lGL -lEGL -lglewegl -o ../bin/recordegl` to compile. This build record.cpp with egl version of glew. I will try to compile the a EGL program and check if that is the problem independent of mujoco. However it might be really useful to give full instructions of how to install other libraries like EGL in the system might be really helpful as well.
     
  4. Emo Todorov

    Emo Todorov Administrator Staff Member

    This usually works, but there are corner cases apparently, and I agree it will be useful to document them all. However I cannot spend my time doing the work of the EGL/Ubuntu/NVidia developers. Linux is great as a server with a text console, but putting UI and graphics on top it has led to a sequence of unfortunate events. See also the threads on this forum about recent NVidia drivers breaking GLFW on Linux. To be fair, NVidia drivers also broke Windows Vista at the time, but this was cleaned up 10 years ago while in the world of Linux there is no end in sight.
     
  5. I completely understand that its difficult to write all the instructions for all the libraries used. I apologize if I sounded rude. The error is indeed in EGL display getter. I am still trying to debug it by using a code which just uses EGL. I will post the solution as soon as I am able to run the things properly.