strange framerate behavior

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
BakeMyCake
Posts: 23
Joined: Sat Jun 15, 2013 3:13 am

strange framerate behavior

Post by BakeMyCake »

Hi guys, I've noticed a strange correlation between the amount of processes running on my machine and how irrlicht performs.

When I do a release build of my irrlicht game and run it as the only application on my desktop it only gives me a constant 65 fps. Note that I have a framerate cap at 150 fps using simple delta time, so that I dont overheat laptop graphics cards, but even if I remove it the fps is 65.

However if I start opening any cpu intensive apps in the background like blender + some archiving software, the framerate goes up to the 150 capped fps or well beyond 2k fps if uncapped. Irrlicht only loads one of my four cores, but that's due to no multithreading support, so it's probably not the cause... Can anyone explain this issue? Why is my framerate increasing with the amount of other applications in the background? And like I can really affect the growth of the fps in the game by loading more or less intensive apps in the background. For example if I browse internet in the background my fps goes from 65 to 100. And if I run a youtube video in the background it goes to 118 fps.

Should I worry about this stuff?

P.S. using 1.8.3 irr
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: strange framerate behavior

Post by hendu »

Your GPU will throttle if the load is lower, it's a power-saving measure. If you need more speed, go to your gpu driver control panel and disable the power saving.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: strange framerate behavior

Post by Granyte »

what brand and model is your gpu?
Dereism
Posts: 1
Joined: Tue Apr 12, 2016 5:17 am

Re: strange framerate behavior

Post by Dereism »

BakeMyCake wrote:Hi guys, I've noticed a strange correlation between the amount of processes running on my machine and how irrlicht performs.

When I do a release build of my irrlicht game and run it as the only application on my desktop it only gives me a constant 65 fps. Note that I have a framerate cap at 150 fps using simple delta time, so that I dont overheat laptop graphics cards, but even if I remove it the fps is 65.

However if I start opening any cpu intensive apps in the background like blender + some archiving software, the framerate goes up to the 150 capped fps or well beyond 2k fps if uncapped. Irrlicht only loads one of my four cores, but that's due to no multithreading support, so it's probably not the cause... Can anyone explain this issue? Why is my framerate increasing with the amount of other applications in the background? And like I can really affect the growth of the fps in the game by loading more or less intensive apps in the background. For example if I browse internet in the background my fps goes from 65 to 100. And if I run a youtube video in the background it goes to 118 fps.

Should I worry about this stuff?

P.S. using 1.8.3 irr
Well this is really weird. Never encountered something like this myself. Perhaps sharing some screencapture and more specs of your hardware might shed some more light on the issue.
BakeMyCake
Posts: 23
Joined: Sat Jun 15, 2013 3:13 am

Re: strange framerate behavior

Post by BakeMyCake »

Sorry for not answering to your questions before. My gpu is Nvidia GTX 660. And this is not really a hardware dependent beghavior it seems as I've mentioned that I've been able to reproduce this on multiple machines. ABout the screen capture I don't know how exactly you would want to witness it. Would a youtube recording be of any help?
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: strange framerate behavior

Post by Cube_ »

well, it likely does relate to hardware throttling for power saving reasons.

Intel, AMD, and Nvidia all support it to more or less - it should be possible to disable in the driver settings for AMD and Nvidia users at least [don't quote me on that, I haven't actually looked around for such a feature]
"this is not the bottleneck you are looking for"
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: strange framerate behavior

Post by mongoose7 »

I can certainly explain why the framerate goes from 65 fps to 150 fps. To get a framerate of 150 you would wait for about 9 ms per frame. But Windows systems normally would not allow you to do this! The default windows clock is 16.77 ms. Yes! Even in this day and age. Clearly there are apps that cannot work under these conditions, like Media Player. If you start Media Player, it will enable the high-resolution timer. But then all timer calls in the system will use this timer, so the base rate goes down from 16.77 to (I guess) 1 ms. And your framerate will go up to the figure you calculated. If you then stop Media Player, your framerate will go back down to 65. You can enable the HRT yourself.

How you get to 2000 fps I do not know. I guess you mean, if you don't cap the rate.
BakeMyCake
Posts: 23
Joined: Sat Jun 15, 2013 3:13 am

Re: strange framerate behavior

Post by BakeMyCake »

mongoose7 wrote:I can certainly explain why the framerate goes from 65 fps to 150 fps. To get a framerate of 150 you would wait for about 9 ms per frame. But Windows systems normally would not allow you to do this! The default windows clock is 16.77 ms. Yes! Even in this day and age. Clearly there are apps that cannot work under these conditions, like Media Player. If you start Media Player, it will enable the high-resolution timer. But then all timer calls in the system will use this timer, so the base rate goes down from 16.77 to (I guess) 1 ms. And your framerate will go up to the figure you calculated. If you then stop Media Player, your framerate will go back down to 65. You can enable the HRT yourself.
Thank you for the answer. It appears that this was the cause of my problem. After looking up the info on timer resolutions on windows I've been able to confirm your statement by enabling the higher resolution timer and getting the proper fps.

For anyone else stuck with the same problem, who needs to know the windows-specific solution, here is the msdn link:
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

I think this timer stuff is pretty important for people who are learning the ropes of Irrlicht.
I'm surprised no one mentioned it in any tutorials. I'm sure this little tip would be really helpful to many beginers. Do you think it would be great if the engine had an interface to do this timer resolution setup?
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: strange framerate behavior

Post by Cube_ »

Why isn't 65 FPS fine anyway?
The reason it's using the low resolution timer is simply because it's sufficient for the task at hand [and that's good for not melting weaker gpus]
"this is not the bottleneck you are looking for"
BakeMyCake
Posts: 23
Joined: Sat Jun 15, 2013 3:13 am

Re: strange framerate behavior

Post by BakeMyCake »

aaammmsterdddam wrote:Why isn't 65 FPS fine anyway?
The reason it's using the low resolution timer is simply because it's sufficient for the task at hand [and that's good for not melting weaker gpus]
It's not really about 65 fps not being enough. Now that I know why it's happening I wouldn't necessarily push the fps over the clock limit. It's more about being confused during benchmarking. I tried to keep the performance in check. Imagine how strange it was for me to see the fps change from 150 to 60 by adding one additional 14k tris model to the scene. I had to investigate.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: strange framerate behavior

Post by Cube_ »

ah, so forcing the highres timer was just a debugging technique to see if that was indeed the cause.

Gotcha, must've not been paying attention or something.
"this is not the bottleneck you are looking for"
Post Reply