Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [Juce 8 - UI] Critically slow UI / high GPU consumption #1444

Open
1 task done
benkuper opened this issue Oct 11, 2024 · 1 comment
Open
1 task done

[Bug]: [Juce 8 - UI] Critically slow UI / high GPU consumption #1444

benkuper opened this issue Oct 11, 2024 · 1 comment

Comments

@benkuper
Copy link

Detailed steps on how to reproduce the bug

Hello, in my transition to Juce 7 to Juce 8, i found that the same code will just be super slow, sometimes unresponsive in Juce 8.
I figured that using my dedicated GPU (RTX 4080M with 12GB, not so bad), it would improve, but would then use up to 30% of this GPU, with an almost empty session and not activating OpenGL rendering, and the intel GPU would still be around 60-70% !
For reference, the same file and app compiled with Juce 7 would take 1% on the nvidia gpu and a bit more on the intel gpu, and the intel gpu could go up to 10%-20% when redrawing the interface constantly.

Few indicators :
Popup menu are just lagging a lot
When I play a timeline and I try to close my software, I'm being asked to save or not, but I can't even click the button until the timeline stops playing (and redrawing).

I had optimized a lot this UI to not overload anything, with generalized timers to avoid drawing too much, etc.
This used to be very efficient in both UI smoothness and CPU/GPU efficiency.
But in JUCE 8, it's just bad. I may have not read enough about migrating from one to another, but it sure seems something is wrong.
In any case, if anybody has insight on this I'll be happy to hear them !

Here is a video showing the 2 apps performance comparison, one with version 1.9.24 of my software (Release mode, JUCE 7), and the second one with version 2.0.0b1 (same code, Release Mode JUCE 8, just bumped the version). Both are not using OpenGL to renderer the window, but using opengl is just helping a bit while taking a huge it on GPUs.

https://streamable.com/xwvy22

What is the expected behaviour?

Smooth UI and not lagging/unresponsive
30% of my monster GPU when not doing anything

Operating systems

Windows

What versions of the operating systems?

Win 11

Architectures

64-bit

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
@benkuper benkuper changed the title [Bug]: [Bug]: [Juce 8 - UI] Critically slow UI / high GPU consumption Oct 11, 2024
@benkuper
Copy link
Author

benkuper commented Oct 11, 2024

My bad, the Direct2D fix from yesterday seem to be it, and I had not pulled the latest develop.

I'll keep it open as the gpu consumption still seems oddly high :
I set Nvidia control panel to force my software to run on my RTX graphic card, but when I launch it, nothing else than the interface (that is optimized), it takes 15% of my Nvidia GPU and 90% of my intel GPU !!
Both GPU go down to 0-1% when closing the app.

The app has an OpenGLRenderer attached to the top level component with this code :

	context.setContinuousRepainting(true);
	context.setComponentPaintingEnabled(true);
	context.attachTo(*parent);

image

EDIT :
My laptop's display was running through optimus on the intel GPU. This means I guess that the UI was still rendered by the GPU but refreshed, syncrhonized and shown by the intel GPU, which makes them both work.
Reducing the window allowed me to reduced intel usage, and switching the whole display to Nvidia made the intel cpu not used at all.

I guess it's ok, even though using 80% of the intel gpu just to show a window seems a bit overkill. Would be great to have some control over that, like max fps refresh rate or something :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant