[Buildroot] Buildroot + Rpi4 + Accelerated OpenGL + X11

Giulio Benetti giulio.benetti at benettiengineering.com
Thu Sep 2 20:37:44 UTC 2021



Hi David,

> Il giorno 2 set 2021, alle ore 20:35, David Corbeil <david.corbeil at dynonavionics.com> ha scritto:
> 
> Hi Giulio,
> 
> I'm pretty new to this so thanks for your reply.

You’re welcome :-)

> I had to add libepoxy and then glamor was automatically added.

Exactly, it’s a dependency for it.

> I think I made progress thanks to your help but I'm still having errors. It seems like X is capable of loading the OpenGL drivers correctly. I don't see any errors in the xorg log file and glxinfo is able to extract information. Now the problem is that nothing can render. I keep getting the error: "Failed to open bo 1: Permission Denied" whenever I run glxgears or any flavors of glmark2. I tried changing the permission in the xorg.conf file or directly through chmod but nothing changed. I feel like the error message is misleading and that it's not really a permissions issue.

Here I don’t understand what it means by “bo 1”.
Can you pastebin the strace of those 2 programs?
So we can understand where they fail and then dig deeper.

> 
> I used the link you share to create a new xorg.conf.

This seems to sound good but I need your xorg.log

> 
> Here are the output of glxinfo -B and glmark2.

Here again Failed to open bo 1. Need to dig this in Mesa or x11

> 
> I will now try with systemd init system instead of busybox. We'll see that happens.

I don’t expect to change anything changing busybox with systemd honestly. I would try to dig deeper keeping busybox.

Best regards
Giulio Benetti
Benetti Engineering

> 
> 
> On Tue, Aug 31, 2021 at 3:53 PM Giulio Benetti <giulio.benetti at benettiengineering.com> wrote:
>> Hi David,
>> 
>> > Il giorno 1 set 2021, alle ore 00:36, Giulio Benetti <giulio.benetti at benettiengineering.com> ha scritto:
>> > 
>> > Hi David,
>> > 
>> >> On 9/1/21 12:05 AM, David Corbeil wrote:
>> >> Hi,
>> >> Using Buildroot, I’m trying to build an OS that can run my OpenGL (not ES) app with accelerated 3D graphics. I also want it to use X11 as a display server. So far I haven’t tried my app directly on my built OS because it has many dependencies but I’m using glmark2, kmscube and glxgear to debug and try out different Buildroot configurations.
>> >> I tried the /vc4-kms-v3d-pi4/ and /vc4-kms-v3d/ overlays in the config.txt, but I’ve had better results using the former.
>> >> So far I was able to get glmark2 to run but it was using a software OpenGL renderer (swrast). Although performance is abysmal so that’s a no go.
>> >> I have 4 flavors of glmark2 in my OS, glmark2, glmark2-es2, glmark-es2-drm and glmark2-drm. The only ones that run are glmark2-drm and glmark2-es2-drm. They run really well at 60fps. kmscube runs really well as well.
>> >> The problem comes when I try to run glxgears and glxinfo when X11 is running. I get the following errors:
>> >>  *
>> >>    Glxgears
>> >>        Error: Couldn’t get an RGB, Doubled-bufferedvisual
>> >>  *
>> >>    Glxinfo:
>> >>        name of display: :0
>> >>        Error: couldn’t find RGB GLX visual or fbconfig >   *
>> >>    Glmark2:
>> >>        Error: GLX version >= 1.3 is required
>> >>        Error: Error: Couldn’t get GL visual config
>> >>        Error: main: Could not initialize canvas
>> >> I’d like to get the regular glmark2 to run since, from my understanding, it uses regular OpenGL?
>> > 
>> > It depends on your OpenGL implementation, and here you have an ES implementation, so it's only a subset, but considering your defconfig below X tries to use the ES one but doesn't succeed because of fbturbo doesn't support your broadcom gpu.
>> > 
>> >> I’m pretty convinced my end goal is possible because I was able to get my app to run flawlessly in Raspberry Pi OS using regular OpenGL. Just need to find all the necessary packages and configure the OS correctly. Easy to say, easy to do right?
>> > 
>> > It is possible
>> > 
>> >> I linked my defconfig, the xorg configuration file and xorg log file.
>> >> buidlroot Rpi4_32_defconfig_eudev: https://pastebin.com/xfJ9WbdQ <https://pastebin.com/xfJ9WbdQ>
>> >> xorg.conf: https://pastebin.com/vewDwmtD <https://pastebin.com/vewDwmtD>
>> >> xorg log: https://pastebin.com/0yDXGDr7 <https://pastebin.com/0yDXGDr7>
>> >> Maybe the xorg configuration file needs to be modified? But how? According to this <https://github.com/raspberrypi/linux/issues/4526>, I should not be using fbturbo but I don’t know what to replace it with.
>> > 
>> > Yes, you need to use glamor as I recall, so you need to enable it in Buildroot and 'make clean; make'.
>> 
>> Pardon, glamor should already been built.
>> Please check it. You should not need to rebuild Buildroot.
>> 
>> Giulio
>> 
>> > 
>> > Try to take a look here for xorg.conf example:
>> > https://www.mindwerks.net/2014/09/videocoreiv-glamor-on-your-raspberry-pi/
>> > 
>> > That way you tell X11 to use glamor and force Gallium(the Broadcom mesa driver). But you need to do some attempt, I don't know if it will work as it is.
>> > 
>> > Some time passed since I've had my hands on X11 on a Rockchip. But glamor should be the way.
>> > 
>> > I didn't check everything I've written above, so take it with a grain of salt.
>> > 
>> > Best regards
>> > -- 
>> > Giulio Benetti
>> > Benetti Engineering sas
> 
> 
> -- 
> David Corbeil-Stroombergen
> Software development engineer
> Dynon
> 425-402-0433 Main 
> www.dynon.aero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://https:/pipermail/buildroot/attachments/20210902/38e41085/attachment.html>


More information about the buildroot mailing list