Kivy没有检测到OpenGL 2.0

我决定在Kivy跨平台上做一些编程,并成功地在我的电脑上安装了Kivy。 问题是,当我运行我的代码时,出现此错误:

[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)]
[INFO              ] [Factory     ] 179 symbols loaded
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO              ] [OSC         ] using <thread> for socket
[INFO              ] [Window      ] Provider: sdl2
[INFO              ] [GL          ] GLEW initialization succeeded
[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.

此错误框弹出:

基维致命错误

我已经通过GPU Caps Viewer检查了我的GPU的OpenGL版本,验证了我的OpenGL版本2.1,但Kivy以某种方式检测不到OpenGL 2.1,并且默认从Microsoft改为GDI Generic。 我在互联网上做了一些研究,发现解决这个问题的最好方法是从你的图形卡制造商那里更新你的图形卡的驱动程序,但这在我的情况下不起作用。

我更新了我的图形驱动程序(我在64位Windows 8上运行NVIDIA GeForce GT 435M)。

我的问题是:有没有办法让Kivy从GDI Generic驱动程序切换到NVIDIA驱动程序? 或者在其他地方有问题吗?


在Windows 7专业版32位添加Config.set('graphics', 'multisamples', '0')解决了我的错误。 (更新:这也适用于Windows 10)。

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

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

# add the following 2 lines to solve OpenGL 2.0 bug
from kivy import Config
Config.set('graphics', 'multisamples', '0')


class MyApp(App):

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

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

更改后,正确报告OpenGL版本:

[信息] [GL] GLEW初始化成功

[INFO] [GL] OpenGL版本<2.1.0 - Build 8.15.10.2281>


py3.5 +的角度后端

pip install kivy.deps.angle 
set KIVY_GL_BACKEND=angle_sdl2

它在Windows 10及其上述问题的解决方案上完美工作。 多重采样不适用于我的情况


这似乎是当前版本的kivy中的一个已知错误,并且已经在其问题跟踪器中报告过。 所以我想没有(简单的)方法来解决这个问题。 切换回旧版本可能会有所帮助。

链接地址: http://www.djcxy.com/p/38423.html

上一篇: Kivy does not detect OpenGL 2.0

下一篇: Mesa headers with NVIDIA drivers (linux)