glshim: Unable to run glxinfo/glxgears
I’ve been trying to get glxinfo and/or glxgears to run when using glshim (on a Nokia N900).
My ~/lib directory has tinygles in it as well, so I am explicitly setting LIBGL_GLES to system libGLES binary so that it doesn’t get used in this test.
localhost:~$ LD_LIBRARY_PATH=~/lib LIBGL_FB=1 LIBGL_GLES=/usr/lib/libGLESv1_CM.so.1 DISPLAY=:0 glxinfo
name of display: :0
libGL:loaded: /usr/lib/libGLESv1_CM.so.1
libGL:loaded: libEGL.so.1
libGL: built on Mar 17 2018 12:28:41
libGL: framebuffer output enabled
libEGL warning: DRI2: failed to authenticate
ERROR: EGL Error detected: EGL_BAD_NATIVE_WINDOW (0x300B)
glXGetProcAddress: glGetProgramivARB not found.
glX stub: glGetStringi
glXGetProcAddress: glGetConvolutionParameteriv not found.
libGL: GL_INVALID_ENUM when calling glGet<GL_INT>(GL_NUM_EXTENSIONS)
Warning: GL error 0x500 at line 501
display: :0 screen: 0
direct rendering: Yes
server glx vendor string:
server glx version string:
server glx extensions:
client glx vendor string:
client glx version string:
client glx extensions:
GLX version: 1.4
GLX extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_EXT_create_context_es2_profile
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 5.0, 128 bits)
OpenGL core profile version string: 1.4 glshim wrapper
OpenGL core profile extensions:
GL_ARB_multitexture, GL_ARB_texture_cube_map, GL_EXT_blend_color,
GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate,
GL_EXT_blend_logic_op, GL_EXT_blend_subtract, GL_EXT_secondary_color,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 78 (X_CreateColormap)
Serial number of failed request: 7
Current serial number in output stream: 10
localhost:~$ LD_LIBRARY_PATH=~/lib LIBGL_FB=1 LIBGL_GLES=/usr/lib/libGLESv1_CM.so.1 DISPLAY=:0 glxgears
Error relocating /usr/bin/glxgears: glXQueryDrawable: symbol not found
If I set LIBGL_GL, as you suggest in some other issue threads here, I get a segfault with glxinfo:
localhost:~$ LD_LIBRARY_PATH=~/lib LIBGL_FB=1 LIBGL_GLES=/usr/lib/libGLESv1_CM.so.1 LIBGL_EGL=/usr/lib/libGL.so.1 LD_PRELOAD=~/lib/libpreload.so DISPLAY=:0 glxinfo
name of display: :0
libGL:loaded: /usr/lib/libGLESv1_CM.so.1
libGL:loaded: /usr/lib/libGL.so.1
libGL: built on Mar 17 2018 12:28:41
libGL: framebuffer output enabled
Segmentation fault
localhost:~$ LD_LIBRARY_PATH=~/lib LIBGL_FB=1 LIBGL_GLES=/usr/lib/libGLESv1_CM.so.1 LIBGL_EGL=/usr/lib/libGL.so.1 LD_PRELOAD=~/lib/libpreload.so DISPLAY=:0 glxgears
Error relocating /usr/bin/glxgears: glXQueryDrawable: symbol not found
localhost:~$ ldd $(which glxinfo)
/lib/ld-musl-armhf.so.1 (0xb6f18000)
libGL.so.1 => /usr/lib/libGL.so.1 (0xb6e7a000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb6d61000)
libc.musl-armhf.so.1 => /lib/ld-musl-armhf.so.1 (0xb6f18000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb6d35000)
libxcb-dri3.so.0 => /usr/lib/libxcb-dri3.so.0 (0xb6d22000)
libxcb-present.so.0 => /usr/lib/libxcb-present.so.0 (0xb6d0f000)
libxcb-sync.so.1 => /usr/lib/libxcb-sync.so.1 (0xb6cf9000)
libxshmfence.so.1 => /usr/lib/libxshmfence.so.1 (0xb6ce7000)
libglapi.so.0 => /usr/lib/libglapi.so.0 (0xb6cad000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb6c8e000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb6c7b000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb6c66000)
libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0xb6c54000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6c26000)
libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0xb6c03000)
libxcb-dri2.so.0 => /usr/lib/libxcb-dri2.so.0 (0xb6bef000)
libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb6bda000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb6bbb000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6ba1000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb6b8e000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6b79000)
libbsd.so.0 => /usr/lib/libbsd.so.0 (0xb6b54000)
And when using glshim:
localhost:~$ LD_LIBRARY_PATH=~/lib LIBGL_FB=1 LIBGL_GLES=/usr/lib/libGLESv1_CM.so.1 DISPLAY=:0 ldd $(which glxgears)
/lib/ld-musl-armhf.so.1 (0xb6f10000)
libGL.so.1 => /home/user/lib/libGL.so.1 (0xb6e5d000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb6d44000)
libc.musl-armhf.so.1 => /lib/ld-musl-armhf.so.1 (0xb6f10000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6d2a000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6cfc000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb6ce9000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6cd4000)
libbsd.so.0 => /usr/lib/libbsd.so.0 (0xb6caf000)
Error relocating /usr/bin/glxgears: glXQueryDrawable: symbol not found
localhost:~$ LD_LIBRARY_PATH=~/lib LIBGL_FB=1 LIBGL_GLES=/usr/lib/libGLESv1_CM.so.1 LIBGL_EGL=/usr/lib/libGL.so.1 DISPLAY=:0 ldd $(which glxgears)
/lib/ld-musl-armhf.so.1 (0xb6eda000)
libGL.so.1 => /home/user/lib/libGL.so.1 (0xb6e27000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb6d0e000)
libc.musl-armhf.so.1 => /lib/ld-musl-armhf.so.1 (0xb6eda000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6cf4000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6cc6000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb6cb3000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6c9e000)
libbsd.so.0 => /usr/lib/libbsd.so.0 (0xb6c79000)
Error relocating /usr/bin/glxgears: glXQueryDrawable: symbol not found
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 73 (36 by maintainers)
Awesome, after fixing some compile errors (c99 doesn’t allow
asm
, but allows__asm__
), and forcinguse_tgl
(I hard coded, but an env var might be nicer), I can now run glxgears on my N900 @ ~38fps compared to ~6fps using llvmpipe/Mesa!!There are still some weird graphical artifacts, and colors are still off, but this is very promising 😃
https://craftyguy.net/pub/VID_20180320_113338.mp4
Try this: https://github.com/lunixbochs/glshim/tree/swrast (swrast branch), which embeds tinygles into glshim
That seems low. I hit 60fps easily on a CC Pandora. Can you run perf top? What’s your X11 bit depth? Are you 100% sure it’s using the NEON renderer?
The colors are definitely related to glMaterial and TinyGL’s lighting mod. I may have fixed glxgears once. It doesn’t affect most demos.
I’m getting a little urge to work on this more. TinyGLES is memory bound, but I can reduce the overhead by reusing glshim’s structures, and I’ve also had some glshim optimization ideas for a while.
I also think if I can work in tiled rendering it will fly, as it can work from cache.
Another fun side effect is glshim+tinygles will work to provide OpenGL 1.x to emscripten.