User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Videocore and OpenGLES3 Pi4

Wed Jan 20, 2021 6:42 pm

I'm a little confused about exactly what Videocore is, and how to configure things while I'm compiling for videocore or GLES3 and how that interacts with FKMS and full KMS.

My current understanding of it is like this:

-Videocore is the name of the GPU

-"Videocore" can be enable or disabled when compiling a program, but this doesn't disable the GPU, it disables the "Videocore" driver

-If I --disable videocore, then I can enable GLES3, and that will allow GLES to handle the GPU (which is the Videocore?) instead of the videocore driver.

-In order to use videocore OR GLES3, I have to use full KMS and not fake KMS (FKMS)

Am I on the right track here? Can anyone help sort me out if I'm egregiously wrong?

Thanks

cleverca22
Posts: 4900
Joined: Sat Aug 18, 2012 2:33 pm

Re: Videocore and OpenGLES3 Pi4

Wed Jan 20, 2021 8:17 pm

7F20 wrote:
Wed Jan 20, 2021 6:42 pm
-Videocore is the name of the GPU
i believe VC4 and VC6 (videocore4 and videocore6) is the name for the whole chip, and all peripherals within it

v3d is the peripheral that then handles all opengl layer stuff

fkms and kms, are then drivers for the 2d subsystem, and those get used to render the final 2d output over a port like hdmi

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Videocore and OpenGLES3 Pi4

Wed Jan 20, 2021 8:26 pm

cleverca22 wrote:
Wed Jan 20, 2021 8:17 pm
i believe VC4 and VC6 (videocore4 and videocore6) is the name for the whole chip, and all peripherals within it
No.
See https://en.wikipedia.org/wiki/Raspberry ... ifications for correct names.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Videocore and OpenGLES3 Pi4

Wed Jan 20, 2021 8:33 pm

cleverca22 wrote:
Wed Jan 20, 2021 8:17 pm

v3d is the peripheral that then handles all opengl layer stuff

fkms and kms, are then drivers for the 2d subsystem, and those get used to render the final 2d output over a port like hdmi
Thanks for the reply.

That makes sense. As I understand it, "disable videocore" disables the VC6 driver, and then you can enable the GLES3 driver and it runs the show instead.

I found it very confusing to understand because I thought disabling the videocore would be turning it off completely.

User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Videocore and OpenGLES3 Pi4

Wed Jan 20, 2021 10:37 pm

PeterO wrote:
Wed Jan 20, 2021 8:26 pm
cleverca22 wrote:
Wed Jan 20, 2021 8:17 pm
i believe VC4 and VC6 (videocore4 and videocore6) is the name for the whole chip, and all peripherals within it
No.
See https://en.wikipedia.org/wiki/Raspberry ... ifications for correct names.
PeterO
Wait, that was wrong?

The wikipedia link you gave lists the GPU for the Pi4B as the "Broadcom VideoCore VI."

Are you saying it's wrong because the other comment didn't use roman numerals, or was that completely wrong?

I'm confused now.

Brian Beuken
Posts: 420
Joined: Fri Jan 29, 2016 12:51 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 10:14 am

Maybe I can make it clearer

Videocore is the brand name for the GPU contained inside the Broadcom SOC.. A SOC is a system on a chip, and contains the CPU and GPU and probably a couple of other things like memory controllers on board one piece of silicon. Its all pretty technical, but from a users point of view we just need to consider that the chip is a combined CPU/GPU package.. they are commonly used on phones and tablets, and Broadcom make their chips for that market as well as Pi.

Despite being on one chip the CPU and GPU are clear and distinct units that have different designs on different generations of the SOC. Broadcom supplied the Pi with steadily improved CPUs over its generations but didn't upgrade the GPU much until the Pi4 when it introduced a new design, the Videocore VI (the V never got used in the Pi).

The GPU on earlier versions of Pi, was the videocore iv (4) and is a moderately powered GPU capable of supporting OpenGLES 1 and OpenGLES2.0 natively.. in common with many other chips at the time.

The GPU on the Pi4 is a more advanced design videocore VI(6) capable of running OpenGLES3.1 (maybe 3.2 in due course).

GPU's control all the graphical concepts at a mathimatical level to draw polygons to screen buffers... they are programmable computational systems in their own right but highly optimised to focus on graphic maths. They are also complex to code and generally not too many people have the skill sets to do that, so we access the GPU via API's (Application Programming Interface), which in turn access the GPU code which is the drivers you load in.

OpenGLES is an API that allows coders to access the GPU using a standard set of access values and buffer concepts. OpenGLES is a subset of the much larger OpenGL API used on desktops. OpenGLES is used on lower powered GPU's such as mobile phones, Android tablets, and SOC's..
OpenGL (the big version) has quite a few extra features and buffer concepts and abilties that OpenGLES does not have natively.... more in a moment.

The more advanced design of the Videocore VI allows us to use the more advanced OpenGLES3.x which is a little bit closer to desktop OpenGL, but still lacks a few concepts.

Ok so far?

Now the complications start to come about because there is a version of the desktop OpenGL API available for the Rpi3 and 4 which provides most of the functionality of OpenGL3.? (current version of OpenGL is 4.6 I think so its an older version) This is provided by drivers which get the OpenGLES based Videocores IV and VI to work with quite a lot of the OpenGL API calls and that allows you to use OpenGL directly on your RPI, though sometimes not quite as efficiently as running OpenGLES. These are the "fake" KMS drivers and if you use those you effectively can run the provided OpenGL on your Pi.

You can't however run both systems at the same time, you're either in fake mode or legacy mode.. The firmware patches in a bit of code when it boots, that allows the OpenGL drivers to work, but effectively disables the OpenGLES drivers and vice verse.. you can still load and run but they will spit out no can do kinds of errors. The raspi-config utility sets up this firmware patch to choose.

If you leave it in the Legacy drivers you are running OpenGLES... if you use Fake KMS you are in OpenGL mode.

Its down to you which you prefer to have... I prefer legacy drivers as I feel I have more direct control of the GPU.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
http://www.scratchpadgames.net/
https://www.patreon.com/BrianBeuken

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 10:59 am

7F20 wrote:
Wed Jan 20, 2021 10:37 pm
PeterO wrote:
Wed Jan 20, 2021 8:26 pm
cleverca22 wrote:
Wed Jan 20, 2021 8:17 pm
i believe VC4 and VC6 (videocore4 and videocore6) is the name for the whole chip, and all peripherals within it
No.
See https://en.wikipedia.org/wiki/Raspberry ... ifications for correct names.
PeterO
Wait, that was wrong?
Your belief that VC4 and VC6 are the names for the whole chip (which I made clear by quoting you before I sad "No") :roll:
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 11:22 am

Brian Beuken wrote:
Thu Jan 21, 2021 10:14 am
Maybe I can make it clearer
I don't think your comments about openGL being available are correct. They don't agree with this (all be it from 2019)
https://www.raspberrypi.org/blog/vc4-an ... an-update/

In particular this reply in the comments:
>>>the VideoCore VI GPU can do OpenGL ES 3.2, but it can’t do OpenGL 3.0,
> Can you give a bit more details on this issue?

It is an issue with HW limits. Videocore VI hw only supports up to 4 multiple render targets.

For OpenGL ES that is enough, as the minimum value for GL_MAX_DRAW_BUFFERS is 4 (see table 6.27 on OpenGL ES 3.0 spec).

But for OpenGL 3.0 that is not enough, as the minimum value for GL_MAX_DRAW_BUFFERS is 8 (see table 6.51 on OpenGL 3.0 spec).
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Brian Beuken
Posts: 420
Joined: Fri Jan 29, 2016 12:51 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 11:56 am

I did say that the Pi's version of OpenGL "provides most of the functionality", some of that is done with some very clever programming that gets the GLES systems to behave like a GL system, some things however, like additional MRT's could be emulated in some way (I won't pretend to know exactly how they did/are doing, it). Consider that the API simply provides access points to code, in most cases that code will go to the GPU and run very fast, but you can also redirect it to ARM code doing the same thing, but a lot slower. The end result will be the same but the efficency will be variable.

So the result is the calls to the functions and the outputs from them do give the expected results, but its not all done using the hardware as it was designed. And its also important to realise that while the spec for GL3 states 8 draw buffers, it doesn't mean you have to use them all, in practice if you only use 2,3 or 4 you "probably" won't have an issue. So the Pi GL while attempting to be GL3? does not fully comply with the Khronos spec but has enough in there to work as long as you don't push it too hard.

Its really very hard to say exactly what version of OpenGL the Pi has, its a fairly stable GL2 with many GL3 features which is evolving, I've not seen anyone state clearly what version they were setting as a baseline.

I don't use the OpenGL drivers myself, because I don't want to bump into any unexpected issues like that, but even the ES systems have a few Khronos specs not met so you have to work around them when you code in OpenGLES as well and hope updates will fill things in.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
http://www.scratchpadgames.net/
https://www.patreon.com/BrianBeuken

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 1:10 pm

Brian Beuken wrote:
Thu Jan 21, 2021 11:56 am
And its also important to realise that while the spec for GL3 states 8 draw buffers, it doesn't mean you have to use them all, in practice if you only use 2,3 or 4 you "probably" won't have an issue. So the Pi GL while attempting to be GL3? does not fully comply with the Khronos spec but has enough in there to work as long as you don't push it too hard.
If it doesn't meet the spec for openGL it doesn't support openGL, that's all there is to it. "probably won't have an issue " and "don't push it too hard" are hardly strategies to use when developing applications !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Brian Beuken
Posts: 420
Joined: Fri Jan 29, 2016 12:51 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 1:19 pm

Well by that logic the current version of OpenGLES3.1 does not meet the spec, it's missing quite a few things. You do need to interrogate the GPU to see if it supports the feature you want, and often it says no... so you work around it. Sadly thats life in an opensource driver market.

I am happy to accept your view, I also don't consider it a full version of OpenGL, but it does work for a lot of projects especially early projects that targetted OpenGL2, and if people are more comfortable using an older OpenGL then they can knock themselves out.
I'd suggest they use OpenGLES2.0 and 3.0 and treat any 3.1 and 3.2 work as extensions they need to check are available.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
http://www.scratchpadgames.net/
https://www.patreon.com/BrianBeuken

Brian Beuken
Posts: 420
Joined: Fri Jan 29, 2016 12:51 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 1:26 pm

ps.. after a bit of digging around apparently its OpenGL2.1

So quite an old version, you really are much better off developing on ES3.0 it has a lot more features. I dont' honestly understand the need to cling on to OpenGL aside from some attempt to retain compatability with older Linux products...
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
http://www.scratchpadgames.net/
https://www.patreon.com/BrianBeuken

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 12102
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 5:14 pm

Largely correct, but a few errors.

OpenGL and OpenGLES have mandatory functions and optional ones. All mandatory features must be supported, but optional ones can be queried as to whether they are supported. This is tested via conformance tests, and if you submit your results to Khronos they'll validate them and list your device.

VideoCore6 has passed conformance for GLES 3.1, as listed at https://www.khronos.org/conformance/ado ... ission_882.
As noted at https://www.khronos.org/conformance/ado ... cts/opengl, the adopter program for OpenGL only started for 4.4, so therefore VideoCore is not listed. As has already been linked, VideoCore can't support one of the mandatory options for OpenGL3.0 so can never claim conformance, but does support many of the other parts of later specs.

OpenGL and GLES are just slightly different ways of making the 3D hardware do what you want.
Vulkan adds a third option, and the Pi is also conformant to Vulkan 1.0 - https://www.khronos.org/conformance/ado ... ission_530

The choice of API really comes down to exactly what you want to do. A bigger number doesn't always equate to better.

Xserver uses OpenGL (not GLES), so that's a very large part of why the Pi needs at least a reasonable level of GL support.

The "fake" KMS driver has NOTHING to do with V3D. It's whether the DRM/KMS rendering pipeline (putting image buffers on to displays) is controlled by the firmware ("fake") or Linux kernel ("full").
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Brian Beuken
Posts: 420
Joined: Fri Jan 29, 2016 12:51 pm

Re: Videocore and OpenGLES3 Pi4

Thu Jan 21, 2021 9:43 pm

thanks for the corrections and thats interesting to know the Xserver needs the OpenGL.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
http://www.scratchpadgames.net/
https://www.patreon.com/BrianBeuken

User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Videocore and OpenGLES3 Pi4

Sun Jan 24, 2021 7:12 pm

Brian Beuken wrote:
Thu Jan 21, 2021 9:43 pm
thanks for the corrections and thats interesting to know the Xserver needs the OpenGL.
6by9 wrote: The "fake" KMS driver has NOTHING to do with V3D. It's whether the DRM/KMS rendering pipeline (putting image buffers on to displays) is controlled by the firmware ("fake") or Linux kernel ("full").
Thanks for all of the comments. I read everything and that is all great information, but I couldn't find an answer to my original question yet.

Which is:

Why, while compiling a program, I have to "--disable videocore" if I want to "--enable-OpenGLES3."

Or is that not true? I was following instructions to compile from GLES3, and was told that I have to --disable videocore in order to tell the program to use GLES3 instead of the VC6 drivers to "control video output."


This is a summary of what I took away from the comments:

So it seems that, in order to have 3D hardware acceleration, I choose between KMS and FKMS.

-FKMS allows the firmware to control the DRM/KMS rendering pipeline AND is necessary if I want to use "regular" OpenGL which is compliance limited to 2.1, but actually can use many of the 3.0 features.

-KMS (full KMS) uses the Linux Kernel to control the DRM/KMS pipeline and isn't compatible with "regular" OpenGL, but uses GLES, and can run more features and is (presumably) being worked on more at this point.


Thanks

jayben
Posts: 391
Joined: Mon Aug 19, 2019 9:56 pm

Re: Videocore and OpenGLES3 Pi4

Sun Jan 24, 2021 7:20 pm

I haven't found it necessary to enable or disable anything to run OpenGL 2 or OpenGL ES 3. See https://iosoft.blog/oscilloscope-displa ... pberry-pi/ which works on both without any other settings.

User avatar
Paeryn
Posts: 3366
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Videocore and OpenGLES3 Pi4

Sun Jan 24, 2021 8:17 pm

7F20 wrote:
Sun Jan 24, 2021 7:12 pm
I read everything and that is all great information, but I couldn't find an answer to my original question yet.

Which is:

Why, while compiling a program, I have to "--disable videocore" if I want to "--enable-OpenGLES3."

Or is that not true? I was following instructions to compile from GLES3, and was told that I have to --disable videocore in order to tell the program to use GLES3 instead of the VC6 drivers to "control video output."
Where have you got this "--disable videocore" and "--enable-OpenGLES3" from? By the sounds of it they are configuration options that a particular program uses to choose what interfaces the resultant program will be compiled to use.

Originally, before Mesa had drivers for the VC4, OpenGLES was provided by the Broadcom drivers and was totally separate from X11. Presumably the --disable videocore option built the program using the standard Linux/Mesa drivers and not use the Broadcom drivers (the RPi4 & RPi400 can't use the Broadcom drivers anyway). And the --enable-OpenGLES3 probably was to choose OpenGLES3 rather than OpenGLES2 or OpenGL3 or whichever other version it could be compiled to use.

Since you haven't said what this program is that you are compiling we can only guess as to what these options actually do and why they are needed, they definitely aren't generic options that apply to every OpenGL program you compile.
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!

User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Videocore and OpenGLES3 Pi4

Sun Jan 24, 2021 10:06 pm

Paeryn wrote:
Sun Jan 24, 2021 8:17 pm
Presumably the --disable videocore option built the program using the standard Linux/Mesa drivers and not use the Broadcom drivers (the RPi4 & RPi400 can't use the Broadcom drivers anyway). And the --enable-OpenGLES3 probably was to choose OpenGLES3 rather than OpenGLES2 or OpenGL3 or whichever other version it could be compiled to use.
Thanks for the reply.

That sounds about right.
So, I guess that is because the program is able to compile for the Pi3 or Pi4, so it needs to know which driver stack to target. I didn't know that the Pi4 couldn't use the Broadcom drivers, I thought (based on earlier comments) that it could, but was limited to 2D stuff and simply couldn't use hardware acceleration.
Since you haven't said what this program is that you are compiling we can only guess as to what these options actually do and why they are needed, they definitely aren't generic options that apply to every OpenGL program you compile.
I apologize for not giving you enough information. I was attempting to be as succinct as possible.

I'm trying to compile RetroArch to target GLES3, but it's a little tricky because I'm outputting Retroarch to a non-standard display that doesn't have a resolution suitable for X11. I have it working fine on a Pi4 with OpenGL2 using FKMS, but I couldn't get it working the last time I tried with full KMS because GLES may need a windowing environment to function (or it seemed to when I was testing it).
It was also suggested to me that it might work to boot into cli and launch with "startx ./retroarch." Though, I'm sure I tried that the last time around and it failed with the same "no suitable resolution" error.

There aren't any official details concerning the compilation instruction for Retroarch armhf on the level that explains how the developers intended for each possible configuration to be handled. It's a bit of a work-in-progress type of thing, and I'm feeling my way along.

User avatar
Paeryn
Posts: 3366
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Videocore and OpenGLES3 Pi4

Mon Jan 25, 2021 1:27 am

7F20 wrote:
Sun Jan 24, 2021 10:06 pm
Paeryn wrote:
Sun Jan 24, 2021 8:17 pm
Presumably the --disable videocore option built the program using the standard Linux/Mesa drivers and not use the Broadcom drivers (the RPi4 & RPi400 can't use the Broadcom drivers anyway). And the --enable-OpenGLES3 probably was to choose OpenGLES3 rather than OpenGLES2 or OpenGL3 or whichever other version it could be compiled to use.
Thanks for the reply.

That sounds about right.
So, I guess that is because the program is able to compile for the Pi3 or Pi4, so it needs to know which driver stack to target. I didn't know that the Pi4 couldn't use the Broadcom drivers, I thought (based on earlier comments) that it could, but was limited to 2D stuff and simply couldn't use hardware acceleration.
I meant Broadcom's OpenGL, OpenVG (& probably EGL) drivers can't be used on the RPi4. You possibly could still use Broadcom's dispmanx on the RPi4 as long as you use FKMS as I think FKMS uses dispmanx behind the scenes to manage the display on its behalf, but if you use KMS then KMS takes over the management of the display itself.
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!

Bluestang
Posts: 70
Joined: Sat May 30, 2020 8:43 pm

Re: Videocore and OpenGLES3 Pi4

Mon Jan 25, 2021 3:32 am

7F20 wrote:
Wed Jan 20, 2021 6:42 pm
I'm a little confused about exactly what Videocore is, and how to configure things while I'm compiling for videocore or GLES3 and how that interacts with FKMS and full KMS.

My current understanding of it is like this:

-Videocore is the name of the GPU

-"Videocore" can be enable or disabled when compiling a program, but this doesn't disable the GPU, it disables the "Videocore" driver

-If I --disable videocore, then I can enable GLES3, and that will allow GLES to handle the GPU (which is the Videocore?) instead of the videocore driver.

-In order to use videocore OR GLES3, I have to use full KMS and not fake KMS (FKMS)

Am I on the right track here? Can anyone help sort me out if I'm egregiously wrong?

Thanks

Build RetroArch with the following to support all APIs - OpenGLES and Vulkan

Code: Select all

./configure --disable-sdl --enable-sdl2 --disable-oss --disable-al --disable-jack --disable-qt --disable-pulse --enable-opengles --enable-opengles3_1 --disable-opengles3_2 --disable-videocore --enable-kms --enable-egl --enable-vulkan --disable-wayland
This will also work directly from KMS/DRM and X11.

The Pi4 must be built the standard “Unix” way because the videocore options are meant to build binaries using the proprietary Broadcom headers vs using the MESA headers.

Regardless of FKMS or KMS you build your applications using the standard “Unix” way.

User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Videocore and OpenGLES3 Pi4

Mon Jan 25, 2021 7:31 pm

Bluestang wrote:
Mon Jan 25, 2021 3:32 am


Build RetroArch with the following to support all APIs - OpenGLES and Vulkan

Code: Select all

./configure --disable-sdl --enable-sdl2 --disable-oss --disable-al --disable-jack --disable-qt --disable-pulse --enable-opengles --enable-opengles3_1 --disable-opengles3_2 --disable-videocore --enable-kms --enable-egl --enable-vulkan --disable-wayland
This will also work directly from KMS/DRM and X11.

The Pi4 must be built the standard “Unix” way because the videocore options are meant to build binaries using the proprietary Broadcom headers vs using the MESA headers.

Regardless of FKMS or KMS you build your applications using the standard “Unix” way.
Thanks for the reply.

The main issue I was facing the last time I tried to compile RA with GLES3 was that it seemed that I could only get RA to compile with GLES3 support if I also had X11 installed, and anytime I tried to start it, it would error out with a "no suitable resolution" error.

Do you think I can compile RA like you suggest on Raspberry Pi OS lite without the X windowing environment installed?

I know this question is a little outside the scope of my original post, but it's something I'm going to have to figure out, and it you have some idea about the result I would get, it might save me some time and headache.

Thanks

Bluestang
Posts: 70
Joined: Sat May 30, 2020 8:43 pm

Re: Videocore and OpenGLES3 Pi4

Mon Jan 25, 2021 11:57 pm

7F20 wrote:
Mon Jan 25, 2021 7:31 pm
Bluestang wrote:
Mon Jan 25, 2021 3:32 am


Build RetroArch with the following to support all APIs - OpenGLES and Vulkan

Code: Select all

./configure --disable-sdl --enable-sdl2 --disable-oss --disable-al --disable-jack --disable-qt --disable-pulse --enable-opengles --enable-opengles3_1 --disable-opengles3_2 --disable-videocore --enable-kms --enable-egl --enable-vulkan --disable-wayland
This will also work directly from KMS/DRM and X11.

The Pi4 must be built the standard “Unix” way because the videocore options are meant to build binaries using the proprietary Broadcom headers vs using the MESA headers.

Regardless of FKMS or KMS you build your applications using the standard “Unix” way.
Thanks for the reply.

The main issue I was facing the last time I tried to compile RA with GLES3 was that it seemed that I could only get RA to compile with GLES3 support if I also had X11 installed, and anytime I tried to start it, it would error out with a "no suitable resolution" error.

Do you think I can compile RA like you suggest on Raspberry Pi OS lite without the X windowing environment installed?

I know this question is a little outside the scope of my original post, but it's something I'm going to have to figure out, and it you have some idea about the result I would get, it might save me some time and headache.

Thanks
I've never tried building RetroArch by specifically disabling X11, but you can try these settings:
(similar to the ones I posted earlier but with the added

Code: Select all

--disable-x11
configure flag.)

Code: Select all

./configure --disable-sdl --enable-sdl2 --disable-oss --disable-al --disable-jack --disable-qt --disable-pulse --enable-opengles --enable-opengles3_1 --disable-opengles3_2 --disable-videocore --enable-kms --enable-egl --enable-vulkan --disable-wayland --disable-x11
OpenGLES will work with KMS/DRM directly using the

Code: Select all

--enable-kms
configure flag. There is nothing that comes why it would not build because the GL context RetroArch creates should be using EGL which is what it used to interface with KMS/DRM.

RetroPie uses very similar settings to build RetroArch that works in the KMS/DRM for the RPi4. Perhaps maybe use their image as it is also based on RPiOS lite IIRC?

User avatar
7F20
Posts: 89
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Videocore and OpenGLES3 Pi4

Tue Jan 26, 2021 1:01 am

Bluestang wrote:
Mon Jan 25, 2021 11:57 pm
There is nothing that comes why it would not build because the GL context RetroArch creates should be using EGL which is what it used to interface with KMS/DRM.
Thanks for the extra suggestions. I got another recommendation for EGL from someone, but AFAIK, it hasn't been done yet (I haven't seen anyone post about it in the usual places).

Also, I don't think the EGL stuff is on the Pi image, I think one would probably have to at least

Code: Select all

sudo apt install libegl-dev libegl-mesa0
or something like that.

RetroPie uses very similar settings to build RetroArch that works in the KMS/DRM for the RPi4. Perhaps maybe use their image as it is also based on RPiOS lite IIRC?
I've gone down the RP road before, and never again. Too many issues getting it to work with a low-resolution monitor, and the settings are all obfuscated and spread out over multiple menus that leave a labyrinth of entries in your filesystem.

I'll try out a few builds over the next week and see if I can make something work. Thanks.

Return to “OpenGLES”