lwjgl
lwjgl copied to clipboard
Allow using lwjgl without display mode extension
I'm trying to get lwjgl running on a headless server with xvfb/Mesa, mainly for continuous integration (Travis CI). The problem is that neither Xrandr nor XF86VidMode are available which is perfectly fine as I do offscreen rendering anyway.
Is it possible to offer a system property where one can say whether it's allowed to run without display mode extension? Similar to org.lwjgl.opengl.Display.allowSoftwareOpenGL=true.
@neothemachine, I am trying to get LWJGL running in Travis CI as well; were you able to figure out a workaround?
Sorry no, in the end I switched to JOGL.
no updates for this? I am trying to do some work on Amazon G2 GPU instance. It feels that I have similar issue - org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes throw null pointer exception when setting up application, while glxgears works perfectly so GLX and OpenGL is working fine.
I'm afraid LWJGL 2 is not actively maintained anymore. Other than critical bug fixes, there won't be any features added, unless someone submits a pull request.
For this particular case, my recommendation would be to use LWJGL 3. I have used it on an Amazon GPU instance with no issues. LWJGL 3 uses GLFW for windows/contexts, which is much more robust than the Display implementation in LWJGL 2.
My apologies for repurposing this (old) issue for a question. I am working with LWJGL3 and was wondering how you (@Spasi) set it up to work in headless mode. Is any of this documented somehwere?
GLFW has GLFW_OSMESA_CONTEXT_API now, which you can use in glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_OSMESA_CONTEXT_API). It is meant to be used for headless rendering.
You will also find useful information in the GLFW issues related to headless.
@Spasi I ended up using LWJGL's EGL bindings as OSMesa only provides software rendering using the OpenGL 2.x API
@edwinRNDR Would you be able to post a sample of this working?
@MadcowD I have some code from a larger codebase that comes with an EGL back-end, you can find it here: https://github.com/openrndr/openrndr/blob/master/openrndr-gl3/src/main/kotlin/org/openrndr/internal/gl3/ApplicationEGLGL3.kt
@edwinRNDR how did you avoid using GLFW?
@MadcowD you create the GL context using EGL, like in the code I linked prior.