Bug report #17493

QGIS 3D uses a lot of CPU even when idle

Added by Klas Karlsson almost 3 years ago. Updated over 1 year ago.

Status:Open
Priority:Normal
Assignee:-
Category:3D
Affected QGIS version:master Regression?:No
Operating System:Windows10, Linux/Manjaro Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25390

Description

As soon as I open a 3D window, my fans in the computer winds up. Even if i do nothing more, they stay on, and CPU load increase a lot.

As soon as I close the 3D window, CPU load returns to normal.

This is not a "crashing" issue, or a "freezing" issue. It's just annoying that it can "steal" this much resources just by opening a window in QGIS.

It doesn't seem to matter what layers are active or involved, resources spike no matter what.

Tested on Windows10 and Linux (Manjaro)

History

#1 Updated by Martin Dobias almost 3 years ago

On my machine the 3D view keeps one CPU core completely busy, so yes it is normal that the CPU fan needs to be started. The rendering is done with the target of 60 frames per second (that's fixed in Qt 3D) - even if the scene is static - and Qt 3D has some work to do for each frame. QGIS does not get involved much there unless you move the camera which may trigger scene updates. I assume that over time with more optimizations in Qt 3D the CPU usage will get better.

There is also an option to use on-demand 3D frame rendering instead of trying to maintain 60fps all the time - however with that option I got even higher CPU usage... so maybe I did something wrong there or it is/was a bug: https://github.com/qgis/QGIS/blob/master/src/3d/qgs3dmapscene.cpp#L51

#2 Updated by Martin Dobias almost 3 years ago

  • Subject changed from QGIS 3D takes upp huge resources even when idle to QGIS 3D uses a lot of CPU even when idle

#3 Updated by Jeremy Palmer almost 3 years ago

Thanks for looking at this Martin.

It would be really good to fix this as it's draining my laptop power very quickly!

Did this QT commit not fix the issue https://github.com/qt/qt3d/commit/f865508efd13cae9d09c425d0e419f81057f1948#diff-01791f33f0106ffe1bdb6d55b78a95e3? That made it into 5.9.0, so maybe you can reactive the code for https://github.com/qgis/QGIS/blob/master/src/3d/qgs3dmapscene.cpp#L51 when the QT version is high enough?

#4 Updated by Martin Dobias almost 3 years ago

I have tested here with Qt 5.9.0 on linux and unfortunately it did not really help, QGIS still used a lot of CPU (maybe not as bad as before but still), plus there was a new bug when OnDemand was used (switching to a different window and back to QGIS would leave the 3D view black).

#5 Updated by Jeremy Palmer almost 3 years ago

Is there a QT ticket to tracking this problem?

#6 Updated by Martin Dobias almost 3 years ago

I am not sure, we should probably first do more debugging to rule out the possibility it is QGIS 3D problem before we start blaming Qt 3D :-)

#7 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Open to Feedback

Please check if this issue is still valid on QGIS 3.4.5 or 3.6.

#8 Updated by Jeremy Palmer over 1 year ago

Still the same under QGIS 3.6

#9 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Feedback to Open

Also available in: Atom PDF