Headless OpenGL Rendering using SSH and X11 forwarding

Mario Kleiner mario.kleiner.de at gmail.com
Wed Mar 8 08:58:18 UTC 2023


I think this might be because indirect GLX support is disabled by default
on X-Servers shipping in Ubuntu, so if your remotely executing client tries
to use your local X-Server over the network via the x forwarding, it will
fail. I guess without x forwarding Mesa just renders locally on the remote
machine with a software renderer. See "man xorg.conf", the section about
Option "IndirectGLX" "boolean".


On Wed, Mar 8, 2023 at 2:17 AM Richard Haney <compsci2011 at gmail.com> wrote:

> Please help,
>
> I have been going around and around with this problem but cannot seem to
> make any headway. I hope that one of you OpenGL EGL experts can help. [image:
> :slight_smile:]
>
> I have created a program that uses OpenGL EGL (version 1.5) with OpenGL 3
> that successfully renders an offscreen triangle and saves it to an image
> file (PNG) when I ssh *without* X11 forwarding on my Linux (Ubuntu 22.04)
> machine.
>
> However when I try the same thing using ssh *with* X11 forwarding enabled
> I get the following EGL error when I call eglInitialize(…): 12290 (I
> *think* is EGL_BAD_ACCESS).
>
> This seems really weird and I hope it is something simple that I am just
> not currently seeing.
>
> I really like using OpenGL with EGL but need a way to remedy this
> situation if possible. Is there a way for EGL to determine if X11
> forwarding is being employed and to ignore it or some other solution?
>
> The snippet of relevant C++ code follows, with area where error occurs
> marked:
>
> #include <iostream> #include <cstdlib> #include <EGL/egl.h> #define
> EGL_EGLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES #include <EGL/eglext.h>
> #include <GL/gl.h> ... EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
> if(display == EGL_NO_DISPLAY) { std::cerr << "Failed to get EGL display: "
> << eglGetError() << std::endl; exit(EXIT_FAILURE); } EGLint major; EGLint
> minor; if(eglInitialize(display, &major, &minor) == EGL_FALSE) { // ERROR
> 12290 is generated here std::cerr << "Failed to initialize EGL: " <<
> eglGetError() << std::endl; exit(EXIT_FAILURE); } ...
>
>
> Any help would be greatly appreciated.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20230308/993802dd/attachment-0001.htm>


More information about the mesa-dev mailing list