Bug report #17493
QGIS 3D uses a lot of CPU even when idle
|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|
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)
#1 Updated by Martin Dobias over 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
#3 Updated by Jeremy Palmer over 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 over 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).