Recent

Author Topic: Is opengl supported on arm linux ?  (Read 4824 times)

sainimu78

  • Full Member
  • ***
  • Posts: 117
Is opengl supported on arm linux ?
« on: March 12, 2018, 06:37:21 am »
On my arm board with debian, I run glewinfo, it returns Error: glewCreateContext failed. I had installed libgl1-mesa-dev. Of cause the demo of openglcontrol_demo doesn't work. How can I use opengl on the board ?

Thaddy

  • Hero Member
  • *****
  • Posts: 8911
Re: Is opengl supported on arm linux ?
« Reply #1 on: March 12, 2018, 07:14:52 am »
depends on the board. E.g. A Raspberry Pi runs OpenGLES2 with hardware acceleration through Broadcom drivers (and so fast), but runs OpenGL (NOT ES)  in software emulation using mesa drivers from Debian (very,very slow).
So if the manufacturer provides drivers the answer is yes, otherwise it may be able to run in software emulation. Note FPC's headers need a switch (provided in the sources of opengles2) to switch-off x-windows, on X, even the Raspberry Pi emulates OpenGLES in software. I am busy/working on better headers..
Most people that want to use threading should learn to patch their jeans first: use a needle.

sainimu78

  • Full Member
  • ***
  • Posts: 117
Re: Is opengl supported on arm linux ?
« Reply #2 on: March 12, 2018, 07:36:11 am »
My board supports mali GPU, I can use it through opengles? How to switch off X?
Can you provide a demo I will test it on the board.

Thaddy

  • Hero Member
  • *****
  • Posts: 8911
Re: Is opengl supported on arm linux ?
« Reply #3 on: March 12, 2018, 08:15:50 am »
My board supports mali GPU, I can use it through opengles? How to switch off X?
Can you provide a demo I will test it on the board.
My Orange Pi  (Allwinner H3) has Mali drivers, but I never used them because I deem the Orange Pi unreliable. It is actually gathering dust.
So I don't know the status of those drivers. It may or not support hardware accelerated OpenGLES. You will have to obtain such information from the support forums.
It may even not be necessary to turn off X on the Mali, but antway:
Code: Pascal  [Select]
  1. unit gles20;
  2. {$mode objfpc}
  3. {$ifdef linux}
  4.   {$define EGL}
  5.   { undefine X for other Linux windowmanagers }
  6.   {.$define X}
  7. {$endif}
This enables full screen hardware accelerated OpenGles2 support on the Raspberry Pi through BCM+EGL+OpenGles2 drivers from Broadcom.

But I guess that may not be relevant for you.
[edit]
https://developer.arm.com/products/software/mali-sdks/opengl-es
« Last Edit: March 12, 2018, 08:19:26 am by Thaddy »
Most people that want to use threading should learn to patch their jeans first: use a needle.

Thaddy

  • Hero Member
  • *****
  • Posts: 8911
Re: Is opengl supported on arm linux ?
« Reply #4 on: March 12, 2018, 12:00:02 pm »
I just dusted off the Orange... Seems to work with OpenGLES2 acceleration pretty well... Can't test OpenGL plain: almost never use it.
The FPC provided examples work, as does the teapot.
Most people that want to use threading should learn to patch their jeans first: use a needle.

Thaddy

  • Hero Member
  • *****
  • Posts: 8911
Re: Is opengl supported on arm linux ?
« Reply #5 on: August 15, 2019, 09:12:02 am »
Some news: Raspbian  Buster has a videocoreIV/VI hardware enabled opengl back-end enabled (also used for GUI rendering) and all but one of the examples in opengl and opengles20 now render much! much faster than previous, even faster than with my earlier modifications for opengles20 to use hardware accelleration over EGL!.  Tested RPi4 and RPi3.

You need to install freeglut3-dev from apt for the opengl examples (not for opengles20 examples).
« Last Edit: August 15, 2019, 09:20:19 am by Thaddy »
Most people that want to use threading should learn to patch their jeans first: use a needle.