50% CPU during Demo app
50% CPU during Demo app
Hello,
I have downloaded Irrlicht 1.4.1.
When I start the demo my Core 2 Duo goes up to 50% CPU working capacity.
On 1 Core machine, I get always a 100% CPU working capacity.
Is this normal?
Thanks in advance.
I have downloaded Irrlicht 1.4.1.
When I start the demo my Core 2 Duo goes up to 50% CPU working capacity.
On 1 Core machine, I get always a 100% CPU working capacity.
Is this normal?
Thanks in advance.
Yep, it's normal. The render loop (while (device->run()) just goes round around without pausing, if you want to reduce the CPU load then you can put a small sleep at the end of the loop. But does it matter if the app is using large amounts of the CPU time? For most cases Irrlicht will be the only app the user is interested in running, though if you're writing a tool of some sort then yeah users might want to be switching to look at folders or other apps at the same time i suppose.
I think he wants his Dualcore-machine working with 100% too. If so he has to change his code. OpenMP is a (easy to use) multiprocessing librarie which will make his application working on both cores (with 100%). I guess that he will have to write some extra lines of code if he wants to use openMP.
--Blender3D
--Blender3D
cat /dev/brain | sort
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Why don't we just hand him a loaded gun and telling him to shove it down his pants with the safety catch off?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Sure, a professional engine on a modern multi-core machine will benefit from threading, but this poster is having trouble seeing why 100% load on a single core is consistent with 50% load on a dual core.
Let's at least let him stab himself with a rogue pointer before we smother him in contention and race bugs.
Let's at least let him stab himself with a rogue pointer before we smother him in contention and race bugs.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
You have a Pentium D?
You have 50% of CPU work because these processors use 2 cores and eachhave it's own memory. But now Intel and AMD have created processors with 1 shared memory for 2 or plus cores.
On a recent engine i'm not sure threads will be more efficient than no thread, even if on an quite older engine (2, 3 years...) it will be a great optimization
You have 50% of CPU work because these processors use 2 cores and eachhave it's own memory. But now Intel and AMD have created processors with 1 shared memory for 2 or plus cores.
On a recent engine i'm not sure threads will be more efficient than no thread, even if on an quite older engine (2, 3 years...) it will be a great optimization
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
Re: 50% CPU during Demo app
ok i would be intrested in that small sleep
u see, in linux (windows too, u can set cpu max and min freq in the power management profiles in vista and 7) if u'r familiar with the governor it allows u to set the cpu frequency either a specific one or ondeamand (freq goes up and down has needed avoiding high temperatures) well what happens when irrlicht starts is since it pull all cicles of the cpu core 0 or even on single core is that it triggers the ondemand and pulls the frequency to max forcing the cpu to start heating unnecessarily and i say that becaus if i force the governor to its minimum frequency irrlicht runs at the same fps and performance whatsoever at least until it get some real work to do.
so basically what i want is a chance for governor to work has intended and only scale up the frequency when it is really necessary saving my cpu and its life span.
u see, in linux (windows too, u can set cpu max and min freq in the power management profiles in vista and 7) if u'r familiar with the governor it allows u to set the cpu frequency either a specific one or ondeamand (freq goes up and down has needed avoiding high temperatures) well what happens when irrlicht starts is since it pull all cicles of the cpu core 0 or even on single core is that it triggers the ondemand and pulls the frequency to max forcing the cpu to start heating unnecessarily and i say that becaus if i force the governor to its minimum frequency irrlicht runs at the same fps and performance whatsoever at least until it get some real work to do.
so basically what i want is a chance for governor to work has intended and only scale up the frequency when it is really necessary saving my cpu and its life span.
Re: 50% CPU during Demo app
See the GUI editor source code, if I remember correctly it uses either Device->yield() or Device->sleep(2) to prevent Irrlicht from hogging all the CPU time.
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
Re: 50% CPU during Demo app
nice i'll look in to it this weekend, thx for the tip.
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
Re: 50% CPU during Demo app
very nice. I had a quick look at the code and i might add de demo app seams to have a better implementation than the gui editor, i tested the sleep that features in the gui editor in the perpixel lightning tutorial, it works but it is hard do correctly tune since it differs from cpu to cpu, a problem that de demo app doesn't seam to have, does de demo app have any kind of function to adjust the sleep timing acording to the cpu power or the detected fps?!? i din't had the time to look in to it, when i get the time to it i'll have a closer look at the demo app and post my results here. this seam to be an oportunity for a new tutorial to help the noobs that wish to have a more smooth, more stable and better tuned program by requesting only the necessary resources from the computer