SFML community forums

Help => General => Topic started by: pulsejet on November 01, 2018, 10:19:39 am

Title: GPU usage while doing (literally) nothing
Post by: pulsejet 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;
}
 
Title: Re: GPU usage while doing (literally) nothing
Post by: eXpl0it3r 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.
Title: Re: GPU usage while doing (literally) nothing
Post by: pulsejet 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.
Title: Re: GPU usage while doing (literally) nothing
Post by: eXpl0it3r 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.