[osg-users] Issue with setCompileOnNextDraw (Robert Osfield)

Robert Osfield robert.osfield at gmail.com
Thu Dec 5 07:56:09 PST 2019


Hi David,

Are you replying to a digest post from the user mailing list, or using
googlegroups?  Each of your replies has a whole bunch of content that has
nothing to do with your reply.  It's kinda hard to follow when  you have to
wade through the irrelevant stuff so I'd like to get to the bottom of this
and fix it in future.

On the need for issues with setCompileOnNextDraw() and the OpenGL error
'invalid enumerant' warnings, it all suggest to me that there is something
amiss with your scene graph, some OpenGL state you are setting in the scene
graph is resulting in OpenGL detecting an error and reporting it as an
"invalid enumerant'.  Unfortunately OpenGL doesn't provide great error
report support, the errors you get don't tell you exactly what previous API
call provoked it, the only thing you can do is increase how often you do a
glGetError() to get the warnings.   The glGetError() call is no cheap so
the OSG by default only checks it once per frame, so any of the OpenGL
calls in the frame could cause the warning you get.

To get the OSG to do finer grained checking you can set the
OSG_GL_ERROR_CHECKING env to ON and it'll check after each
State::applyAttribute(..) call.  This doesn't pinpoint precisely what the
problem is but should help you home in a bit better.

A third party GL debugger tool could also be helpful in this work.

Once you have resolved the error then there is chance you'll see better
performance from your application.

--

As an aside, Vulkan is far better than OpenGL for error reporting, while it
doesn't by default do checking, you can use the debug layer and api
reporting layer to get far richer checking and info from these layers, once
your app is running cleanly you then can not bother adding these layers so
you never pay the cost at runtime in a deployed application, which is best
of both worlds :-)

Robert.


On Thu, 5 Dec 2019 at 15:27, Heitbrink, David A <david-heitbrink at uiowa.edu>
wrote:

> I am only doing setCompileOnNextDraw, after the load of my main scene. If
> I do not do it, then I get a lot more severe hangs.......however after some
> further test I ran into some complications. I have a user set option to use
> this or not. I found if the scene is larger than what can fit on the GPU, I
> am better off not doing this.
>
> I am currently running nodes with 3-4 projectors per node, 2 video cards
> per node. Each projector runs has its own process. What I found from
> running a profiler is glGet*, caused periodic hangs, this included:
>
> glGetInteger64v(GL_TIMESTAMP, &timestamp);
>
> I setup a condition around where said line is used so it is not being run
> unless stats are enabled. So it turns out when I run without stats enabled,
> I get a lot fewer hangs.......but it makes it harder to quantify without
> stats. I am doing ground based simulation, so I have pretty high optical
> flow rates so dropped frames are really noticeable. I don't really see this
> on my development machine, or not to the same degree. My deployment
> machines are older and are running multiple processes. So...problem
> solved.....maybe?
>
> I am still getting 100's of :
> Warning: detected OpenGL error 'invalid enumerant' at after
> stateset.compileGLObjects in GLObjectsVisitor::apply(osg::StateSet&
> stateset)
>
> After setCompileOnNextDraw, and I am still concerned about these messages.
> I have not tracked down exactly what objects being compiled at the time
> are......or if it's every object for that matter.
>
> I was also looking at the shared state manager, I am using OSG 3.6.3. Is
> there anything in particular I should do to use this?
>
> -----Original Message-----
> From: osg-users <osg-users-bounces at lists.openscenegraph.org> On Behalf Of
> osg-users-request at lists.openscenegraph.org
> Sent: Wednesday, December 4, 2019 3:05 PM
> To: osg-users at lists.openscenegraph.org
> Subject: osg-users Digest, Vol 150, Issue 2
>
> Send osg-users mailing list submissions to
>         osg-users at lists.openscenegraph.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> or, via email, send a message with subject or body 'help' to
>         osg-users-request at lists.openscenegraph.org
>
> You can reach the person managing the list at
>         osg-users-owner at lists.openscenegraph.org
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of osg-users digest..."
>
>
> Today's Topics:
>
>    1. Issue with setCompileOnNextDraw (Heitbrink, David A)
>    2. Re: Issue with setCompileOnNextDraw (Robert Osfield)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 4 Dec 2019 14:49:54 +0000
> From: "Heitbrink, David A" <david-heitbrink at uiowa.edu>
> To: "osg-users at lists.openscenegraph.org"
>         <osg-users at lists.openscenegraph.org>
> Subject: [osg-users] Issue with setCompileOnNextDraw
> Message-ID:
>         <
> BN7PR04MB4067C359D54EECA7C8099976FA5D0 at BN7PR04MB4067.namprd04.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="us-ascii"
>
> I am doing a setCompileOnNextDraw on each render for each camera , (I
> typically only have 1) loading my scene.
>
> After doing thing I am getting a large number of error messages:
>
> Warning: detected OpenGL error 'invalid enumerant' at after
> stateset.compileGLObjects in GLObjectsVisitor::apply(osg::StateSet&
> stateset)
>
> It also seems that I am getting a large number of hangs. It looks like I
> have plenty of free memory on the GPU. I am pretty sure this is from
> loading textures.
>
>  When should you use setCompileOnNextDraw? Has any else scene this issue
> before?
>
> -----Original Message-----
> From: osg-users <osg-users-bounces at lists.openscenegraph.org> On Behalf Of
> osg-users-request at lists.openscenegraph.org
> Sent: Tuesday, December 3, 2019 3:05 PM
> To: osg-users at lists.openscenegraph.org
> Subject: [External] osg-users Digest, Vol 150, Issue 1
>
> Send osg-users mailing list submissions to
>         osg-users at lists.openscenegraph.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> or, via email, send a message with subject or body 'help' to
>         osg-users-request at lists.openscenegraph.org
>
> You can reach the person managing the list at
>         osg-users-owner at lists.openscenegraph.org
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of osg-users digest..."
>
>
> Today's Topics:
>
>    1. OpenSceneGraph Forum moved to googlegroups (Robert Osfield)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 3 Dec 2019 10:35:27 +0000
> From: Robert Osfield <robert.osfield at gmail.com>
> To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
> Subject: [osg-users] OpenSceneGraph Forum moved to googlegroups
> Message-ID:
>         <
> CAFN7Y+WxrAucovcgy+aiX9WHGbGN5fBkVsjiFN8YRcZOtpS4vg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi All,
>
> Our old forum was generously created by a member of our community, but a
> number of years ago the creator/manager of the forum moved on work in an
> area unrelated to the OpenSceneGraph so the forum no longer had a
> maintainer, finally the old server that was hosting has gone too.
>
> Previous discussions in the community didn't come up with a replacement,
> and as I don't have any expertise in this direction myself I have adopted
> the osg-users mailing list mirror on googlegroups as the forum, so now when
> you go to forum.openscenegraph you'll be redirected to:
>
>   https://groups.google.com/forum/#!forum/osg-users
>
> The googlegroup doesn't have a record of the membership to the old forum,
> and I don't have a record either, so to use the new googlegroup forum
> you'll need to register with it.
>
> Alternatively, you can use the original osg-users mailing list, and posts
> will be crossed posted automatically.
>
> Cheers,
> Robert.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191203/dbc35821/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ------------------------------
>
> End of osg-users Digest, Vol 150, Issue 1
> *****************************************
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 4 Dec 2019 15:16:45 +0000
> From: Robert Osfield <robert.osfield at gmail.com>
> To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
> Subject: Re: [osg-users] Issue with setCompileOnNextDraw
> Message-ID:
>         <CAFN7Y+UYJLZOcUBk=
> xfgdeQfcp8SLoa3BKxK78_O4bTG0my_4g at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi David,
>
> On Wed, 4 Dec 2019 at 14:50, Heitbrink, David A <david-heitbrink at uiowa.edu
> >
> wrote:
>
> > I am doing a setCompileOnNextDraw on each render for each camera , (I
> > typically only have 1) loading my scene.
> >
>
> CompileOnNextDraw is a feature that is meant to be used sparingly such as
> on start up when you are first pre compiling all new GL objects to prevent
> incremental compiles from breaking frame later in the app run.
>
> First thing you should do is remove that call and see what happens.
>
> Do you have an idea why this line was added?
>
> Robert.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191204/baab7aac/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ------------------------------
>
> End of osg-users Digest, Vol 150, Issue 2
> *****************************************
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191205/394aa0be/attachment.html>


More information about the osg-users mailing list