Kivy does not detect OpenGL 2.0

Matic Brank picture Matic Brank · Jan 23, 2016 · Viewed 22.3k times · Source

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?

Answer

576i picture 576i · Aug 10, 2016

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>