SFML community forums

Help => General => Topic started by: Ricewind1 on July 03, 2020, 06:31:19 am

Title: GPU usage permanently jumps up after a while
Post by: Ricewind1 on July 03, 2020, 06:31:19 am
I've noticed that a few seconds (around 8-10 seconds) after starting the application, the GPU usage jumps from about 3% to 16-19% and stays there permanently. This measurement according to GPU-Z.

The application functions fine while the GPU usage is on the 4-5% spectrum, and no user action is required for this GPU jump. IT's a static screen (chess game) unless acted upon, so the game logic isn't causing this increase in GPU (to my knowledge).

Frame-rate is limited to 60 FPS.

This occurs when running a release build using SFML 2.5 and Visual Studio 2017.

If you need more information to help me solve this issue, I'd gladly elaborate further.

Edit: Some further information/findings.

The following code: https://pastebin.com/3G3PN99U is the "main loop" of my project where, for  the sake of this experiment, everything but rendering a background is disabled.
Title: Re: GPU usage permanently jumps up after a while
Post by: Hapax on July 03, 2020, 09:24:54 pm
Do you get the same result when starting directly from the executable, bypassing the IDE completely?
Title: Re: GPU usage permanently jumps up after a while
Post by: Ricewind1 on July 04, 2020, 02:10:29 am
Thank you for the quick reply.

Yes, exactly the same result.

Gave the application to a friend (also running Win 10) and he has similar results.

Edit: There seems to be no difference in GPU usage between screens.


Title: Re: GPU usage permanently jumps up after a while
Post by: eXpl0it3r on July 06, 2020, 11:33:32 pm
So is the problem just that there's a higher GPU usage than at initial start up or any other problems?

Hard to say really. Maybe you're code is causing it. Maybe it's just an over allocation by the OS. Maybe it's a faulty measurement. etc.
I'd suggest to first check what the Task Manager is actually measuring and/or get another application to confirm the usage percentage. Once you understand what that percentage actually means, maybe you can guess as to what could cause the percentage to rise. Otherwise you could try and GPU profile it, to figure out what's going on.
Title: Re: GPU usage permanently jumps up after a while
Post by: Ricewind1 on July 07, 2020, 07:15:45 am
Hello,

Quote
is the problem just that there's a higher GPU usage than at initial start up
Yes, but significantly so. It's only around 3-5% at initial startup.

I've also noticed that it uses 20% GPU memory after this initial 8-10 seconds. Even when only a black screen is rendered with 0 additional draw-calls, the GPU usage is around 15% with a GPU memory of 20%.

I've just compared the Task Manager numbers with GPU-Z, and it gives similar results. There's also an increase in memory bus clock.

Edit: GPU usage is much lower on simple running games using OpenGL, as tested

Quote
you could try and GPU profile it
Any suggestions how I could use this to find what the issue might be?
Title: Re: GPU usage permanently jumps up after a while
Post by: AlexAUT on July 09, 2020, 02:55:56 pm
Have you tried the same experiment with a blank game loop? Just pollEvents() followed by clear/display.

Does you CPU go into a lower power state when the increase in utilization occurs? Maybe the CPU just lowers its clock speed and therefore the utilization goes up. I am not sure if the windows task manager takes the clk speed into account when calculating the %.
Title: Re: GPU usage permanently jumps up after a while
Post by: Ricewind1 on July 09, 2020, 09:06:17 pm
Quote
Have you tried the same experiment with a blank game loop? Just pollEvents() followed by clear/display.

Yes.
Quote
Even when only a black screen is rendered with 0 additional draw-calls, the GPU usage is around 15% with a GPU memory of 20%.