Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EGL headless mode #1608

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

christopher-hesse
Copy link

Inspired by #786 this is a PR to support OSMesa-style headless rendering with EGL.

If you want to run an OpenGL program on a linux server you can run an X server with either hardware or software rendering. Configuring software rendering isn't too bad but hardware rendering can be a bit annoying and in either case you need to manage an X server process.

To run without an X server, you can use osmesa or EGL. OSMesa headless can be used by compiling GLFW with -DGLFW_USE_OSMESA=ON , but only supports software rendering. For hardware rendering, EGL can be used, but the existing code doesn't seem to quite support this setup.

This PR is a proof of concept for this mode (it's just hacked into egl_context.(h|c)) but if there is interest I could clean it up.

@@ -656,8 +732,12 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
_GLFW_OPENGL_LIBRARY,
#elif defined(_GLFW_WIN32)
#elif defined(_GLFW_COCOA)
#else
#if defined(_GLFW_EGLHEADLESS)
"libOpenGL.so.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear why this is necessary on my system. It could be glvnd or else my system is misconfigured somehow.

chaiyujin added a commit to chaiyujin/glfw that referenced this pull request Sep 1, 2020
copy from glfw#1608, which is not merged at this moment
@vchuravy
Copy link

Having this would be fantastic! Especially for scientific applications rendering on a server.

@kivutar
Copy link

kivutar commented May 6, 2021

This would also be useful for automated testing

@aramirezreyes
Copy link

Oh, this would be nice :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants