MESA-LOADER: failed to open swrast

1,702 views
Skip to first unread message

K leo

unread,
Jun 3, 2020, 1:39:21 PM6/3/20
to Kivy users support
Hi guys,

I am new to Kivy.  Just trying for the last two days to run the demo "hello" program on both Xubuntu and Manjaro via VurtualBox with MacBook Pro as host.  In both cases, I got the same error.

Kivy 1.11.1 was installed successfully under Python 3.7.3, which was freshly installed from Miniconda3.

import kivy
kivy
.require('1.11.1') # replace with your current kivy version !

from kivy.app import App
from kivy.uix.label import Label


class MyApp(App):

   
def build(self):
       
return Label(text='Hello world')


if __name__ == '__main__':
   
MyApp().run()


$ python main.py
[INFO   ] [Logger      ] Record log in /home/xxx/.kivy/logs/kivy_20-06-03_1.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/home/xxx/kivy_venv/lib/python3.7/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0]
[INFO   ] [Python      ] Interpreter at "/home/xxx/kivy_venv/bin/python"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
MESA
-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error
: failed to load driver: swrast
X
Error of failed request:  GLXBadContext
 
Major opcode of failed request:  152 (GLX)
 
Minor opcode of failed request:  6 (X_GLXIsDirect)
 
Serial number of failed request:  88
 
Current serial number in output stream:  87

I have checked under /usr/lib/x86_64-linux-gnu/dri:

$ ls /usr/lib/x86_64-linux-gnu/dri
i915_dri
.so        iris_dri.so           nouveau_vieux_dri.so  r600_drv_video.so      swrast_dri.so
i965_dri
.so        kms_swrast_dri.so     r200_dri.so           radeon_dri.so          virtio_gpu_dri.so
i965_drv_video
.so  nouveau_dri.so        r300_dri.so           radeonsi_dri.so        vmwgfx_dri.so
iHD_drv_video
.so   nouveau_drv_video.so  r600_dri.so           radeonsi_drv_video.so  zink_dri.so

At the same time, I could ran glxdemo and glxgears without a problem.

$ glxdemo
Resize event
Resize event
Redraw event

$ glxinfo |grep render
direct rendering
: Yes
    GLX_MESA_multithread_makecurrent
, GLX_MESA_query_renderer,
    GLX_EXT_visual_rating
, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: llvmpipe (LLVM 9.0.1, 256 bits)
    GL_ARB_conditional_render_inverted
, GL_ARB_conservative_depth,
    GL_MESA_ycbcr_texture
, GL_NV_conditional_render, GL_NV_depth_clamp,
    GL_ARB_conditional_render_inverted
, GL_ARB_conservative_depth,
    GL_NV_conditional_render
, GL_NV_depth_clamp, GL_NV_fog_distance,
    GL_EXT_polygon_offset_clamp
, GL_EXT_read_format_bgra, GL_EXT_render_snorm,
    GL_MESA_shader_integer_functions
, GL_NV_conditional_render,
    GL_OES_element_index_uint
, GL_OES_fbo_render_mipmap,

Anyone please give me a hint as to where might be wrong?

Robert Flatt

unread,
Jun 3, 2020, 8:56:25 PM6/3/20
to Kivy users support
No idea what is up with what you are doing, though it sounds optimistic ;)

As an alternative consider installing Kivy on MacOS.

K leo

unread,
Jun 4, 2020, 4:10:00 AM6/4/20
to Kivy users support
Thanks for the response.  But I don't want to get into programming on the Mac.  Hope to get this figured out on Linux.  Found a reported issue on github, that's just the same as this.  https://github.com/kivy/kivy/issues/6872

K leo

unread,
Jun 4, 2020, 6:40:24 AM6/4/20
to Kivy users support
I should add that my VirtualBox version is 6.1.2.  It seems to have OpenGL 3.1.

$ glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 10.0.0, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.7
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 20.0.7
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.0.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

I see on Github issues that some people got Kivy working on VBox 5, which only support OpenGL 2.  So I will try it and see how it goes.

K leo

unread,
Jun 4, 2020, 6:56:28 AM6/4/20
to Kivy users support
Just tried VirtualBox 5.2.42.  It also supports OpenGL3.1, and the problem remains the same.

K leo

unread,
Jun 4, 2020, 9:21:51 AM6/4/20
to Kivy users support
Also tested VirtualBox 6.0.12.  Same situation.

K leo

unread,
Jun 4, 2020, 4:36:11 PM6/4/20
to Kivy users support
OK.  Got it working!  The issue was using Miniconda3 which has some conflicts I suspect.  The reason I decided to use Miniconda3 was that my Ubuntu 20.04 has Python 3.8 as the default and I initially didn't want to mess up the system by installing 3.7.  So at the end, I removed Miniconda3, and installed python3.7.7 alongside 3.8 and alias python as 3.7.7 in my .bashrc.  Things work now.


$ python main.py
[WARNING] [Config      ] Older configuration version detected (0 instead of 21)
[WARNING] [Config      ] Upgrading configuration in progress.
[INFO   ] [Logger      ] Record log in /home/xxx/.kivy/logs/kivy_20-06-04_0.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/home/xxx/kivy_venv/lib/python3.7/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.7.7 (default, Apr 18 2020, 02:59:53)
[GCC 9.3.0]
[INFO   ] [Python      ] Interpreter at "/home/xxx/kivy_venv/bin/python3.7"

[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'3.1 Mesa 20.0.4'>
[INFO   ] [GL          ] OpenGL vendor <b'VMware, Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'llvmpipe (LLVM 9.0.1, 256 bits)'>
[INFO   ] [GL          ] OpenGL parsed version: 3, 1
[INFO   ] [GL          ] Shading version <b'1.40'>
[INFO   ] [GL          ] Texture max size <8192>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [WindowSDL   ] exiting mainloop and closing.
[INFO   ] [Base        ] Leaving application in progress...


Reply all
Reply to author
Forward
0 new messages