QTodoTxt2 icon indicating copy to clipboard operation
QTodoTxt2 copied to clipboard

ensure the correct GL library is loaded

Open davide125 opened this issue 7 years ago • 5 comments

On Debian Stretch, I'm getting nasty OpenGL-related errors and a solid black window:

QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
QOpenGLShaderProgram::uniformLocation( matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( opacity ): shader program is not linked

After digging a bit, it turns out this is due to pyqt5 resolving libGL.so to the mesa version instead of the nvidia one (I'm running the nvidia proprietary driver). This was originally reported for pyqt4 in https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826 which also provides the fix I'm using in this PR.

davide125 avatar Oct 02 '17 05:10 davide125

Thank you for debugging this and find a solution! But I am unsure how to solve it properly. Adding code for a low level platform specific issue in a high level program is a good way to get issues in the future...

oroulet avatar Oct 02 '17 05:10 oroulet

Yeah, this is definitely a hack, and a linux-specific one at that (possibly debian/ubuntu specific, though I suspect other distros might be affected, and it should be a noop if they aren't). I'll update this to make sure it's gated properly.

davide125 avatar Oct 02 '17 06:10 davide125

This is more than linux specific (I run ubuntu and never have seen such an issue), it is specific to linux users with nvidia proprietary driver installed. I think for now the best is to leave that PR open so people who get that issue can just pull it

oroulet avatar Oct 02 '17 06:10 oroulet

Thanks @oroulet. I've rebased this and changed the check to specifically gate the workaround to the presence of the nvidia driver. While I agree it likely is only a significant issue in this specific case, it's not that uncommon of a config, and I'd love to see this merged at some point to save other potential users the pain of having to figure this out by themselves.

davide125 avatar Oct 03 '17 02:10 davide125

I had the same issue as I'm using nvidia drivers, a way to solved was to:

  1. Install pyOpenGL pip3 install pyopengl
  2. Add the following import to qtodotxt2\app.py from OpenGL import GL

rcassani avatar Oct 22 '18 19:10 rcassani