Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy does not detect OpenGL 2.0 [closed]

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.

And this error box pops out:

Kivy Fatal Error

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.

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

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?

like image 701
Matic Brank Avatar asked Jan 23 '16 22:01

Matic Brank


People also ask

Does KIVY use OpenGL?

Kivy uses OpenGL and therefore requires a backend that provides it.

Why is OpenGL not working?

OpenGL errors can be caused by a variety of reasons; corrupt OS files, outdated drivers, poorly developed apps, incorrect system configurations, and more. If there is a specific OpenGL error that you're seeing, you should troubleshoot it directly.


2 Answers

If you still have the problem try this:

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

It worked for me (Windows 10, OpenGL 3.1, Python 3.6).

like image 97
Jack Newbile Avatar answered Sep 28 '22 01:09

Jack Newbile


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()

After the change, the OpenGL version is reported correctly:

[INFO ] [GL ] GLEW initialization succeeded

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

like image 26
576i Avatar answered Sep 28 '22 02:09

576i