SFML community forums
Help => General => Topic started 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.
- I am using the 64-bit version of SFML, if that makes any difference.
- When NOT limiting the frame-rate, the game runs at around 4200-4300 FPS and does not experience any fluctuations beyond these values. I believe this is an indication that the application is not requiring more resources as it goes on (as this would have an impact on the FPS)
- With a completely out-of-the-box application (as per the tutorial) the GPU goes from 2% to 10% (16% when at 1920x1080 without fullscreen)
- 2 other Windows 10 users have similar results with the application. One uses AMD and one uses NVidia.
- No notable difference between 32-bit and 64-bit
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.
- The background texture is a 1920x1080 .jpg file
- Building a release build of the above code and running it outside of Visual Studio as is, gives a GPU load of 30-32% and a Memory Controller load of 27-28% as per GPU-Z. The GPU in question is a GTX1080.
-
Do you get the same result when starting directly from the executable, bypassing the IDE completely?
-
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.
-
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.
-
Hello,
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
you could try and GPU profile it
Any suggestions how I could use this to find what the issue might be?
-
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 %.
-
Have you tried the same experiment with a blank game loop? Just pollEvents() followed by clear/display.
Yes.
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%.