QML, QtQuick2 performance, How to get the best of OpenGL?
-
Hi,
I have a QML application displayed on 6 HD screens with touch screen capability. My graphic cards are Nvidia Quadro NVS 450.
I had some slight latency issues
I migrate from Qt4 Quick 1 to Qt5 Qtquick 2.0, and I got some Hudge Latency Issues!!!I read that Quick2 is based on OpenGL 2.
How can I be sure to get the best of the OpenGL?
Are there some custom drivers for graphic cards which would improve my performances problem, hence solve them? -
Hi,
Yes, if you're on Windows, then don't use ANGLE. It causes huge performance issues especially related to text rendering with distance field rendering enabled. That will require you to build your own Qt on Windows, specifically configured with desktop OpenGL as utcenter mentioned.
If you're on Mac or Linux, then please give more details: which version of Qt 5 are you using, exactly, and what sort of QML have you written? eg, do you have custom paint events, what sort of animations are you running, what does the QML profiler say regarding CPU usage - are you spending most of your time rendering, or running bindings/expressions, or what?
Cheers,
Chris. -
Hi,
Thanck for the inputs. I still have 3 questions:-
How to build Qt for desktop OpenGL? Is there some documentation or article?
-
ANGLE Implementation cause hudge performance drop. OK, but does this concerned all kinds of rotation? (Static vertical text, statis rectangle rotation, animated rotation...)?
-
chris you mentionned "text rendering with distance field rendering enabled". Whet is field rendering?
Thancks again
-
-
-
To build with OpenGL run configure with:
@
configure.exe -opengl desktop
@ -
Dunno, it's the first time I hear about ANGLE introducing much overhead
-
You can choose text rendering method in Qt. I don't remember how it's done at the moment
-
-
I executed qtbase\configure.exe -opengl desktop
Then nmkae but it fails:
@make[2]: Entering directoryD:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools/bootstrap' make -f Makefile.Release make[3]: Entering directory
D:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools/bootstrap'
Makefile.Release:219: *** missing separator. Stop.
make[3]: Leaving directoryD:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools/bootstrap' make[2]: *** [release] Error 2 make[2]: Leaving directory
D:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools/bootstrap'
make[1]: *** [sub-tools-bootstrap-make_first] Error 2
make[1]: Leaving directory `D:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools'
make: *** [sub-tools-make_first] Error 2
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.@ -
Make sure you follow "the guide":http://qt-project.org/wiki/Building_Qt_5_from_Git. I don't use windows much, but I think the output you've got means you don't have Perl in PATH.
-
Hi,
For more information about distance field text rendering, see the following blog posts:
http://blog.qt.digia.com/2011/07/15/text-rendering-in-the-qml-scene-graph/
http://blog.qt.digia.com/blog/2012/08/08/native-looking-text-in-qml-2/Precisely which situations ANGLE causes issues in, I don't know - there have been many mentions of it completely tanking performance when using distance field based text rendering, but it shouldn't cause any issues with animations / rotations etc. The only way to know for sure is to benchmark your application with both, and find out. But certainly, if you change the renderType property of every Text element to use Text.NativeRendering, you should see a performance increase.
As I said earlier, what you really need to do is use the QML profiler to determine exactly what is taking the most time. Is it rendering, is it binding evaluation, is it signal handler evaluation, etc. Get some traces using the Analyzer tool in QtCreator, and then you can really start to figure out what's going on.
Cheers,
Chris. -
[quote author="sierdzio" date="1363027601"]Make sure you follow "the guide":http://qt-project.org/wiki/Building_Qt_5_from_Git. I don't use windows much, but I think the output you've got means you don't have Perl in PATH.[/quote]
Actually I have Perl in the path, as well as Python. but in the console I see something which make me think that the makefile loose the running directory or something similar@make[2]: Entering directory
D:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools/bootstrap' make -f Makefile.Release make[3]: Entering directory
D:/Qt/qt-everywhere-opensource-src-5.0.1/src/tools/bootstrap'
Makefile.Release:219: *** missing separator. Stop.@[quote author="chrisadams" date="1363027601"]As I said earlier, what you really need to do is use the QML profiler to determine exactly what is taking the most time. Is it rendering, is it binding evaluation, is it signal handler evaluation, etc. Get some traces using the Analyzer tool in QtCreator, and then you can really start to figure out what’s going on.
Cheers,[/quote]
I run the profiler ans saw the rendering was taking 95% of the time -
-
Dropbox is a good start, or some other hosting site.
-
Here are video taken from the following example:
"QmlTestLag.zip":http://www.filehosting.org/file/details/425271/TEstLagQtQuick2.zip
My graphic cards are Nvidia Quadro NVS 450, Mosaic Is activated, though Widows See only one big screen in its setup:"Video Qt4Quick1":http://www.youtube.com/watch?v=p9le7cVfQug
Qt4, Quick1, 1 HD Screen qmlviewer: ~12%CPU Animation is smooth
Qt4, Quick1, 4 HD Screen qmlviewer : ~12%CPU Animation is smooth"Video Qt5Quick2":http://www.youtube.com/watch?v=VNEfkWkjDPE
Qt5, Quick2, 1 HD Screen qmlscene : ~4%CPU Animation is very smooth
Qt5, Quick2, 4 HD Screen qmlscene : ~12%CPU Animation is really laggingI have the same behavior when I use our custom main to display the QPML Application, so I think it is a good example. What I would Conclude:
- Quick2 is more CPU consumption friendly
- CPU is no the limit
- Qt Render even the part which does not need to be updated