Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure the correct GL library is loaded #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davide125
Copy link
Contributor

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.

@oroulet
Copy link
Contributor

oroulet commented Oct 2, 2017

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...

@davide125
Copy link
Contributor Author

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.

@oroulet
Copy link
Contributor

oroulet commented Oct 2, 2017

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

@davide125
Copy link
Contributor Author

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 davide125 mentioned this pull request Jan 10, 2018
@rcassani
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants