EGL implementation for Window and Linux

I’m looking to use EGL to do headless rendering to a framebuffer in both Linux and Windows. The ultimate goal is to develop a program that will run on the Amazon cloud where it will have access to an NVIDIA GPU, but not necessarily a windowing system. The output would be sent out in a video stream. I would also like to be able to run the same code in Windows as well. I guess technically it doesn’t have to be a cross-platform implementation, as long as the Linux and Windows implementations are both EGL compliant.

I’m looking for an EGL implementation(s) to help me do this, but am having a hard time. What I have found:
[li]The Khronos website lists an implementation called Pablo, but the link is dead. I couldn’t find any more information about this.
[/li][li]McNopper has an implementation on github, but it looks incomplete with the caveat that is in the early stage and not well tested.
[/li][li]Various OpenGL ES emulators seem to implement EGL, such as ARM, Imagination Tech, Qualcomm, and Angles. But I think I want a native solution, not an emulation.
[/li][li]On Linux, Mesa libraries support EGL. It’s unclear to me if this is a software only solution, meaning that it doesn’t actually use the GPU.
[/li][li]On Windows, GLFW can do a hidden window, but this isn’t exactly the same.

I’ve seen plenty of example code on how to right an EGL application, but I can’t find the actual EGL implementation. Can someone help a confused person?


You will need to look at the AWS OpenGL API. A OpenGL implementation must be paired with a EGL/WGL/CGL/GLX or similar API that creates the contexts that OpenGL uses for rendering. You can’t just provide your own. EGL hooks into the internals of OpenGL to create Contexts, DefaultFramebuffers, Fences, and such. It also hooks into the platform window system to put your content into a window. I did a quick look at AWS and didn’t see it immediately.
Second, you will need to get the rendered buffers out of OpenGL. glReadPixels is the only common function. There is EGL_KHR_lock_surface - but this extension is not commonly implemented in all implementations. There may be “native” images that can create EGLImage that then can be used as a texture to a FBO. Here you have direct access to the buffer. But this is not common across platforms.
Finally, your rendered content/buffer has to be formatted for video stream. Again, the render to YUV format is an extension, so may not be common to all the platforms you want.
Interesting project, but you are trying to use OpenGL in non-common way, hence the barriers. First look into AWS to see what it provides to access the rendered buffers.
If you find a link to AWS EGL features, then I might be able to make suggestions. I’ll look if I get time.

So AWS provides GPUs with OpenGL support. EGL is for OpenGLES. AWS will have to provide WGL or similar API. Their documentation is very high level and its not easy to get these details.

NVidia’s Linux graphics drivers support EGL, which you can use to create OpenGL contents.

EGL Eye: OpenGL Visualization without an X Server

I haven’t done more than kick the tires with it, but it is there and does work.

Thanks for the replies, I’ve been looking into this more. It does look like Linux is covered with NVidia’s drivers, and perhaps AWS too. But I haven’t found anything for Windows, does such an implementation exist?

Thanks for your answers, they are very helpful.