# GLFW with EGL and OSMesa

**URL:** <https://discourse.glfw.org/t/glfw-with-egl-and-osmesa/1574>\
**Category:** support\
**Created:** [May 28, 2020, 10:12pm UTC](https://discourse.glfw.org/t/glfw-with-egl-and-osmesa/1574 "2020-05-28T22:12:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tovacinni](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/tovacinni/32/349_2.png) [@tovacinni](https://discourse.glfw.org/u/tovacinni)\
**Post date:** [May 28, 2020, 10:12pm UTC](https://discourse.glfw.org/t/glfw-with-egl-and-osmesa/1574/1 "2020-05-28T22:12:40Z")

</div>

Looking at some past threads and the official documentation seems to indicate that GLFW does not support headless mode rendering. However, GLFW does seem to support OSMesa and EGL. Does this mean that if I use EGL and OSMesa together, I can bypass X11 completely and render in headless mode? I tried to compile GLFW using this configuration but did not seem to compile.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [May 29, 2020, 9:40am UTC](https://discourse.glfw.org/t/glfw-with-egl-and-osmesa/1574/2 "2020-05-29T09:40:49Z")

</div>

OSMesa is supported, there are some dependencies required:  
[https://www.glfw.org/docs/3.3/compile\_guide.html#compile\_deps\_osmesa](https://www.glfw.org/docs/3.3/compile_guide.html#compile_deps_osmesa)

---

<div class="post-metadata">

**Author:** ![mmozeiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/mmozeiko/32/29_2.png) [@mmozeiko](https://discourse.glfw.org/u/mmozeiko)\
**Post date:** [May 29, 2020, 10:03am UTC](https://discourse.glfw.org/t/glfw-with-egl-and-osmesa/1574/3 "2020-05-29T10:03:14Z")

</div>

@tovacinni - and if you use OSMesa then you do not need to use EGL. OSMesa provides its own functions to create GL context. Also I hope you understand that you won’t get and GPU acceleration with OSMesa - that is purely software rendering with GL API.

If you want real GPU accelerated GL context without X11/Wayland, then you need to look into using EGL over DRM. There was glfw pull request some time ago that implemented this: [https://github.com/glfw/glfw/pull/786](https://github.com/glfw/glfw/pull/786) There was also newer pull request [https://github.com/glfw/glfw/pull/1608](https://github.com/glfw/glfw/pull/1608) But I don’t know which one works or is better.

---

<div class="post-metadata">

**Author:** ![tovacinni](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/tovacinni/32/349_2.png) [@tovacinni](https://discourse.glfw.org/u/tovacinni)\
**Post date:** [May 29, 2020, 7:02pm UTC](https://discourse.glfw.org/t/glfw-with-egl-and-osmesa/1574/4 "2020-05-29T19:02:14Z")

</div>

Thanks for the pointers. EGL over DRM sounds like exactly what we need- is there any reason why those pull requests have not been merged yet? Is headless rendering via EGL over DRM a feature that is planned to be supported by GLFW?
