Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Cross compiling QML app to use hardware acceleration on Sitara processors
We are developing a QML based application to run using embedded Linux on a Beagle Board X15 (Sitara AM5728). We are using the SDK provided by Ti, which has Qt5.11.3 installed, because we need other Ti driver support. We can successfully cross compile applications, however, we are unsure how to compile, or run them with hardware acceleration enabled. We know hardware acceleration is available because some of Ti's Qt demo apps function as expected.
When we run our app without weston and using --platform eglfs it consumes 100% of the CPU even though there is no animation happening.
So to rule out us doing something wrong in our simple program we did the same exercise with the "cube" example program provide by Qt.
When we run cube without weston and using --platform eglfs it consumes 100% of the CPU even though there is no rotation happening.
When we run cube inside of weston it consumes <5% of the CPU while rotating the cube. So this looks like hardware acceleration is working.
How do we run a Qt QML app without a windowing system like weston and get hardware acceleration?
Hi and welcome to devnet,
Could it be possible that you are in fact using the Mesa software pipeline ?
Did you check the configure output to see which hardware acceleration you had activated ?
you may also want to try with
@SGaist Thanks for your suggestion. I apologize but I don't know how to check if I am using the Mesa software pipeline or where to see the configure output for the hardware acceleration. Can you point me to something explaining how to do that?
@raven-worx Good suggestion. I read up on that environment variable and it seems like it would be the culprit. Unfortunately I tested it and the cube example still consumes 100% of the CPU. To be clear this is what I did:
/etc/init.d/weston stop export QSG_RENDER_LOOP=basic /usr/share/examples/opengl/cube/cube --platform eglfs & top
The top command had these results:
top - 22:43:03 up 5 min, 1 user, load average: 0.82, 0.65, 0.31 Tasks: 125 total, 3 running, 122 sleeping, 0 stopped, 0 zombie %Cpu(s): 19.0 us, 35.1 sy, 0.0 ni, 45.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 1787.8 total, 1427.6 free, 133.6 used, 226.7 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1604.8 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1190 root 20 0 98592 34268 29716 R 104.6 1.9 0:23.12 cube 7 root 20 0 0 0 0 R 0.5 0.0 0:00.07 kworker/u4:0+events_unbound 483 root 20 0 0 0 0 I 0.5 0.0 0:00.06 kworker/u4:3-pvr_workqueue ...
just for clarification, top shows the % of CPU consumption in 100%*NUM_OF_CORES. So your effective CPU consumption is around 50% for your board. Bust still too hight, yes
You may also want to read this: https://www.qt.io/blog/2017/01/18/opengl-implementation-qt-quick-app-using-today
You could also use valgrind (callgrind) to check which methods causes the most execution time. It should give some hints if its rendering afterall or something else.