GrGLMakeNativeInterface failure when using ssh -X (Mac->Linux)

389 views
Skip to first unread message

Kez Cleal

unread,
Sep 4, 2023, 11:23:18 AM9/4/23
to skia-discuss
Hi,
I have run in to a problem which happens when I ssh to a Linux server from a Mac (ssh -X), and then lanuch an application from the linux server. The window is managed by GLFW, but when I try and make an interface using:

    sk_sp<const GrGLInterface> interface = GrGLMakeNativeInterface();

I end up with a null pointer. I have tried lots of different window hints when setting up the glfw window, but cant seem to find any that work.

Also I do not seem to have a problem if I use a linux->linux connection, this only occurs when ssh'ing from mac->linux, so im guessing its due to differences in opengl APIs?

glxgears works but with a few errors:

    libGL error: No matching fbConfigs or visuals found
    libGL error: failed to load driver: swrast

Running glxinfo also hints at some errors:

    LIBGL_DEBUG=verbose glxinfo | grep :
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: did not find extension DRI_Kopper version 1
libGL: did not find extension DRI2_Flush version 1
libGL: Disabling server's aux buffer support
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
name of display: localhost:10.0
display: localhost:10  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX version: 1.4
GLX extensions:
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: AMD Radeon R9 M290X OpenGL Engine
OpenGL version string: 1.4 (2.1 ATI-4.6.21)
OpenGL extensions:
160 GLXFBConfigs:
X Error of failed request:  GLXBadCurrentWindow
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  54
  Current serial number in output stream:  54

I have also tried using glad to try and force OpenGL version1.4 but no success.

I have made a git hub repo to reproduce the issue if its helpful for anyone: https://github.com/kcleal/skia_context_debug

Are there any ways of making a custom interface to match the Mac device? I'm not a graphics expert, so would really appreciate any ideas of what to try, or where to look! Thanks

Brian Salomon

unread,
Sep 4, 2023, 12:35:26 PM9/4/23
to skia-d...@googlegroups.com
This question on stack overflow seems related:

I'm far from an expert on the various driver stacks on Linux but maybe try making the application use EGL instead of GLX. From the link below I think that would mean setting GLFW_CONTEXT_CREATION_API to GLFW_EGL_CONTEXT_API.

Skia can generate a GrGLInterface from either GLX or EGL GL contexts on Linux. To build support for EGL set gn arg skia_use_egl to true. That will make GrGLMakeNativeInterface() use EGL.

It is possible to build up your own GrGLInterface rather than use GrGLMakeNativeInterface but I bet you don't need to in this case.

Hope that helps,

Brian

 

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/810df97e-0564-43c9-b0e9-c06fd58184acn%40googlegroups.com.

Kez Cleal

unread,
Jan 15, 2024, 11:28:15 AM1/15/24
to skia-discuss
I finally got around to trying this out, and I think it has worked!! Thank you so much, I have been stuck on this for so long!
Reply all
Reply to author
Forward
0 new messages