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

Author Topic: GPU usage while doing (literally) nothing  (Read 1982 times)

0 Members and 3 Guests are viewing this topic.

pulsejet

  • Newbie
  • *
  • Posts: 2
    • View Profile
GPU usage while doing (literally) nothing
« on: November 01, 2018, 10:19:39 am »
Trying to narrow down why I was using so much GPU for my simple application (which just displays images sequentially right now), I realized that even if I do *nothing*, I have ~10% GPU usage on my Intel HD 5500 (Windows 10 Home x64, 32 bit SFML). Is this expected/normal, since I'm planning to run this on some very low powered hardware?

EDIT: It's 15% if I run it with my 940m.

Here's the code that gives me 10% GPU usage:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
    window.setFramerateLimit(60);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
        window.clear();
        window.display();
    }

    return 0;
}
 
« Last Edit: November 01, 2018, 10:26:16 am by pulsejet »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: GPU usage while doing (literally) nothing
« Reply #1 on: November 01, 2018, 01:34:07 pm »
You're not doing "nothing", but you're clearing and displaying the window at ~60fps.

Don't forget that GPU usage isn't linear. So just because it's 10% now, doesn't mean, that it will go up 1% for every shape your draw.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

pulsejet

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: GPU usage while doing (literally) nothing
« Reply #2 on: November 01, 2018, 08:25:16 pm »
You're not doing "nothing", but you're clearing and displaying the window at ~60fps.

Don't forget that GPU usage isn't linear. So just because it's 10% now, doesn't mean, that it will go up 1% for every shape your draw.

Of course, but I was just wondering if this is expected, since 10% for blanking the window seemed a bit too high for relatively modern hardware. I'm new to working with GPUs, so I might be missing something here.\\

EDIT: Also, it goes up to 20-25% if I draw two sprites one above another, each stretched to fill the screen, around 800x800 textures for each, and a couple of lines of text.
« Last Edit: November 01, 2018, 08:27:17 pm by pulsejet »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: GPU usage while doing (literally) nothing
« Reply #3 on: November 02, 2018, 01:09:08 am »
Intel graphics chips aren't exactly dedicated GPUs. It's expected that it uses your GPU, no idea what standard values are, but I don't think it really matters when you don't notice it in the application itself.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/