Kivy无法检测到OpenGL 2.0 [英] Kivy does not detect OpenGL 2.0

查看:305
本文介绍了Kivy无法检测到OpenGL 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定在Kivy跨平台中进行一些编程,并成功在计算机上安装了Kivy.问题是,当我运行代码时,出现以下错误:

I have decided to do some programming in Kivy cross platform and installed Kivy on my computer successfully. The problem is that when I run my code, I get this error:

[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.我在Internet上进行了一些研究,发现解决此问题的最佳方法是从图形卡制造商那里更新图形卡的驱动程序,但这在我的情况下不起作用.

I have checked OpenGL version of my GPU via GPU Caps Viewer verifying me up to OpenGL Version 2.1, but Kivy somehow doesn't detect OpenGL 2.1 and defaults to GDI Generic from Microsoft instead. I did some research on internet and found out that best way to resolve this problem is to update your graphical card's driver from your graphical card manufacturer, but this didn't work in my case.

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

I have updated my graphic drivers (I am running NVIDIA GeForce GT 435M on 64-bit Windows 8).

我的问题是:是否可以让Kivy从GDI通用驱动程序切换到NVIDIA驱动程序?还是其他地方有问题?

My question is: Is there a way to let Kivy switch from GDI Generic driver to NVIDIA driver? Or is there a problem somewhere else?

推荐答案

在Windows 7 pro 32位上添加Config.set('graphics', 'multisamples', '0')为我解决了该错误. (更新:这在Windows 10上也适用.)

On windows 7 pro 32bit adding Config.set('graphics', 'multisamples', '0') solved the error for me. (Update: This is also works on 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版本:

After the change, the OpenGL version is reported correctly:

[INFO] [GL] GLEW初始化成功

[INFO ] [GL ] GLEW initialization succeeded

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

[INFO ] [GL ] OpenGL version <2.1.0 - Build 8.15.10.2281>

这篇关于Kivy无法检测到OpenGL 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆