Re: Using PyopenGL with GLArea

Oly <[email protected]> Sun, 05 Mar 2017 18:49:12 +0000
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAPZowhzxv2iTWoDVJPppF21=D-s5pNMwy2nszGgKZvdWM=4Cbg@mail.gmail.com>
--===============7594748541840926812==
Content-Type: multipart/alternative; boundary=001a11402bcabd7c4e054a003ca3

--001a11402bcabd7c4e054a003ca3
Content-Type: text/plain; charset=UTF-8

Just another thing of note,

using PYOPENGL_PLATFORM = "osmesa" with x11 causes the same issue, so it
would appear related to the mesa drivers.

What other options can that take, can i enforce nvidia or intel instead of
osmesa ?

perhaps wayland is defaulting to mesa and x11 is using something else.

feels like i am getting nearer to a solution, or at least a work around.




On Sun, 5 Mar 2017 at 17:29 Oly <[email protected]> wrote:

> Also because it maybe useful, i have this being reported by gtk / opengl.
>
>
> Intel_Open_Source_Technology_Center_4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA_Mesa_DRI_Intel(R)_Kabylake_GT2__4.50
> OpenGL Version 4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA
> OpenGL Renderer Mesa_DRI_Intel(R)_Kabylake_GT2_
> Shader Language version 4.50
>
> so it looks like things should be new enough to support that feature under
> wayland.
>
>
> On Sun, 5 Mar 2017 at 17:28 Oly <[email protected]> wrote:
>
> Thanks for the offer not sure how i missed your reply.
>
> Anyway i made some progress, yes my issue is with linux and gtk
> specifically I have also found out it has something todo with wayland.
>
> Running the example i can get it to work with my intel and nvidia graphics
> (optimus card) on x11 but if i am using wayland then i get the error above.
>
> Not sure why wayland would effect what available to me anyone seen
> anything similar ?
>
> Seems it i graphics card related.
>
> I did not know about this trick PYOPENGL_PLATFORM="osmesa" so thats useful
> to know but it does not help unfortunately.
>
>
> On Sun, 12 Feb 2017 at 20:20 Matti Kariluoma <[email protected]>
> wrote:
>
> I tried to have a look at your code, but I don't have the `gi' package
> on my machine, and `pip install gi' can't find it either.
>
> 1) Would you accept help in the form of a program that starts with
> `from OpenGL import GLUT' , or does your problem require gi?
>
> As for the error you posted, looking at https://mesamatrix.net/ I see
> that glGenVertexArrays is a part of OpenGL 3.0, extension
> GL_ARB_vertex_array_object which seems to have broad support.
>
> 2) Maybe your graphics device (or its driver) is ancient?
>
> Since your gist seems to indicate you are using GTK, I assume you are
> running this under Linux. You may want to look into running PyOpenGL
> under mesa, using one of their software renderers if for whatever
> reason you don't have OpenGL3.0 support.
>
> Using the mesa CPU renderer under Linux:
>
> http://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%20Scenes.html
>
> >From: Oliver Marks <oly@di...> - 2017-02-11 22:40:09
> >
> >Thought i would have a stab at trying to make this work, I cant find any
> >existing working examples.
> >
> >I have linked a gist if any one want to try.
> >
> >currently I am getting this error.
> >
> >OpenGL.error.NullFunctionError: Attempt to call an undefined function
> >glGenVertexArrays, check for bool(glGenVertexArrays) before calling
> >
> >Which to me sounds like its not available to the context, GLArea is
> >supplying the context so i am unsure why this would be ?
> >
> >Any ideas or can anyone give me some pointers ?
> >
> >https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c3
> >
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> PyOpenGL Homepage
> http://pyopengl.sourceforge.net
> _______________________________________________
> PyOpenGL-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>
>

--001a11402bcabd7c4e054a003ca3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Just another thing of note,<br><br>using PYOPENGL_PLATFORM=
 =3D &quot;osmesa&quot; with x11 causes the same issue, so it would appear =
related to the mesa drivers.<br><br>What other options can that take, can i=
 enforce nvidia or intel instead of osmesa ? <br><br>perhaps wayland is def=
aulting to mesa and x11 is using something else.<br><br>feels like i am get=
ting nearer to a solution, or at least a work around.<br><br><br><pre><br><=
/pre></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, 5 Mar 20=
17 at 17:29 Oly &lt;<a href=3D"mailto:[email protected]">[email protected]</a=
>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr" class=
=3D"gmail_msg"><div class=3D"gmail_msg">Also because it maybe useful, i hav=
e this being reported by gtk / opengl.<br class=3D"gmail_msg"><br class=3D"=
gmail_msg">Intel_Open_Source_Technology_Center_4.5_(Core_Profile)_Mesa_17.0=
.0_-_padoka_PPA_Mesa_DRI_Intel(R)_Kabylake_GT2__4.50<br class=3D"gmail_msg"=
>OpenGL Version 4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA<br class=3D"gma=
il_msg">OpenGL Renderer Mesa_DRI_Intel(R)_Kabylake_GT2_<br class=3D"gmail_m=
sg">Shader Language version 4.50<br class=3D"gmail_msg"><br class=3D"gmail_=
msg"></div>so it looks like things should be new enough to support that fea=
ture under wayland.<br class=3D"gmail_msg"><div class=3D"gmail_msg"><br cla=
ss=3D"gmail_msg"></div></div><br class=3D"gmail_msg"><div class=3D"gmail_qu=
ote gmail_msg"><div dir=3D"ltr" class=3D"gmail_msg">On Sun, 5 Mar 2017 at 1=
7:28 Oly &lt;<a href=3D"mailto:[email protected]" class=3D"gmail_msg" target=
=3D"_blank">[email protected]</a>&gt; wrote:<br class=3D"gmail_msg"></div><b=
lockquote class=3D"gmail_quote gmail_msg" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr" class=3D"gmail_msg"=
><div class=3D"gmail_msg"><div class=3D"gmail_msg"><div class=3D"gmail_msg"=
><div class=3D"gmail_msg"><div class=3D"gmail_msg">Thanks for the offer not=
 sure how i missed your reply.<br class=3D"gmail_msg"><br class=3D"gmail_ms=
g"></div>Anyway i made some progress, yes my issue is with linux and gtk sp=
ecifically I have also found out it has something todo with wayland.<br cla=
ss=3D"gmail_msg"><br class=3D"gmail_msg"></div>Running the example i can ge=
t it to work with my intel and nvidia graphics (optimus card) on x11 but if=
 i am using wayland then i get the error above.<br class=3D"gmail_msg"><br =
class=3D"gmail_msg"></div>Not sure why wayland would effect what available =
to me anyone seen anything similar ?<br class=3D"gmail_msg"><br class=3D"gm=
ail_msg"></div>Seems it i graphics card related.<br class=3D"gmail_msg"><br=
 class=3D"gmail_msg"></div>I did not know about this trick PYOPENGL_PLATFOR=
M=3D&quot;osmesa&quot; so thats useful to know but it does not help unfortu=
nately.<br class=3D"gmail_msg"><div class=3D"gmail_msg"><div class=3D"gmail=
_msg"><div class=3D"gmail_msg"><div class=3D"gmail_msg"><br class=3D"gmail_=
msg"></div></div></div></div></div><br class=3D"gmail_msg"><div class=3D"gm=
ail_quote gmail_msg"><div dir=3D"ltr" class=3D"gmail_msg">On Sun, 12 Feb 20=
17 at 20:20 Matti Kariluoma &lt;<a href=3D"mailto:[email protected]=
" class=3D"gmail_msg" target=3D"_blank">[email protected]</a>&gt; w=
rote:<br class=3D"gmail_msg"></div><blockquote class=3D"gmail_quote gmail_m=
sg" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
>I tried to have a look at your code, but I don&#39;t have the `gi&#39; pac=
kage<br class=3D"gmail_msg">
on my machine, and `pip install gi&#39; can&#39;t find it either.<br class=
=3D"gmail_msg">
<br class=3D"gmail_msg">
1) Would you accept help in the form of a program that starts with<br class=
=3D"gmail_msg">
`from OpenGL import GLUT&#39; , or does your problem require gi?<br class=
=3D"gmail_msg">
<br class=3D"gmail_msg">
As for the error you posted, looking at <a href=3D"https://mesamatrix.net/"=
 rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">https://mesamatri=
x.net/</a> I see<br class=3D"gmail_msg">
that glGenVertexArrays is a part of OpenGL 3.0, extension<br class=3D"gmail=
_msg">
GL_ARB_vertex_array_object which seems to have broad support.<br class=3D"g=
mail_msg">
<br class=3D"gmail_msg">
2) Maybe your graphics device (or its driver) is ancient?<br class=3D"gmail=
_msg">
<br class=3D"gmail_msg">
Since your gist seems to indicate you are using GTK, I assume you are<br cl=
ass=3D"gmail_msg">
running this under Linux. You may want to look into running PyOpenGL<br cla=
ss=3D"gmail_msg">
under mesa, using one of their software renderers if for whatever<br class=
=3D"gmail_msg">
reason you don&#39;t have OpenGL3.0 support.<br class=3D"gmail_msg">
<br class=3D"gmail_msg">
Using the mesa CPU renderer under Linux:<br class=3D"gmail_msg">
<a href=3D"http://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%=
20Scenes.html" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">htt=
p://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%20Scenes.html<=
/a><br class=3D"gmail_msg">
<br class=3D"gmail_msg">
&gt;From: Oliver Marks &lt;oly@di...&gt; - 2017-02-11 22:40:09<br class=3D"=
gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;Thought i would have a stab at trying to make this work, I cant find an=
y<br class=3D"gmail_msg">
&gt;existing working examples.<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;I have linked a gist if any one want to try.<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;currently I am getting this error.<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;OpenGL.error.NullFunctionError: Attempt to call an undefined function<b=
r class=3D"gmail_msg">
&gt;glGenVertexArrays, check for bool(glGenVertexArrays) before calling<br =
class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;Which to me sounds like its not available to the context, GLArea is<br =
class=3D"gmail_msg">
&gt;supplying the context so i am unsure why this would be ?<br class=3D"gm=
ail_msg">
&gt;<br class=3D"gmail_msg">
&gt;Any ideas or can anyone give me some pointers ?<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;<a href=3D"https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d4=
9c3" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">https://gist.=
github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c3</a><br class=3D"gmail_ms=
g">
&gt;<br class=3D"gmail_msg">
<br class=3D"gmail_msg">
---------------------------------------------------------------------------=
---<br class=3D"gmail_msg">
Check out the vibrant tech community on one of the world&#39;s most<br clas=
s=3D"gmail_msg">
engaging tech sites, SlashDot.org! <a href=3D"http://sdm.link/slashdot" rel=
=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">http://sdm.link/slash=
dot</a><br class=3D"gmail_msg">
_______________________________________________<br class=3D"gmail_msg">
PyOpenGL Homepage<br class=3D"gmail_msg">
<a href=3D"http://pyopengl.sourceforge.net" rel=3D"noreferrer" class=3D"gma=
il_msg" target=3D"_blank">http://pyopengl.sourceforge.net</a><br class=3D"g=
mail_msg">
_______________________________________________<br class=3D"gmail_msg">
PyOpenGL-Users mailing list<br class=3D"gmail_msg">
<a href=3D"mailto:[email protected]" class=3D"gmail_msg"=
 target=3D"_blank">[email protected]</a><br class=3D"gma=
il_msg">
<a href=3D"https://lists.sourceforge.net/lists/listinfo/pyopengl-users" rel=
=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">https://lists.sourcef=
orge.net/lists/listinfo/pyopengl-users</a><br class=3D"gmail_msg">
</blockquote></div></blockquote></div></blockquote></div>

--001a11402bcabd7c4e054a003ca3--


--===============7594748541840926812==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--===============7594748541840926812==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users

--===============7594748541840926812==--