Strange High GPU load on empty app [iOS]

Hello friends,

I continue to touch and test with the Juce framework to determine whether I will stay in it or not. So far everething I like a lot. But a few days ago I ran into a problem with GPU load. It’s only about iOS/Android app.

I created empty Juce project and added to the MainComponent
openGLContext.attachTo(*this);
Because I want to use opengl. And it seems with this option on Android there is no HUGE UI delay like in case with simple paint() event.

Everything is fast and CPU seems 20-30%. Yes I would like it better, but ok… ok. The main problem is that average GPU/GRAPHIC load is about 84-93% during each redraw. i.e when I call openGLContext.triggerRepaint(), gpu load growth up to 95%. That thing seems strange, because I not draw anything on a screen. I Just use empty MainComponent + triggerRepaint() in the mouseDrag method. I tried the same with a timer 60fps/per sec or 120fps/per sec. But see the same issue.

Is that a bug or is it expected? The iPad or android device heats up noticeably if I do this for a long time. Just so it will be more clear. The screenshot just shows about 30-60 sec of GPU work. If I will continue to call redraw, then energy impact will be in red zone and critical.

Thanks for any help! BTW I use latest Juce 6 version.

My code below:

#include "MainComponent.h"

using namespace juce;

//==============================================================================
MainComponent::MainComponent()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);

openGLContext.setContinuousRepainting(false);
openGLContext.setComponentPaintingEnabled(true);
openGLContext.attachTo(*this);
setRepaintsOnMouseActivity(false);
setOpaque(true);

}

MainComponent::~MainComponent()
{
// This shuts down the GL system and stops the rendering calls.
shutdownOpenGL();
}

//==============================================================================
void MainComponent::initialise()
{
// Initialise GL objects for rendering here.
}

void MainComponent::shutdown()
{
// Free any GL objects created for rendering here.
}

void MainComponent::render()
{
// This clears the context with a black background.
//juce::OpenGLHelpers::clear (juce::Colours::black);
}

//==============================================================================

void MainComponent::paint (juce::Graphics& g)
{

}

void MainComponent::resized()
{
// This is called when the MainComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}

void MainComponent::mouseDrag(const juce::MouseEvent &event) {
openGLContext.triggerRepaint();
}

1 Like

Any advice on this issue please?

I would like to use even 2d drawing, but the high load of CPU/GPU seems very redundant in both cases.

The issue is in two cases:

  1. With .repaint() I see 70-80% cpu, but no GPU load.
  2. With .triggerRepaint() 20-30% cpu, but 80-90% GPU load

And I’m nothing drawing on a screen yet.
I understand that the load will remain approximately at this level if even I will draw something, but users will complain that their battery will drain quickly in a couple of hours, as if they were playing 3d game like Minecraft.

Thank you.