All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
@ 2016-08-04  2:39 Frank Hunleth
  2016-08-04  7:17 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Hunleth @ 2016-08-04  2:39 UTC (permalink / raw)
  To: buildroot

I'm trying to debug a 10x slow down with a simple Qt5 app that draws
rectangles and a couple lines of text on the screen. I'm comparing the
performance between a fresh install of Raspbian and the master branch
of Buildroot (but I also saw this with an older BR release). I've
narrowed the performance difference down to the rectangle and text
drawing calls. Nothing else is running. On the Buildroot side, I'm
using the raspberrypi_defconfig with only the following additions and
my test app:

+BR2_PACKAGE_QT5=y
+BR2_PACKAGE_QT5BASE_LICENSE_APPROVED=y
+BR2_PACKAGE_QT5BASE_GUI=y
+BR2_PACKAGE_QT5BASE_WIDGETS=y
+BR2_PACKAGE_QT5BASE_EGLFS=y
+BR2_PACKAGE_RPI_USERLAND=y

I haven't modified any of the config files in the boot partition.
Changing the config.txt to match the Raspbian version didn't affect
performance. I also verified that my test app is using eglfs. The
performance degradation is the same on both a Raspberry Pi Zero and
Model B.

This slowdown seems so big that it feels like I'm forgetting some
important piece of configuration, but I can't figure it out.

Has anyone else run into this or has any ideas on things to try?

Thanks,
Frank

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
  2016-08-04  2:39 [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian Frank Hunleth
@ 2016-08-04  7:17 ` Thomas Petazzoni
  2016-08-04 12:35   ` Frank Hunleth
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-08-04  7:17 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 3 Aug 2016 22:39:31 -0400, Frank Hunleth wrote:
> I'm trying to debug a 10x slow down with a simple Qt5 app that draws
> rectangles and a couple lines of text on the screen. I'm comparing the
> performance between a fresh install of Raspbian and the master branch
> of Buildroot (but I also saw this with an older BR release). I've
> narrowed the performance difference down to the rectangle and text
> drawing calls. Nothing else is running. On the Buildroot side, I'm
> using the raspberrypi_defconfig with only the following additions and
> my test app:
> 
> +BR2_PACKAGE_QT5=y
> +BR2_PACKAGE_QT5BASE_LICENSE_APPROVED=y
> +BR2_PACKAGE_QT5BASE_GUI=y
> +BR2_PACKAGE_QT5BASE_WIDGETS=y
> +BR2_PACKAGE_QT5BASE_EGLFS=y
> +BR2_PACKAGE_RPI_USERLAND=y
> 
> I haven't modified any of the config files in the boot partition.
> Changing the config.txt to match the Raspbian version didn't affect
> performance. I also verified that my test app is using eglfs. The
> performance degradation is the same on both a Raspberry Pi Zero and
> Model B.
> 
> This slowdown seems so big that it feels like I'm forgetting some
> important piece of configuration, but I can't figure it out.
> 
> Has anyone else run into this or has any ideas on things to try?

Change -Os by -O2 in the Buildroot configuration, by using
BR2_OPTIMIZE_2. I even believe we should stop using BR2_OPTIMIZE_S by
default, and switch to BR2_OPTIMIZE_2 instead.

Also, are you sure it's really using OpenGL with the Buildroot build?
Under Raspbian, are you also running the eglfs build of Qt, or is it
with X.org? I'm not sure Debian has an eglfs capable build of Qt5.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
  2016-08-04  7:17 ` Thomas Petazzoni
@ 2016-08-04 12:35   ` Frank Hunleth
  2016-08-04 16:28     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Hunleth @ 2016-08-04 12:35 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Thu, Aug 4, 2016 at 3:17 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Wed, 3 Aug 2016 22:39:31 -0400, Frank Hunleth wrote:
>> I'm trying to debug a 10x slow down with a simple Qt5 app that draws
>> rectangles and a couple lines of text on the screen. I'm comparing the
>> performance between a fresh install of Raspbian and the master branch
>> of Buildroot (but I also saw this with an older BR release). I've
>> narrowed the performance difference down to the rectangle and text
>> drawing calls. Nothing else is running. On the Buildroot side, I'm
>> using the raspberrypi_defconfig with only the following additions and
>> my test app:
>>
>> +BR2_PACKAGE_QT5=y
>> +BR2_PACKAGE_QT5BASE_LICENSE_APPROVED=y
>> +BR2_PACKAGE_QT5BASE_GUI=y
>> +BR2_PACKAGE_QT5BASE_WIDGETS=y
>> +BR2_PACKAGE_QT5BASE_EGLFS=y
>> +BR2_PACKAGE_RPI_USERLAND=y
>>
>> I haven't modified any of the config files in the boot partition.
>> Changing the config.txt to match the Raspbian version didn't affect
>> performance. I also verified that my test app is using eglfs. The
>> performance degradation is the same on both a Raspberry Pi Zero and
>> Model B.
>>
>> This slowdown seems so big that it feels like I'm forgetting some
>> important piece of configuration, but I can't figure it out.
>>
>> Has anyone else run into this or has any ideas on things to try?
>
> Change -Os by -O2 in the Buildroot configuration, by using
> BR2_OPTIMIZE_2. I even believe we should stop using BR2_OPTIMIZE_S by
> default, and switch to BR2_OPTIMIZE_2 instead.

Done, but no luck for this particular issue. I have another piece of
code that differs in performance from Debian by 5% and is more CPU
bound. I'll try it on that too.

>
> Also, are you sure it's really using OpenGL with the Buildroot build?

On the Buildroot build, I've tried running the Qt application with
"-platform eglfs", but that seemed to be the default already. I'm not
sure how to check deeper than that.

> Under Raspbian, are you also running the eglfs build of Qt, or is it
> with X.org? I'm not sure Debian has an eglfs capable build of Qt5.

You're right. On Raspbian, I'm running with X.org. I am naively
assuming that Qt5 w/ eglfs isn't 10x slower than Qt5 w/ X.org. I
really hope that's not the case.

Thanks,
Frank

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
  2016-08-04 12:35   ` Frank Hunleth
@ 2016-08-04 16:28     ` Thomas Petazzoni
  2016-08-04 17:09       ` Frank Hunleth
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-08-04 16:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 4 Aug 2016 08:35:24 -0400, Frank Hunleth wrote:

> > Change -Os by -O2 in the Buildroot configuration, by using
> > BR2_OPTIMIZE_2. I even believe we should stop using BR2_OPTIMIZE_S by
> > default, and switch to BR2_OPTIMIZE_2 instead.  
> 
> Done, but no luck for this particular issue. I have another piece of
> code that differs in performance from Debian by 5% and is more CPU
> bound. I'll try it on that too.

Gaah.

> > Also, are you sure it's really using OpenGL with the Buildroot build?  
> 
> On the Buildroot build, I've tried running the Qt application with
> "-platform eglfs", but that seemed to be the default already. I'm not
> sure how to check deeper than that.

I guess if eglfs support has been built and you're able to use, it
means that it's using the GPU.

> > Under Raspbian, are you also running the eglfs build of Qt, or is it
> > with X.org? I'm not sure Debian has an eglfs capable build of Qt5.  
> 
> You're right. On Raspbian, I'm running with X.org. I am naively
> assuming that Qt5 w/ eglfs isn't 10x slower than Qt5 w/ X.org. I
> really hope that's not the case.

I also hope, but using X.org on one side and doing eglfs on the other
side is really a very different configuration. I would also assume that
there should not be a 10x difference between Qt5/X.org vs Qt5/eglfs,
but I have never tested, so I don't know.

Which toolchain are you using ? Are you building everything optimized
for ARMv6 (assuming you're using Rpi1) ?

But a 10x difference really feels like acceleration is not used at all.
You can also check the CPU consumption while running your Qt app to see
what it looks like.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
  2016-08-04 16:28     ` Thomas Petazzoni
@ 2016-08-04 17:09       ` Frank Hunleth
  2016-08-05  2:09         ` Khem Raj
  2016-08-06 21:49         ` Frank Hunleth
  0 siblings, 2 replies; 7+ messages in thread
From: Frank Hunleth @ 2016-08-04 17:09 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Thu, Aug 4, 2016 at 12:28 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Thu, 4 Aug 2016 08:35:24 -0400, Frank Hunleth wrote:
>
>> > Change -Os by -O2 in the Buildroot configuration, by using
>> > BR2_OPTIMIZE_2. I even believe we should stop using BR2_OPTIMIZE_S by
>> > default, and switch to BR2_OPTIMIZE_2 instead.
>>
>> Done, but no luck for this particular issue. I have another piece of
>> code that differs in performance from Debian by 5% and is more CPU
>> bound. I'll try it on that too.
>
> Gaah.
>
>> > Also, are you sure it's really using OpenGL with the Buildroot build?
>>
>> On the Buildroot build, I've tried running the Qt application with
>> "-platform eglfs", but that seemed to be the default already. I'm not
>> sure how to check deeper than that.
>
> I guess if eglfs support has been built and you're able to use, it
> means that it's using the GPU.
>
>> > Under Raspbian, are you also running the eglfs build of Qt, or is it
>> > with X.org? I'm not sure Debian has an eglfs capable build of Qt5.
>>
>> You're right. On Raspbian, I'm running with X.org. I am naively
>> assuming that Qt5 w/ eglfs isn't 10x slower than Qt5 w/ X.org. I
>> really hope that's not the case.
>
> I also hope, but using X.org on one side and doing eglfs on the other
> side is really a very different configuration. I would also assume that
> there should not be a 10x difference between Qt5/X.org vs Qt5/eglfs,
> but I have never tested, so I don't know.

I started a Qt5/eglfs-only build on a Raspberry Pi early this morning.
I have no clue how long it will take to build, but I'll report back
when it's done.

> Which toolchain are you using ? Are you building everything optimized
> for ARMv6 (assuming you're using Rpi1) ?

When I first noticed the issue, I was using an ARMv6-optimized
toolchain built by crosstool-ng. Now I'm using the default one built
by Buildroot when using the raspberrypi_defconfig.

> But a 10x difference really feels like acceleration is not used at all.

I agree.

> You can also check the CPU consumption while running your Qt app to see
> what it looks like.

Will do. I think that the native Raspbian Qt5/eglfs-only build will be
telling. With any luck the build will complete successfully this
evening.

Thanks,
Frank

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
  2016-08-04 17:09       ` Frank Hunleth
@ 2016-08-05  2:09         ` Khem Raj
  2016-08-06 21:49         ` Frank Hunleth
  1 sibling, 0 replies; 7+ messages in thread
From: Khem Raj @ 2016-08-05  2:09 UTC (permalink / raw)
  To: buildroot



On 8/4/16 10:09 AM, Frank Hunleth wrote:
> Hi Thomas,
> 
> On Thu, Aug 4, 2016 at 12:28 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Hello,
>>
>> On Thu, 4 Aug 2016 08:35:24 -0400, Frank Hunleth wrote:
>>
>>>> Change -Os by -O2 in the Buildroot configuration, by using
>>>> BR2_OPTIMIZE_2. I even believe we should stop using BR2_OPTIMIZE_S by
>>>> default, and switch to BR2_OPTIMIZE_2 instead.
>>>
>>> Done, but no luck for this particular issue. I have another piece of
>>> code that differs in performance from Debian by 5% and is more CPU
>>> bound. I'll try it on that too.
>>
>> Gaah.
>>
>>>> Also, are you sure it's really using OpenGL with the Buildroot build?
>>>
>>> On the Buildroot build, I've tried running the Qt application with
>>> "-platform eglfs", but that seemed to be the default already. I'm not
>>> sure how to check deeper than that.
>>
>> I guess if eglfs support has been built and you're able to use, it
>> means that it's using the GPU.
>>
>>>> Under Raspbian, are you also running the eglfs build of Qt, or is it
>>>> with X.org? I'm not sure Debian has an eglfs capable build of Qt5.
>>>
>>> You're right. On Raspbian, I'm running with X.org. I am naively
>>> assuming that Qt5 w/ eglfs isn't 10x slower than Qt5 w/ X.org. I
>>> really hope that's not the case.
>>
>> I also hope, but using X.org on one side and doing eglfs on the other
>> side is really a very different configuration. I would also assume that
>> there should not be a 10x difference between Qt5/X.org vs Qt5/eglfs,
>> but I have never tested, so I don't know.
> 
> I started a Qt5/eglfs-only build on a Raspberry Pi early this morning.
> I have no clue how long it will take to build, but I'll report back
> when it's done.
> 
>> Which toolchain are you using ? Are you building everything optimized
>> for ARMv6 (assuming you're using Rpi1) ?
> 
> When I first noticed the issue, I was using an ARMv6-optimized
> toolchain built by crosstool-ng. Now I'm using the default one built
> by Buildroot when using the raspberrypi_defconfig.
> 
>> But a 10x difference really feels like acceleration is not used at all.
> 
> I agree.
> 
>> You can also check the CPU consumption while running your Qt app to see
>> what it looks like.
> 
> Will do. I think that the native Raspbian Qt5/eglfs-only build will be
> telling. With any luck the build will complete successfully this
> evening.

Seems like H/W acceleration is missing. I wonder if userland libraries
are compiled correctly.

> 
> Thanks,
> Frank
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian
  2016-08-04 17:09       ` Frank Hunleth
  2016-08-05  2:09         ` Khem Raj
@ 2016-08-06 21:49         ` Frank Hunleth
  1 sibling, 0 replies; 7+ messages in thread
From: Frank Hunleth @ 2016-08-06 21:49 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Thu, Aug 4, 2016 at 1:09 PM, Frank Hunleth
<fhunleth@troodon-software.com> wrote:
> Hi Thomas,
>
> On Thu, Aug 4, 2016 at 12:28 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Hello,
>>
>> On Thu, 4 Aug 2016 08:35:24 -0400, Frank Hunleth wrote:
>>
>>> > Change -Os by -O2 in the Buildroot configuration, by using
>>> > BR2_OPTIMIZE_2. I even believe we should stop using BR2_OPTIMIZE_S by
>>> > default, and switch to BR2_OPTIMIZE_2 instead.
>>>
>>> Done, but no luck for this particular issue. I have another piece of
>>> code that differs in performance from Debian by 5% and is more CPU
>>> bound. I'll try it on that too.
>>
>> Gaah.
>>
>>> > Also, are you sure it's really using OpenGL with the Buildroot build?
>>>
>>> On the Buildroot build, I've tried running the Qt application with
>>> "-platform eglfs", but that seemed to be the default already. I'm not
>>> sure how to check deeper than that.
>>
>> I guess if eglfs support has been built and you're able to use, it
>> means that it's using the GPU.
>>
>>> > Under Raspbian, are you also running the eglfs build of Qt, or is it
>>> > with X.org? I'm not sure Debian has an eglfs capable build of Qt5.
>>>
>>> You're right. On Raspbian, I'm running with X.org. I am naively
>>> assuming that Qt5 w/ eglfs isn't 10x slower than Qt5 w/ X.org. I
>>> really hope that's not the case.
>>
>> I also hope, but using X.org on one side and doing eglfs on the other
>> side is really a very different configuration. I would also assume that
>> there should not be a 10x difference between Qt5/X.org vs Qt5/eglfs,
>> but I have never tested, so I don't know.
>
> I started a Qt5/eglfs-only build on a Raspberry Pi early this morning.
> I have no clue how long it will take to build, but I'll report back
> when it's done.

Just to close off this thread in case anyone else runs into a similar
issue, Buildroot is completely fine.

The issue ended up being that using a QWidget with Qt5 on an eglfs
backend results in Qt software rendering everything to an image and
then copying that image to the display via OpenGL ES. I was under the
mistaken impression that even QWidget apps should start using the
eglfs backend. The use of software rendering is, in fact, documented
in the Qt docs, but I selectively didn't see the important paragraph,
and I had no idea that the penalty would be so large.

As you would expect, the linuxfb backend works fine for apps still
using QWidgets.

Frank

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-06 21:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04  2:39 [Buildroot] Raspberry Pi OpenGL/Qt5 10x slower than Raspbian Frank Hunleth
2016-08-04  7:17 ` Thomas Petazzoni
2016-08-04 12:35   ` Frank Hunleth
2016-08-04 16:28     ` Thomas Petazzoni
2016-08-04 17:09       ` Frank Hunleth
2016-08-05  2:09         ` Khem Raj
2016-08-06 21:49         ` Frank Hunleth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.