Skip to content

fix(linux): reach the GPU headless through Mesa's surfaceless platform - #26

Merged
dsafdsaf132 merged 1 commit into
dsafdsaf132:mainfrom
jerryryle:fix/headless-surfaceless-display
Oct 26, 2026
Merged

dsafdsaf132 merged 1 commit into
dsafdsaf132:mainfrom
jerryryle:fix/headless-surfaceless-display

Conversation

@jerryryle

Copy link
Copy Markdown
Contributor

Thank you for node-gles-webgl2! I'm using it in a personal project to give Node processes WebGL2 on a Raspberry Pi 5 with no display server (Raspberry Pi OS Lite, Debian 13, kernel 6.18, Mesa 26.2.2, Node 26.7.0). I ran into a couple of issues that I patched in my own fork, but I thought I'd offer them upstream in case they're useful to others. This PR is the first of two.

With neither DISPLAY nor WAYLAND_DISPLAY set, every hardware backend failed with "Could not open the default X display", because ANGLE's default display needs X11. A headless Linux process now tries ANGLE's OpenGL ES backend first and puts every candidate on Mesa's surfaceless platform, the attribute the SwiftShader path already uses. A process with a display keeps the old order and the old display.

Tested on a Raspberry Pi 5 (Raspberry Pi OS Lite, Mesa 26.2.2) with no display server: the context reports OpenGL ES 3.0 on V3D 7.1, and webgl2-smoke, swiftshader-smoke and three-smoke pass.

With neither DISPLAY nor WAYLAND_DISPLAY set, every hardware backend failed
with "Could not open the default X display", because ANGLE's default display
needs X11. A headless Linux process now tries ANGLE's OpenGL ES backend first
and puts every candidate on Mesa's surfaceless platform, the attribute the
SwiftShader path already uses. A process with a display keeps the old order
and the old display.

Tested on a Raspberry Pi 5 (Raspberry Pi OS Lite, Mesa 26.2.2) with no
display server: the context reports OpenGL ES 3.0 on V3D 7.1, and
webgl2-smoke, swiftshader-smoke and three-smoke pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dsafdsaf132

Copy link
Copy Markdown
Owner

I'm glad to meet someone who uses the project!
Thanks for sharing your experience and for contributing

@dsafdsaf132
dsafdsaf132 merged commit 97b7efb into dsafdsaf132:main Oct 26, 2026
7 checks passed
@jerryryle
jerryryle deleted the fix/headless-surfaceless-display branch October 26, 2026 11:07
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.

2 participants