Hi Paul,

I just did a test on my Kubuntu system and used top to track the CPU
utilization and found that when spinning the cow.osg CPU usage is very
low, but when I stop the model spinning the CPU usage goes up to 100%.
 Ooops looks like the code is going into a spin lock.  However, if I
enable the limiting of the frame rate CPU usage when using
run-on-demand goes back down to near 0:

   osgviewer --run-max-frame-rate 100 --run-on-demand cow.osg


So my guess is that the frame loop, when runing on demand, is just
running in a continuous loop checking where a new frame is required.
The solution to high CPU utilization is likely to be just to add a
sleep when on demand rendering is enabled and there is nothing to do.
I'll look into this.


Robert.

On Wed, Apr 14, 2010 at 2:22 PM,osgviewer --run-max-frame-rate 100
--run-on-demand cow.osg Paul Gotzel <paul.got...@us.cd-adapco.com>
wrote:
> Robert,
>
> Are you referring to a vsync option on my graphics card?   I'm running Linux
> and I have an option called Sync to VBlank.  Checking or unchecking this
> option has no effect.  I also run  develop other OpenGL applications without
> this problem so I doubt it is a graphics card setting.
>
> I'm running the distributed 2.9.7 (debug) version of the osgviewer with the
> following command:
>
> $ osgviewerd --run-on-demand cow.osg
>
> I also saw this with 2.8.2.  I don't rotate the view or move the mouse.  Any
> thoughts?  I'll try to debug it to see what logic is actually using CPU.
>
> Thanks,
> Paul
>
>
> Robert Osfield wrote:
>
> Hi Paul,
>
> On Tue, Apr 13, 2010 at 10:46 PM, Paul Gotzel
> <paul.got...@us.cd-adapco.com> wrote:
>
>
> Something I've noticed since I started using osg is that the viewer uses all
> of one cpu even when the view is not changing.
>
>
> Do you have vsync off?  If so enable it right away.  You should only
> ever have vsync off if you are doing very specific types of
> benchmarking.  Vsync off wastes energy and ruins visual quality.
>
>
>
> I've tried passing the
> --run-on-demand option to osgviewer and  doing
> viewer.setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND); in code and
> there is no difference.  What gives?
>
>
> On demand rendering checks to see if the the scene graph needs
> updating, if it does it lets the frame go ahead.  Perhaps you have
> something that animates in your scene.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to