How to use GLFW / OpenGL ES on Armbian
#1
Hi folks,

I am trying to write a small application that renders stuff using OpenGL ES on Armbian. I enabled 3D video acceleration via the RK3328 Media Script. Now I'm trying to create a simple window with an OpenGL context on it, using GLFW:


Code:
if err := glfw.Init(); err != nil {
 panic(err)
}
defer glfw.Terminate()

glfw.WindowHint(glfw.ClientAPI, glfw.OpenGLESAPI)

window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil)

(This is Go, but I think the programming language is not really relevant.)

I compile and link that using -lGLESv2 and GLFW's dependencies, which produces a binary. However, when I execute that, I get:

Code:
libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip
2019/04/14 16:46:56 Link error in program Program(0): ""

So for some reason, my executable uses libGL instead of libGLESv2, and that doesn't work, since the rockchip only supports OpenGL ES. I have no idea why that happens. ldd ensures me that my binary is not linked against libGL.

How can I fix that? Is there perhaps a better Linux distribution for development? I tested Debian before, but that wasn't even able to install X11 and was pretty bricked after I tried.
  Reply
#2
For whatever it's worth glxgears tells me the same thing.
Code:
libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip

And es2gears:
Code:
libEGL warning: DRI2: failed to open rockchip (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)

But in my xorg log
Code:
[   727.608] (II) Loading sub module "dri2"
[   727.608] (II) LoadModule: "dri2"
[   727.608] (II) Module "dri2" already built-in

In the README with armsoc (xorg video driver, this from Ayufan at
https://github.com/ayufan-rock64-package...deo-armsoc
it talks about building a DRM driver yourself and there is a drmmode_rockchip.c which compiles by the makefile into drmmode_rockchip.lo
So I copied that to one of the paths mentioned and ran ldconfig but it didn't seem to make any difference.  (DRM and DRI are different versions of the same thing).  Oh, wait a normal library is a .so file, I think a .lo is only for linking to something else.

I remember there was an ad that touted the Rock64 as a multimedia powerhouse and I think I remember 500-600 FPS from es2gears or glxgears.  I also remember fullscreen video without CPU load.   But now I'm seeing 200-300 with a lot of CPU usage so the Mali isn't doing anything.  When in doubt, reboot, so I'll try that.

I installed glmark2 (benchmark) from https://github.com/glmark2/glmark2 and it tells me:
Code:
   OpenGL Information
    GL_VENDOR:     VMware, Inc.
    GL_RENDERER:   llvmpipe (LLVM 7.0, 128 bits)
    GL_VERSION:    OpenGL ES 3.0 Mesa 18.3.6
so it's running under Mesa as I suspected.  I don't know how to switch.  But I'm running an Ayufan image not Armbian.  You can run Mesa on pretty much anything I think, it's software emulation, it's not the Mali.

Try glxinfo too, what I see at the top is
Code:
libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip
then it proceeds to exercise Mesa and show lots of data about it.  But it confirms that it's not hardware OpenGL ES.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  RXDP from Win10 to Armbian on Rock64 Transportsicherung 0 541 05-27-2023, 06:11 AM
Last Post: Transportsicherung
  USB3.0 Issues at DietPi(Armbian) #22.02.1 t4_4t 3 2,249 08-15-2022, 06:58 PM
Last Post: TRS-80
  Armbian for Rock64 pineadmin 57 69,758 04-01-2022, 03:16 PM
Last Post: TRS-80
  Armbian 22.02 Release Announcement TRS-80 0 974 02-28-2022, 05:06 PM
Last Post: TRS-80
  Armbian/Ubuntu for Rockbox Wizzard 5 4,146 05-18-2021, 08:18 AM
Last Post: Wizzard
  Armbian 5.4.43: Network is unreachable; Red LED blinking; RNG failure? aves 1 2,864 07-27-2020, 02:04 PM
Last Post: aves
  Unable to boot armbian fchazal 2 3,758 05-19-2020, 06:43 PM
Last Post: Rocklobster
  armbian / bionic - hdmi to vga not functioning on newer5.4 kapqa 1 2,961 03-31-2020, 07:19 PM
Last Post: tllim
  Not able to boot Armbian 5.75@Rock64 4GB wundidajah 1 2,504 03-29-2019, 05:30 AM
Last Post: dkryder
Question No USB Power (ROCK64+ARMBIAN 5.7) takezo 2 3,994 03-15-2019, 07:46 AM
Last Post: takezo

Forum Jump:


Users browsing this thread: 1 Guest(s)