Ok, I think I found the problem. Apparently the PyQt application ends up loading the Mesa GL library (/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0) instead of the NVidia driver (/usr/lib/nvidia-331/libGL.so.331.38) that is loaded when importing PyOpenGL first.
The difference seems to be the library name when calling dlopen(). PyOpenGL tries to import "libGL.so.1", whereas PyQt imports "libGL.so", without the ".1" suffix. A simple C application calling dlopen() and checking /proc/<pid>/maps shows that "libGL.so" points to the Mesa driver, whereas "libGL.so.1" ends up loading the NVidia driver. So this is a bug in Ubuntu's NVidia package I assume? -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to nvidia-graphics-drivers-331-updates in Ubuntu. https://bugs.launchpad.net/bugs/941826 Title: PyQt cannot compile shaders with Ubuntu's Nvidia drivers Status in NVIDIA Drivers Ubuntu: New Status in “nvidia-graphics-drivers-331-updates” package in Ubuntu: Confirmed Status in “pyqt5” package in Ubuntu: New Status in “python-qt4” package in Ubuntu: Confirmed Bug description: I'm having trouble with a combination of NVIDIA + Python + Qt + Opengl. I tried using a QGraphicsView on a QGLWidget. I'm getting a white window and errors like this these: QGLShader: could not create shader Vertex shader for simpleShaderProg (MainVertexShader &PositionOnlyVertexShader) failed to compile This is an example application triggering the problem: http://pastebin.com/R0aa8ejs The 'same' program works flawlessly when using C++/Qt. I'm seeing the exact behavior when using PySide instead of PyQt4 by the way. I'm also seeing this error when trying the original demo application from python-qt4-doc. Also, calling QtGui.QApplication.setGraphicsSystem("opengl") produces the same errors. I'm experiencing this problems on 11.10 and 12.04 with the ubuntu- provided nvidia drivers (where 12.04 includes the most recent driver for now). After installing the driver using the original NVidia installer, the applications work as expected. To manage notifications about this bug go to: https://bugs.launchpad.net/nvidia-drivers-ubuntu/+bug/941826/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp

