Unsolved CPU Usage Keeps Increasing Unless Use "Threaded" Render Loop
-
Re: High cpu usage
Ran into this same problem referenced above where CPU usage keeps increasing when use Qt's default "basic" render loop. Tested with Qt5.8.0, 5.91, & 5.9.2 on Linux Mint 17.3XFCE (kernel=4.4, xorg=1.17.1, mesa=10.5.9, motherboard has 4-core Braswell N3050 Celeron with integrated Intel HD Graphics).
I’m working on an application that has multiple QML “Windows”. Updating values on any of the windows at 10HZ rate caused CPU usage to increase from 15% to >100% within ~20minutes making everything to run slow and CPU to overheat.
Switching to “QSG_RENDER_LOOP=threaded” does seem to solve the problem. Found it to be unstable (crash in 1 to 20minutes) on Qt5.8.0, but appears stable with Qt5.9.1 and Qt5.9.2.
Here are my questions:
Are there concerns with using threaded rendering? Or, am I safe with this mode as long as the system’s X11 meets the minimum working version specified here: http://doc.qt.io/qt-5/linux-requirements.html
Is doing “QCoreApplication::setAttribute(Qt::AA_X11InitThreads)” in the application still necessary? Info in Qt’s documentation says it is “obsolete and has no effect”. See http://doc.qt.io/qt-5/qt.html#ApplicationAttribute-enum
Are there advantages to building Qt5.9.2 from sources with the -qt-xcb configuration flag so that the X11 “xcb helper” libraries are compiled into Qt? http://doc.qt.io/qt-5/linux-requirements.html
Does this ease the X11 system requirements when deploy to a target system?
Does anyone know the underlying cause of this problem? I.e., Why doesn’t the Linux default QSG_RENDER_LOOP=basic work properly?
Note: Just confirmed that this problem also occurs if have fairly up to date kernel and X11. Tested with Mint 18.2XFCE, kernel=4.10, xorg=1.18.4, mesa=17.0.7. CPU usage kept increasing…Feedback would be appreciated! Special thanks to MetalMajor for providing own solution back in 6/2016! https://forum.qt.io/topic/68721/high-cpu-usage