[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] pyQt5.7 and QtQuick
From: Louis Simons <lousimons () gmail ! com>
Date: 2016-10-17 22:27:24
Message-ID: CAJG7t=m0AHnHdakcpsSa5eAC6NPO0vvQEvTe2hXPAaLBbDcQQQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
That fixed it! I still get the "Xlib: extension "NV-GLX" missing on
display ":0"." warning, but my demo program works. This has been a heck of
a quest.
Thanks,
Louis
On Mon, Oct 17, 2016 at 5:03 AM Arjen Hiemstra <a.hiemstra@ultimaker.com>
wrote:
> On Saturday, 15 October 2016 12:35:05 CEST Louis Simons wrote:
> > I built and installed PyQT and SIP from scratch on my installation, and
> now
> > get a little farther. I think my Ubuntu default version of SIP wasn't
> the
> > latest which was causing weirdness. I don't get a seg. fault, but I
> simply
> > get a white screen with a bunch of errors like the following:
> >
> > 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
> > QOpenGLShaderProgram: could not create shader program
> > QOpenGLShader: could not create shader
> > QOpenGLShader: could not create shader
> > ...
> > Xlib: extension "NV-GLX" missing on display ":0".
> >
> > I think the last line is key. I've updated my graphics drivers to the
> > latest available for my graphics card (NVIDIA 340.98, had 340.96
> > previously), and I'm pretty sure "NV-GLX" really isn't missing since I
> can
> > still run the C++ version of the program. PyQT QtWidgets still work
> fine.
> > It seems to be either something unique to using OpenGL from Python or
> from
> > PyQT. Hoping that someone has seen something like this before and can
> > point me in the right direction, or at least something new to try.
>
> There is a known issue on Ubuntu when using PyQt OpenGL with NVidia binary
> drivers where it will load the Mesa GL libraries instead of the NVidia GL
> libraries and fail to compile shaders. See
> https://bugs.launchpad.net/ubuntu/
> +source/python-qt4/+bug/941826
> <https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826> . The
> workaround is to use the following
> snippet before importing any OpenGL:
>
> import ctypes
> from ctypes.util import find_library
> libGL = find_library("GL")
> ctypes.CDLL(libGL, ctypes.RTLD_GLOBAL)
>
> This will ensure the right libGL is loaded before the dynamic loading
> process
> kicks in.
>
>
[Attachment #5 (text/html)]
<div dir="ltr">That fixed it! I still get the "Xlib: extension \
"NV-GLX" missing on display ":0"." warning, but my demo \
program works. This has been a heck of a \
quest.<div><div><br></div><div>Thanks,</div><div>Louis</div></div></div><br><div \
class="gmail_quote"><div dir="ltr">On Mon, Oct 17, 2016 at 5:03 AM Arjen Hiemstra \
<<a href="mailto:a.hiemstra@ultimaker.com">a.hiemstra@ultimaker.com</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">On Saturday, 15 October 2016 \
12:35:05 CEST Louis Simons wrote:<br class="gmail_msg"> > I built and installed \
PyQT and SIP from scratch on my installation, and now<br class="gmail_msg"> > get \
a little farther. I think my Ubuntu default version of SIP wasn't the<br \
class="gmail_msg"> > latest which was causing weirdness. I don't get a seg. \
fault, but I simply<br class="gmail_msg"> > get a white screen with a bunch of \
errors like the following:<br class="gmail_msg"> ><br class="gmail_msg">
> QOpenGLShaderProgram: could not create shader program<br class="gmail_msg">
> QOpenGLShader: could not create shader<br class="gmail_msg">
> QOpenGLShader: could not create shader<br class="gmail_msg">
> shader compilation failed:<br class="gmail_msg">
> ""<br class="gmail_msg">
> QOpenGLShaderProgram::uniformLocation( matrix ): shader program is not<br \
class="gmail_msg"> > linked<br class="gmail_msg">
> QOpenGLShaderProgram::uniformLocation( opacity ): shader program is not<br \
class="gmail_msg"> > linked<br class="gmail_msg">
> QOpenGLShaderProgram: could not create shader program<br class="gmail_msg">
> QOpenGLShader: could not create shader<br class="gmail_msg">
> QOpenGLShader: could not create shader<br class="gmail_msg">
> ...<br class="gmail_msg">
> Xlib: extension "NV-GLX" missing on display ":0".<br \
class="gmail_msg"> ><br class="gmail_msg">
> I think the last line is key. I've updated my graphics drivers to the<br \
class="gmail_msg"> > latest available for my graphics card (NVIDIA 340.98, had \
340.96<br class="gmail_msg"> > previously), and I'm pretty sure \
"NV-GLX" really isn't missing since I can<br class="gmail_msg"> > \
still run the C++ version of the program. PyQT QtWidgets still work fine.<br \
class="gmail_msg"> > It seems to be either something unique to using OpenGL from \
Python or from<br class="gmail_msg"> > PyQT. Hoping that someone has seen \
something like this before and can<br class="gmail_msg"> > point me in the right \
direction, or at least something new to try.<br class="gmail_msg"> <br \
class="gmail_msg"> There is a known issue on Ubuntu when using PyQt OpenGL with \
NVidia binary<br class="gmail_msg"> drivers where it will load the Mesa GL libraries \
instead of the NVidia GL<br class="gmail_msg"> libraries and fail to compile shaders. \
See <a href="https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826" \
rel="noreferrer" class="gmail_msg" \
target="_blank">https://bugs.launchpad.net/ubuntu/<br class="gmail_msg"> \
+source/python-qt4/+bug/941826</a> . The workaround is to use the following<br \
class="gmail_msg"> snippet before importing any OpenGL:<br class="gmail_msg">
<br class="gmail_msg">
import ctypes<br class="gmail_msg">
from ctypes.util import find_library<br class="gmail_msg">
libGL = find_library("GL")<br class="gmail_msg">
ctypes.CDLL(libGL, ctypes.RTLD_GLOBAL)<br class="gmail_msg">
<br class="gmail_msg">
This will ensure the right libGL is loaded before the dynamic loading process<br \
class="gmail_msg"> kicks in.<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>
[Attachment #6 (text/plain)]
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic