Re: Using PyopenGL with GLArea

Matti Kariluoma <[email protected]> Wed, 8 Mar 2017 09:25:16 -0600
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============8160335153540464594==
Content-Type: multipart/alternative;
	boundary="------------768596CD83ACF5FFAFF0DEC1"

This is a multi-part message in MIME format.
--------------768596CD83ACF5FFAFF0DEC1
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

I will take a look on Saturday.

1) In the meantime, could you create a minimal example that demonstrates 
the problem?

Its always very interesting to see simple-looking code that works on 
some platforms but doesn't work on others; we just had an example of 
such two weeks ago from another user.

Ideally your minimal example would not involve the use of the `gi' 
module, or at the very least, include instructions to bring a fresh 
installation up with that package installed, i.e. "sudo apt-get install 
..."

2) Does your problem require `gi' for this error to show?

3) Is the error reproducible under GLUT or GLFW?

4) If (2), what steps are needed to install `gi', and what version of `gi'?

On 3/5/17 12:49 PM, Oly wrote:
> 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] 
> <mailto:[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]
>     <mailto:[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] <mailto:[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]
>             <mailto:[email protected]>
>             https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>


--------------768596CD83ACF5FFAFF0DEC1
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>I will take a look on Saturday.</p>
    <p>1) In the meantime, could you create a minimal example that
      demonstrates the problem? <br>
    </p>
    <p>Its always very interesting to see simple-looking code that works
      on some platforms but doesn't work on others; we just had an
      example of such two weeks ago from another user.<br>
    </p>
    <p>Ideally your minimal example would not involve the use of the
      `gi' module, or at the very least, include instructions to bring a
      fresh installation up with that package installed, i.e. "sudo
      apt-get install ..." <br>
    </p>
    <p>2) Does your problem require `gi' for this error to show? <br>
    </p>
    <p>3) Is the error reproducible under GLUT or GLFW?<br>
    </p>
    <p>4) If (2), what steps are needed to install `gi', and what
      version of `gi'?<br>
    </p>
    <div class="moz-cite-prefix">On 3/5/17 12:49 PM, Oly wrote:<br>
    </div>
    <blockquote
cite="mid:CAPZowhzxv2iTWoDVJPppF21=D-s5pNMwy2nszGgKZvdWM=4Cbg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Just another thing of note,<br>
        <br>
        using PYOPENGL_PLATFORM = "osmesa" 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 defaulting to mesa and x11 is using something
        else.<br>
        <br>
        feels like i am getting nearer to a solution, or at least a work
        around.<br>
        <br>
        <br>
        <pre>
</pre>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Sun, 5 Mar 2017 at 17:29 Oly &lt;<a
            moz-do-not-send="true" href="mailto:[email protected]">[email protected]</a>&gt;
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr" class="gmail_msg">
            <div class="gmail_msg">Also because it maybe useful, i have
              this being reported by gtk / opengl.<br class="gmail_msg">
              <br class="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="gmail_msg">
              OpenGL Version 4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA<br
                class="gmail_msg">
              OpenGL Renderer Mesa_DRI_Intel(R)_Kabylake_GT2_<br
                class="gmail_msg">
              Shader Language version 4.50<br class="gmail_msg">
              <br class="gmail_msg">
            </div>
            so it looks like things should be new enough to support that
            feature under wayland.<br class="gmail_msg">
            <div class="gmail_msg"><br class="gmail_msg">
            </div>
          </div>
          <br class="gmail_msg">
          <div class="gmail_quote gmail_msg">
            <div dir="ltr" class="gmail_msg">On Sun, 5 Mar 2017 at 17:28
              Oly &lt;<a moz-do-not-send="true"
                href="mailto:[email protected]" class="gmail_msg"
                target="_blank">[email protected]</a>&gt; wrote:<br
                class="gmail_msg">
            </div>
            <blockquote class="gmail_quote gmail_msg" style="margin:0 0
              0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr" class="gmail_msg">
                <div class="gmail_msg">
                  <div class="gmail_msg">
                    <div class="gmail_msg">
                      <div class="gmail_msg">
                        <div class="gmail_msg">Thanks for the offer not
                          sure how i missed your reply.<br
                            class="gmail_msg">
                          <br class="gmail_msg">
                        </div>
                        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.<br
                          class="gmail_msg">
                        <br class="gmail_msg">
                      </div>
                      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.<br class="gmail_msg">
                      <br class="gmail_msg">
                    </div>
                    Not sure why wayland would effect what available to
                    me anyone seen anything similar ?<br
                      class="gmail_msg">
                    <br class="gmail_msg">
                  </div>
                  Seems it i graphics card related.<br class="gmail_msg">
                  <br class="gmail_msg">
                </div>
                I did not know about this trick
                PYOPENGL_PLATFORM="osmesa" so thats useful to know but
                it does not help unfortunately.<br class="gmail_msg">
                <div class="gmail_msg">
                  <div class="gmail_msg">
                    <div class="gmail_msg">
                      <div class="gmail_msg"><br class="gmail_msg">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <br class="gmail_msg">
              <div class="gmail_quote gmail_msg">
                <div dir="ltr" class="gmail_msg">On Sun, 12 Feb 2017 at
                  20:20 Matti Kariluoma &lt;<a moz-do-not-send="true"
                    href="mailto:[email protected]"
                    class="gmail_msg" target="_blank">[email protected]</a>&gt;
                  wrote:<br class="gmail_msg">
                </div>
                <blockquote class="gmail_quote gmail_msg"
                  style="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't have the `gi' package<br
                    class="gmail_msg">
                  on my machine, and `pip install gi' can't find it
                  either.<br class="gmail_msg">
                  <br class="gmail_msg">
                  1) Would you accept help in the form of a program that
                  starts with<br class="gmail_msg">
                  `from OpenGL import GLUT' , or does your problem
                  require gi?<br class="gmail_msg">
                  <br class="gmail_msg">
                  As for the error you posted, looking at <a
                    moz-do-not-send="true"
                    href="https://mesamatrix.net/" rel="noreferrer"
                    class="gmail_msg" target="_blank">https://mesamatrix.net/</a>
                  I see<br class="gmail_msg">
                  that glGenVertexArrays is a part of OpenGL 3.0,
                  extension<br class="gmail_msg">
                  GL_ARB_vertex_array_object which seems to have broad
                  support.<br class="gmail_msg">
                  <br class="gmail_msg">
                  2) Maybe your graphics device (or its driver) is
                  ancient?<br class="gmail_msg">
                  <br class="gmail_msg">
                  Since your gist seems to indicate you are using GTK, I
                  assume you are<br class="gmail_msg">
                  running this under Linux. You may want to look into
                  running PyOpenGL<br class="gmail_msg">
                  under mesa, using one of their software renderers if
                  for whatever<br class="gmail_msg">
                  reason you don't have OpenGL3.0 support.<br
                    class="gmail_msg">
                  <br class="gmail_msg">
                  Using the mesa CPU renderer under Linux:<br
                    class="gmail_msg">
                  <a moz-do-not-send="true"
href="http://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%20Scenes.html"
                    rel="noreferrer" class="gmail_msg" target="_blank">http://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%20Scenes.html</a><br
                    class="gmail_msg">
                  <br class="gmail_msg">
                  &gt;From: Oliver Marks <a class="moz-txt-link-rfc2396E" href="mailto:oly@di...">&lt;oly@di...&gt;</a> - 2017-02-11
                  22:40:09<br class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;Thought i would have a stab at trying to make this
                  work, I cant find any<br class="gmail_msg">
                  &gt;existing working examples.<br class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;I have linked a gist if any one want to try.<br
                    class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;currently I am getting this error.<br
                    class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;OpenGL.error.NullFunctionError: Attempt to call an
                  undefined function<br class="gmail_msg">
                  &gt;glGenVertexArrays, check for
                  bool(glGenVertexArrays) before calling<br
                    class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;Which to me sounds like its not available to the
                  context, GLArea is<br class="gmail_msg">
                  &gt;supplying the context so i am unsure why this
                  would be ?<br class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;Any ideas or can anyone give me some pointers ?<br
                    class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  &gt;<a moz-do-not-send="true"
                    href="https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c3"
                    rel="noreferrer" class="gmail_msg" target="_blank">https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c3</a><br
                    class="gmail_msg">
                  &gt;<br class="gmail_msg">
                  <br class="gmail_msg">
------------------------------------------------------------------------------<br
                    class="gmail_msg">
                  Check out the vibrant tech community on one of the
                  world's most<br class="gmail_msg">
                  engaging tech sites, SlashDot.org! <a
                    moz-do-not-send="true"
                    href="http://sdm.link/slashdot" rel="noreferrer"
                    class="gmail_msg" target="_blank">http://sdm.link/slashdot</a><br
                    class="gmail_msg">
                  _______________________________________________<br
                    class="gmail_msg">
                  PyOpenGL Homepage<br class="gmail_msg">
                  <a moz-do-not-send="true"
                    href="http://pyopengl.sourceforge.net"
                    rel="noreferrer" class="gmail_msg" target="_blank">http://pyopengl.sourceforge.net</a><br
                    class="gmail_msg">
                  _______________________________________________<br
                    class="gmail_msg">
                  PyOpenGL-Users mailing list<br class="gmail_msg">
                  <a moz-do-not-send="true"
                    href="mailto:[email protected]"
                    class="gmail_msg" target="_blank">[email protected]</a><br
                    class="gmail_msg">
                  <a moz-do-not-send="true"
                    href="https://lists.sourceforge.net/lists/listinfo/pyopengl-users"
                    rel="noreferrer" class="gmail_msg" target="_blank">https://lists.sourceforge.net/lists/listinfo/pyopengl-users</a><br
                    class="gmail_msg">
                </blockquote>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------768596CD83ACF5FFAFF0DEC1--


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

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
--===============8160335153540464594==
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

--===============8160335153540464594==--