Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GPU usage permanently jumps up after a while  (Read 2069 times)

0 Members and 1 Guest are viewing this topic.

Ricewind1

  • Newbie
  • *
  • Posts: 4
    • View Profile
GPU usage permanently jumps up after a while
« 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.
« Last Edit: July 10, 2020, 04:00:32 am by Ricewind1 »

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: GPU usage permanently jumps up after a while
« Reply #1 on: July 03, 2020, 09:24:54 pm »
Do you get the same result when starting directly from the executable, bypassing the IDE completely?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Ricewind1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: GPU usage permanently jumps up after a while
« Reply #2 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.


« Last Edit: July 04, 2020, 06:19:32 pm by Ricewind1 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: GPU usage permanently jumps up after a while
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ricewind1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: GPU usage permanently jumps up after a while
« Reply #4 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?
« Last Edit: July 07, 2020, 08:31:32 am by Ricewind1 »

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: GPU usage permanently jumps up after a while
« Reply #5 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 %.

Ricewind1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: GPU usage permanently jumps up after a while
« Reply #6 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%.


 

anything