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

Shader errors and blank window on Ubuntu Gnome 16.10 #11

Closed
acerspyro opened this issue Mar 25, 2017 · 16 comments
Closed

Shader errors and blank window on Ubuntu Gnome 16.10 #11

acerspyro opened this issue Mar 25, 2017 · 16 comments
Labels

Comments

@acerspyro
Copy link

acerspyro commented Mar 25, 2017

All the dependencies have been installed correctly.
Installed using pip3 install . --upgrade.
Opens a blank window and throws the same errors multiple times in the terminal.

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

@TheLastProject
Copy link
Member

Thanks for the report. From my research with you on IRC, this seems to be a bug with the proprietary nvidia driver: https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826.

Possible workaround seem to be:
spyder-ide/spyder#3226 (comment)

@TheLastProject
Copy link
Member

Should be fixed in 41d5b33

@pawamoy
Copy link

pawamoy commented Sep 19, 2017

Still have this error on Debian, shader program is not linked, black window.

@TheLastProject
Copy link
Member

Just to confirm, you do have python3-opengl installed?

@pawamoy
Copy link

pawamoy commented Sep 19, 2017

Yup, saw that in the referenced commit and installed it.

@pawamoy
Copy link

pawamoy commented Sep 19, 2017

But in fact, pext still warns me that it is not installed :/

@pawamoy
Copy link

pawamoy commented Sep 19, 2017

Alright, fixed it with sudo pip3 install PyOpenGL!

@TheLastProject
Copy link
Member

All of this seems really odd to me, but hey, if it works that's great. So far you're the first person I run into for who installing python3-opengl doesn't work, but I'll make sure to update troubleshooting if I hear more such cases, thanks!

@jean
Copy link
Contributor

jean commented Oct 31, 2018

$ pip3 install --user pext
$ pext
python3-opengl is not installed. If Pext fails to render, please try installing it. See https://github.com/Pext/Pext/issues/11.
... 

$ sudo apt install python3-opengl
...
$ pext
Traceback (most recent call last):
  File "/home/john/.local/bin/pext", line 7, in <module>
    from pext.__main__ import main
  File "/home/john/.local/lib/python3.5/site-packages/pext/__main__.py", line 75, in <module>
    from OpenGL import GL  # NOQA
  File "/usr/lib/python3/dist-packages/OpenGL/GL/__init__.py", line 3, in <module>
    from OpenGL.GL.VERSION.GL_1_1 import *
  File "/usr/lib/python3/dist-packages/OpenGL/GL/VERSION/GL_1_1.py", line 10, in <module>
    from OpenGL import platform, constants, constant, arrays
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/__init__.py", line 22, in <module>
    formathandler.FormatHandler.loadAll()
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/formathandler.py", line 28, in loadAll
    cls.loadPlugin( entrypoint )
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/formathandler.py", line 35, in loadPlugin
    plugin_class = entrypoint.load()
  File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 14, in load
    return importByName( self.import_path )
  File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 28, in importByName
    module = __import__( ".".join(moduleName), {}, {}, moduleName)
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/vbo.py", line 430, in <module>
    def mapVBO( vbo, access=GL.GL_READ_WRITE ):
AttributeError: module 'OpenGL.GL' has no attribute 'GL_READ_WRITE'

Pext 0.20
python3-opengl: 3.0.2-1

Running without opengl does actually work, but it doesn't look as pretty as the screenshot.
This also happens with Pext 0.20+13.g1e72ba4

@TheLastProject
Copy link
Member

How odd. I'll reopen this as apparently it's not properly fixed then. I assume this means the AppImage won't work for you either, as it ships with pyopengl? I wonder if we can deal with this edge case safely with a try/except around the import. Thanks for your note!

@jean
Copy link
Contributor

jean commented Oct 31, 2018

I'm on Mint Linux, so I dunno about the AppImage 😬

@TheLastProject
Copy link
Member

Well, the AppImage actually runs on any Linux platform. It's a standalone executable.

Anyway, could you check for me if the latest commit I made causes it to work in both cases?

With regards to "but it doesn't look as pretty as the screenshot", a screenshot would be great to be able to tell what seems off :)

@jean
Copy link
Contributor

jean commented Oct 31, 2018

With the latest commit, the exception is still logged, but pext starts fine.
except Exception as e: is pretty uncool, though. Catching AttributeError should work.
It looks like PyOpenGL 3.1.0 fixes it: wapiflapi/binglide#9 (comment) (it does, I checked)

So maybe something like this would help:

--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,8 @@ setup(
         'dulwich',
         'pynput',
         'pyqt5',
-        'requests'
+        'requests',
+        'PyOpenGL >= 3.1.0'
     ] + extra_deps,

Not making a PR as install doesn't strictly require PyOpenGL ..

@jean
Copy link
Contributor

jean commented Oct 31, 2018

doesn't look as pretty

It was starting up with a full-width window across my 21" monitor.
But now it's behaving nicely 😁

@TheLastProject
Copy link
Member

except Exception as e: is pretty uncool, though.

I understand the concern, but at the same time, the import itself is a workaround. If it doesn't go well, I'd rather Pext just continues launching because it likely will work fine, only certain configs need it

It was starting up with a full-width window across my 21" monitor.

That was fixed in the development version yes :)

@jean
Copy link
Contributor

jean commented Oct 31, 2018 via email

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

No branches or pull requests

4 participants