<div dir="ltr"><div>12290 is indeed EGL_BAD_ACCESS, and it's pretty much impossible for Mesa's eglInitialize to return that, so (if I had to guess) you have nvidia's driver installed as well, and (extra guessing now) nvidia's EGL only works with connections to the local machine and not over the network. Mesa shouldn't have that problem because it would select llvmpipe instead of a native driver in that scenario, I think.<br></div><div><br></div><div>If "render to png" really is what you're trying to accomplish you might do better to use EGL_EXT_platform_device to get a direct connection to the GPU without involving a display server.</div><div><br></div><div>- ajax<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 7, 2023 at 8:17 PM Richard Haney <<a href="mailto:compsci2011@gmail.com">compsci2011@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><p style="margin-top:0px;color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">Please help,</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">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.<span> </span><img src="https://community.khronos.org/images/emoji/twitter/slight_smile.png?v=12" title=":slight_smile:" alt=":slight_smile:" style="border-style: none; vertical-align: middle; width: 20px; height: 20px;" width="20" height="20"></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">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<span> </span>ssh<span> </span><em>without</em><span> </span>X11 forwarding on my Linux (Ubuntu 22.04) machine.</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">However when I try the same thing using<span> </span>ssh<span> </span><em>with</em><span> </span>X11 forwarding enabled I get the following EGL error when I call<span> </span>eglInitialize(…): 12290 (I<span> </span><em>think</em><span> </span>is<span> </span>EGL_BAD_ACCESS).</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">This seems really weird and I hope it is something simple that I am just not currently seeing.</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">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?</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">The snippet of relevant C++ code follows, with area where error occurs marked:</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px"><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>include</span> <span><iostream></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>include</span> <span><cstdlib></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>include</span> <span><EGL/egl.h></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>define</span> EGL_EGLEXT_PROTOTYPES</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>define</span> GL_GLEXT_PROTOTYPES</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>include</span> <span><EGL/eglext.h></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">#<span>include</span> <span><GL/gl.h></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
...
EGLDisplay display = </span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">eglGetDisplay</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">(EGL_DEFAULT_DISPLAY);
</span><span style="color:rgb(38,38,38);font-weight:bold;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">if</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">(display == EGL_NO_DISPLAY) {
std::cerr << </span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">"Failed to get EGL display: "</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)"> << </span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">eglGetError</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">() << std::endl;
</span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">exit</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">(EXIT_FAILURE);
}
EGLint major;
EGLint minor;
</span><span style="color:rgb(38,38,38);font-weight:bold;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">if</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">(</span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">eglInitialize</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">(display, &major, &minor) == EGL_FALSE) {
</span><span style="font-style:italic;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">// ERROR 12290 is generated here</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">
std::cerr << </span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">"Failed to initialize EGL: "</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)"> << </span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">eglGetError</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">() << std::endl;
</span><span style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">exit</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)">(EXIT_FAILURE);
}
...</span><br></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px"><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)"><br></span></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008px">Any help would be greatly appreciated.<span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre-wrap;background-color:rgb(249,249,249)"><br></span></p></div></div>
</blockquote></div>