Kivy: Multisamples causing GL error

Created on 13 Aug 2015  ·  40Comments  ·  Source: kivy/kivy

I created 2 .exe packages for windows according to the documentation. I used stable and dev version kivy. And I have a problem - stable version detects opengl version 2.1 and dev version - 1.1
log files
stable

[INFO              ] Logger: Record log in C:\Users\maxim_000\.kivy\logs\kivy_15-08-13_6.txt
[WARNING           ] [Config      ] Upgrading configuration in progress.
[WARNING           ] [Config      ] Older configuration version detected (14 instead of 13)
[INFO              ] Kivy: v1.9.0
[INFO              ] Python: v2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
[INFO              ] Factory: 173 symbols loaded
[INFO              ] Image: Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO              ] Text: Provider: sdl2
[INFO              ] OSC: using <thread> for socket
[INFO              ] Window: Provider: sdl2
[INFO              ] GL: GLEW initialization succeeded
[INFO              ] GL: OpenGL version <2.1.0 - Build 8.15.10.1872>
[INFO              ] GL: OpenGL vendor <Intel>
[INFO              ] GL: OpenGL renderer <Mobile Intel(R) 4 Series Express Chipset Family>
[INFO              ] GL: OpenGL parsed version: 2, 1
[INFO              ] GL: Shading version <1.20  - Intel Build 8.15.10.1872>
[INFO              ] GL: Texture max size <4096>
[INFO              ] GL: Texture max units <16>
[INFO              ] Shader: fragment shader: <No errors.>
[INFO              ] Shader: vertex shader: <No errors.>
[INFO              ] Shader: program: <No errors.>
[INFO              ] Window: auto add sdl2 input provider
[INFO              ] Window: virtual keyboard not allowed, single mode, not docked
[INFO              ] GL: NPOT texture support is available
[INFO              ] Base: Start application main loop
[INFO              ] Base: Leaving application in progress...

dev

[INFO              ] Logger: Record log in C:\Users\maxim_000\.kivy\logs\kivy_15-08-13_5.txt
[INFO              ] Kivy: v1.9.1-dev
[INFO              ] Python: v2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
[INFO              ] Factory: 177 symbols loaded
[INFO              ] Image: Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO              ] Text: Provider: sdl2
[INFO              ] OSC: using <thread> for socket
[INFO              ] Window: Provider: sdl2
[INFO              ] GL: GLEW initialization succeeded
[INFO              ] GL: OpenGL version <1.1.0>
[INFO              ] GL: OpenGL vendor <Microsoft Corporation>
[INFO              ] GL: OpenGL renderer <GDI Generic>
[INFO              ] GL: OpenGL parsed version: 1, 1
[CRITICAL          ] GL: Minimum required OpenGL version (2.0) NOT found!

OpenGL version detected: 1.1

Version: 1.1.0
Vendor: Microsoft Corporation
Renderer: GDI Generic

Try upgrading your graphics drivers and/or your graphics hardware in case of problems.

The application will leave now.
Windows High

Most helpful comment

This worked for me

import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'

from kivy import Config
Config.set('graphics', 'multisamples', '0')

All 40 comments

I have the same issue with 1.9.1-dev :

[INFO              ] [Logger      ] Record log in C:\Documents and Settings\gfj138\.kivy\logs\kivy_15-08-25_22.txt
[INFO              ] [Kivy        ] v1.9.1-dev
[INFO              ] [Python      ] v2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:02:00) [MSC v.1500 32 bit (Intel)]
[INFO              ] [Factory     ] 177 symbols loaded
[DEBUG             ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[DEBUG             ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG             ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[DEBUG             ] [Cache       ] register <kv.texture> with limit=1000, timeout=60
[DEBUG             ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600
[INFO              ] [Text        ] Provider: sdl2
[INFO              ] [OSC         ] using <thread> for socket
[WARNING           ] [Input       ] WM_Touch/WM_Pen not supported by your version of Windows
[INFO              ] [Window      ] Provider: sdl2
[INFO              ] [GL          ] GLEW initialization succeeded
GL: glGenFramebuffers is NULL, try to detect an extension
GL: available extensions: GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture
GL: No framebuffers extension is supported
GL: Any call to Fbo will crash !
[INFO              ] [GL          ] OpenGL version <1.1.0>
[INFO              ] [GL          ] OpenGL vendor <Microsoft Corporation>
[INFO              ] [GL          ] OpenGL renderer <GDI Generic>
[INFO              ] [GL          ] OpenGL parsed version: 1, 1
[CRITICAL          ] [GL          ] Minimum required OpenGL version (2.0) NOT found!

and 1.9.0

[INFO              ] [Kivy        ] v1.9.0
[INFO              ] [Python      ] v2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:02:00) [MSC v.1500 32 bit (Intel)]
[INFO              ] [Factory     ] 173 symbols loaded
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO              ] [Text        ] Provider: sdl2
[INFO              ] [OSC         ] using <thread> for socket
[WARNING           ] [Input       ] WM_Touch/WM_Pen not supported by your version of Windows
[INFO              ] [Window      ] Provider: sdl2
[INFO              ] [GL          ] GLEW initialization succeeded
[INFO              ] [GL          ] OpenGL version <3.1.0 - Build 6.14.10.5398>
[INFO              ] [GL          ] OpenGL vendor <Intel>
[INFO              ] [GL          ] OpenGL renderer <Intel(R) HD Graphics 4000>
[INFO              ] [GL          ] OpenGL parsed version: 3, 1
[INFO              ] [GL          ] Shading version <1.40 - Intel Build 6.14.10.5398>
[INFO              ] [GL          ] Texture max size <8192>
[INFO              ] [GL          ] Texture max units <16>
[INFO              ] [Shader      ] fragment shader: <No errors.>
[INFO              ] [Shader      ] vertex shader: <No errors.>
[INFO              ] [Shader      ] program: <No errors.>
[INFO              ] [Window      ] auto add sdl2 input provider
libpng warning: iCCP: known incorrect sRGB profile
[INFO              ] [Window      ] virtual keyboard not allowed, single mode, not docked

As I understand it - for determining the version of opengl responsible kivy.graphics. I'm assuming commit history here https://github.com/kivy/kivy/commits/master/kivy/graphics?page=1 i found that since 3eb5b4844105fe83349a59612f8850e73622c26c all works, and since f15283ffd99b226e6cfe9c99d18d1010176aea21 error exists. So either this error because of a commit or error corrections for some is the above-mentioned package.

Error in this commit fd54e811f9c9413d22a2486920ed8d89ae84fc11

I dont succeed( Error on these lines - https://github.com/kivy/kivy/commit/fd54e811f9c9413d22a2486920ed8d89ae84fc11#diff-b91d9923ff01305495e47990f1ac7951R85

SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, ...)
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, ...)

If you set any values to these attributes - error exists. Why - i dont know. I'm looking for a solution, but so far without results.

OK, maybe it will help, I'll read it and think about it. There is one way that circumvents the problem but not solve it. Just remove the 124 and 125 lines in https://github.com/kivy/kivy/blob/master/kivy/core/window/_window_sdl2.pyx.

Commenting lines 124+125 did not solve the issue.
However, by skipping entirely the new code related to multisamples, ie change line 116 into

if multisamples > 0 and False:

it did work.

Thank you for your help !

This is a show stopper bug we need to either find a solution or revert https://github.com/kivy/kivy/commit/fd54e811f9c9413d22a2486920ed8d89ae84fc11 before 1.9.1

About fix the problem - for support SDL_GL_MULTISAMPLEBUFFERS requires the GL_ARB_multisample extension(according this sdl.beuc.net/sdl.wiki/SDL_GLattr) , and i don`t have it.
Need to add a check for this extension, and in his absence - set in config multisamples to 0. I'll try to do it

Perhaps there is another solution, the information here link_to_SO_1 link_to_SO_2 link_to_SO_3 can help to find it, or make sure that it is not (I had not understand due to poor knowledge of English and even less knowledge in SDL and opengl)

LaTeX-Python confirmed on irc that it seems to happen with integrated GPUs, he uses this processor and was running a packaged app. His code runs without problems on machines with a dedicated graphics card.

@Kazun3500 i'm unsure if that commit is the real trigger, LaTeX tried with multisamples 0 (which stops the relevant part of the patch from executing) and the crash happened the same way. He was using a driver supplied by Microsoft, after installing the Intel one his issue was fixed.

Could you check if running the source code shows the same issue, or does it crash only with a packaged app? What is your processor model and driver version?

@dessant running the source code shows the same issue.

And for me setting multisamples to 0 helps to avoid crashes.

Processor version - Celeron(R) Dual-Core CPU T3500 @ 2.10GHz × 2, driver version - i will say a little bit later. And - i have integrated GRU.

And no matter what is the cause of this bug, we still need to add a check to support multisamples.

driver version -6.3.9600.16384, driver provider - Microsoft. I can`t find driver from intel. And i checked again - setting multisamples to 0 helps to avoid crashes, and depends on multisamples count it shows different lists avaliable gl extensions

with 0

GL: glGenFramebuffers is NULL, try to detect an extension
GL: available extensions: GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_blend
_color GL_EXT_abgr GL_EXT_texture3D GL_EXT_clip_volume_hint GL_EXT_compiled_vert
ex_array GL_SGIS_texture_edge_clamp GL_SGIS_generate_mipmap GL_EXT_draw_range_el
ements GL_SGIS_texture_lod GL_EXT_rescale_normal GL_EXT_packed_pixels GL_EXT_sep
arate_specular_color GL_ARB_multitexture GL_EXT_texture_env_combine GL_EXT_bgra
GL_EXT_blend_func_separate GL_EXT_secondary_color GL_EXT_fog_coord GL_EXT_textur
e_env_add GL_ARB_texture_cube_map GL_ARB_transpose_matrix GL_ARB_texture_env_add
 GL_IBM_texture_mirrored_repeat GL_EXT_multi_draw_arrays GL_NV_blend_square GL_A
RB_texture_compression GL_3DFX_texture_compression_FXT1 GL_EXT_texture_filter_an
isotropic GL_ARB_texture_border_clamp GL_ARB_point_parameters GL_ARB_texture_env
_combine GL_ARB_texture_env_dot3 GL_ARB_texture_env_crossbar GL_EXT_texture_comp
ression_s3tc GL_ARB_shadow GL_ARB_window_pos GL_EXT_shadow_funcs GL_EXT_stencil_
wrap GL_ARB_vertex_program GL_EXT_texture_rectangle GL_ARB_fragment_program GL_E
XT_stencil_two_side GL_ATI_separate_stencil GL_ARB_vertex_buffer_object GL_EXT_t
exture_lod_bias GL_ARB_occlusion_query GL_ARB_fragment_shader GL_ARB_shader_obje
cts GL_ARB_shading_language_100 GL_ARB_texture_non_power_of_two GL_ARB_vertex_sh
ader GL_NV_texgen_reflection GL_ARB_point_sprite GL_EXT_blend_equation_separate
GL_ARB_depth_texture GL_ARB_texture_rectangle GL_ARB_draw_buffers GL_ARB_pixel_b
uffer_object GL_WIN_swap_hint GL_EXT_framebuffer_object GL_EXT_texture_sRGB GL_A
RB_color_buffer_float GL_ARB_half_float_pixel GL_ARB_texture_float GL_NV_conditi
onal_render GL_EXT_texture_swizzle
GL: EXT_framebuffer_object is supported

with 2

GL: glGenFramebuffers is NULL, try to detect an extension
GL: available extensions: GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture
GL: No framebuffers extension is supported
GL: Any call to Fbo will crash !

I confirm that i have this problem with a Windows 10 machine and with Virtualbox Windows machines.
Config.set('graphics', 'multisamples', '0') solve the problem.

To make @lupin3rd 's reply more beginner friendly:

This is how you update the hello world example
by adding Config.set('graphics', 'multisamples', '0')
to make it work:

from kivy import Config
Config.set('graphics', 'multisamples', '0')

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

kivy_17-02-24_3.txt

I am also getting this misidentifying error.

I tried running the /share/kivy-examples/demo/showcase/main.py file and got that error.

It worked after I edited the main.py file and added the following two lines just after the rest of the import statements:
from kivy import Config
Config.set('graphics', 'multisamples', '0')

Currently running on:
Manufacturer: Acer
Computer Model: Asprie Z3-715
Intel i5 6400T CPU @ 2.2GHz
8GB RAM
64-bit Windows 10
Integrated Graphics: Intel HD 530 with Shared Memory
Dedicated Graphics: Nvidia Geforce 940M with 2GB RAM

There seems to be a mishmash of issues in this thread. Let's use this thread for cases where gl detection issues are solved by Config.set('graphics', 'multisamples', '0'), regardless of the gl backend being used.

If that is not the case, please open a new issue, describing the error you get.

As @dessant mentioned, this thread has become full of too many issues and suggestions. @jegger's (#5071) new ticket summarizes the remaining issues. Please follow any remaining discussion there.

Note: I have a work laptop which reproduces the issues as discussed there. I can run any requested tests or make this machine available remotely upon request. In the meantime, I will continue investigating and discussing on that thread.

Thanks

Comments not related to multisamples have been deleted, let's reopen this.

Kivy 1.10.0 was released!

So I installed it right away to check.

Alas the problem stays the same.

I still need to add

from kivy import Config
Config.set('graphics', 'multisamples', '0')

to the kivy showcase "sharekivy-examples\demo\showcasemain.py" to get it to run.
The showcase itself runs, apart from the scatter demo, which just does nothing.

Tried on Win7 Pro 32bit, Python 3.6.1 32 bit, Intel HD on board graphics.
(Core i5), driver 8.15.10.2281 (not updatable)

Did anyone try it with the sdl2 backend (KIVY_GL_BACKEND=sdl2) or the angle backend for py3.5+ (pip install kivy.deps.angle and KIVY_GL_BACKEND=angle_sdl2)?

@matham can you give beginner friendly instructions on how to activate KIVY_GL_BACKEND=angle_sdl2 assuming I have performed pip install kivy.deps.angle on python 3.6.1 and am now about to start sharekivy-examples\demo\showcasemain.py?

if I type SET KIVY_GL_BACKEND=angle_sdl2 before starting, I get this message on start:

C:\Python36-32>python sharekivy-examples\demo\showcasemain.py
[INFO ] [Logger ] Record log in C:\Users\XXX.kivy\logskivy_17-05-09_
0.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1
900 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif
(img_ffpyplayer ignored)
[INFO ] [OSC ] using for socket
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[CRITICAL] [Window ] Unable to find any valuable Window provider.
sdl2 - ValueError: angle_sdl2 is not a recognized GL backend

Hmm, that is very strange, I don't see how that error could occur with the last release.

@mborus, dozens of posts have been deleted from this thread to bring it to a usable state, please do not go off-topic, and debug your angle issues on irc or the mailing list.

the issue seems to be persisting still in my machine windows 10 I have also tried the above solutions to see the issue...

import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'
import kivy
Adding this to the top of my script is the work around I'm using on windows 10, kivy 1.10.0, python 3.6.2.

I want to clarify:
from kivy import Config
Config.set('graphics', 'multisamples', '0')
Does not resolve my error.


RESTART: C:/Users/AppData/Local/Programs/Python/Python36-32/kivy_label.py
[INFO ] [Logger ] Record log in C:\Users\Corie.kivy\logskivy_17-09-05_15.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using for socket
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] No framebuffers extension is supported
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version
[INFO ] [GL ] OpenGL vendor
[INFO ] [GL ] OpenGL renderer
[INFO ] [GL ] OpenGL parsed version: 1, 1
[CRITICAL] [GL ] Minimum required OpenGL version (2.0) NOT found!

OpenGL version detected: 1.1

Version: b'1.1.0'
Vendor: b'Microsoft Corporation'
Renderer: b'GDI Generic'

Try upgrading your graphics drivers and/or your graphics hardware in case of problems.

The application will leave now.


However,
import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'
does. I'm not sure if this is the same or related issue.

Should we apply the:

Config.set('graphics', 'multisamples', '0')

On windows machines only? Will there be a performance impact on other platforms if applied globally, such as on Android, iOS or OSX?

It's only a problem on windows AFAIK.

Thanks. What I meant was, by setting this config option regardless of the platform is running on, will it have any detrimental performance impact?

I don't think so. From the docs, Sets the MultiSample Anti-Aliasing (MSAA) level. Increasing this value results in smoother graphics but at the cost of processing time. which seems to imply that a lower level will only increase performance. But it may look worse.

I'd just do

import platform
from kivy.config import Config
if platform.system() == 'Windows:
    Config.set('graphics', 'multisamples', '0')'

Perfect. Thank you.

This worked for me

import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'

from kivy import Config
Config.set('graphics', 'multisamples', '0')

What would be ideal is to allow the default multisample value, but pre-emptively set it to zero only if:

  • platform is windows
  • compatibility issue is detected

Basically, how do we test ahead of time before Kivy crashes out? I'd like to have the optimal graphics for the 99% of our software installations out there.

I don't think that is possible. You need to run the app twice, once to see if there's an issue, at which point you need to terminate python because gl is already initialized and then you have to run it again with the "fix".

So we have no way to detect the issue and then adjust the setting. You can make it available as a config option that your user changes if they have issues.

The issue is still happening on Windows 7 x64 (2011 computer, but still...). I have an Intel HD Graphics Arrandale. The way to fix it is to place:

from kivy import Config
Config.set('graphics', 'multisamples', '0')

Before any kivy import. Another way to fix just on the current machine is to modify the %HOMEPATH%\.kivy\config.ini to change multisamples = 2 into multisamples = 0.

I do have a compliant openGL on my Windows 10 laptop:

snap1

But even with those addition in my code

import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'
from kivy import Config
Config.set('graphics', 'multisamples', '0')

I get the 1.1 version error ...

snap2

The full log:

[INFO   ] [Logger      ] Record log in C:\Users\Jean-Pierre\.kivy\logs\kivy_18-04-21_14.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [OSC         ] using <thread> for socket
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] No framebuffers extension is supported
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'1.1.0'>
[INFO   ] [GL          ] OpenGL vendor <b'Microsoft Corporation'>
[INFO   ] [GL          ] OpenGL renderer <b'GDI Generic'>
[INFO   ] [GL          ] OpenGL parsed version: 1, 1
[CRITICAL] [GL          ] Minimum required OpenGL version (2.0) NOT found!

OpenGL version detected: 1.1

Version: b'1.1.0'
Vendor: b'Microsoft Corporation'
Renderer: b'GDI Generic'

Try upgrading your graphics drivers and/or your graphics hardware in case of problems.

The application will leave now.

This is really very problematic !

@Archanciel

[INFO   ] [Python      ] v3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]

Anaconda overrides a lot of libraries with their own versions. Please try again with a CPython from python.org

Thanks for the suggestion, dolang. I did uninstall Python Anaconda 3.6.4 and installed CPython 3.6.5 instead, but this did not solved the problem. But I finally found the solution thanks to a contribution on an Intel graphical card forum. The idea is to use Shims to solve a driver compatibility problem. See the end of the thread here for a description of the solution.

Thank you for contributing your solution back. It might be able to help someone else with the same problem.

@gutcheschiro ,Thanks
It worked for me.
import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'
import kivy
I'm using on windows 10, kivy 1.10.0, python 3.6.4

Is this is still present on 1.10.1? If so, would it make sense to alter the order of
https://github.com/kivy/kivy/blob/b4d3e7d0db67c9ad23dff8c48c4a275bafb9d76b/kivy/graphics/cgl.pyx#L59

so sdl2 is picked first (at least on windows)?

Was this page helpful?
0 / 5 - 0 ratings