OpenGL Problems with P2D and P3D

I’m running Ubuntu 20.04 on Rockchip RK3588 modules with Firefly Core-3588J.
I can’t run any processing sketches in an OpenGL rendering mode. I’m wondering if there’s a decent way to solve my problems so that I can run code. Thank you for your help.

Information about Rockchip RK3588:

Running P2D\P3D(like PixelFlow) code produces the following error message.

GLException: Profiles [GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GLES2] not available on device X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x1af0ce5c, isOwner false, <6bc35e7e, 79790100>[count 0, qsz 0, owner <NULL>]]]Caught handled GLException: EGLGLXDrawableFactory - Could not initialize shared resources for EGLGraphicsDevice[type .egl, v0.0.0, connection :0, unitID 0, handle 0x0, owner true, ResourceToolkitLock[obj 0x3b5e0056, isOwner true, <130b661d, 6ab194e4>[count 1, qsz 0, owner <main-SharedResourceRunner>]]] on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:561)
    [1]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [2]: java.base/java.lang.Thread.run(Thread.java:833)
Caused[0] by GLException: Failed to created/initialize EGL display incl. fallback default: native 0x0, error 0x3008/0x300c on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDisplayUtil.eglGetDisplayAndInitialize(EGLDisplayUtil.java:381)
    [1]: jogamp.opengl.egl.EGLDisplayUtil.access$300(EGLDisplayUtil.java:61)
    [2]: jogamp.opengl.egl.EGLDisplayUtil$1.eglGetAndInitDisplay(EGLDisplayUtil.java:404)
    [3]: com.jogamp.nativewindow.egl.EGLGraphicsDevice.open(EGLGraphicsDevice.java:125)
    [4]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createEGLSharedResourceImpl(EGLDrawableFactory.java:575)
    [5]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:559)
    [6]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [7]: java.base/java.lang.Thread.run(Thread.java:833)
Caught handled GLException: EGLGLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x1af0ce5c, isOwner true, <6bc35e7e, 79790100>[count 1, qsz 0, owner <main-SharedResourceRunner>]]] on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:561)
    [1]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [2]: java.base/java.lang.Thread.run(Thread.java:833)
Caused[0] by GLException: Failed to created/initialize EGL display incl. fallback default: native 0x0, error 0x3008/0x300c on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDisplayUtil.eglGetDisplayAndInitialize(EGLDisplayUtil.java:381)
    [1]: jogamp.opengl.egl.EGLDisplayUtil.access$300(EGLDisplayUtil.java:61)
    [2]: jogamp.opengl.egl.EGLDisplayUtil$1.eglGetAndInitDisplay(EGLDisplayUtil.java:404)
    [3]: com.jogamp.nativewindow.egl.EGLGraphicsDevice.open(EGLGraphicsDevice.java:125)
    [4]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createEGLSharedResourceImpl(EGLDrawableFactory.java:575)
    [5]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:559)
    [6]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [7]: java.base/java.lang.Thread.run(Thread.java:833)
com.jogamp.opengl.GLException: Profiles [GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GLES2] not available on device X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x1af0ce5c, isOwner false, <6bc35e7e, 79790100>[count 0, qsz 0, owner <NULL>]]]
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:1060)
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:1071)
	at com.jogamp.opengl.GLProfile.getMaxProgrammable(GLProfile.java:847)
	at processing.opengl.PSurfaceJOGL.initGL(PSurfaceJOGL.java:226)
	at processing.opengl.PSurfaceJOGL.initFrame(PSurfaceJOGL.java:149)
	at processing.core.PApplet.initSurface(PApplet.java:10315)
	at processing.core.PApplet.runSketch(PApplet.java:10221)
GLException: Profiles [GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GLES2] not available on device X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x1af0ce5c, isOwner false, <6bc35e7e, 79790100>[count 0, qsz 0, owner <NULL>]]]
	at processing.core.PApplet.main(PApplet.java:9960)
1 Like

If you’re happy with coding against Processing with straight Java, you could see if these work - GitHub - codelerity/libp5x-examples: Examples using libp5x They use LWJGL rendering rather than JOGL.

It looks like you might not have opengl drivers installed. Can you run glxinfo and does it show (the first few lines) that you have opengl installed?

Thank you for your reply!!!

The following is information and I droped ‘xxx extensions:…’ :

root@firefly:~# glxinfo
name of display: :0
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:

GLX version: 1.4
GLX extensions:

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa/X.org (0xffffffff)
    Device: llvmpipe (LLVM 12.0.0, 128 bits) (0xffffffff)
    Version: 21.2.6
    Accelerated: no
    Video memory: 3461MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 128 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
   

OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
   

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
root@firefly:~# glxinfo | grep OpenGL
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 128 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

I ran PixelFlow sketch again after completing some installations. This time I had a window, but nothing happened inside and it produces the following error message.

Caught handled GLException: EGLGLXDrawableFactory - Could not initialize shared resources for EGLGraphicsDevice[type .egl, v0.0.0, connection :0, unitID 0, handle 0x0, owner true, ResourceToolkitLock[obj 0xb6f2dbc, isOwner true, <1bd40992, 5ab08815>[count 1, qsz 0, owner <main-SharedResourceRunner>]]] on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:561)
    [1]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [2]: java.base/java.lang.Thread.run(Thread.java:833)
Caused[0] by GLException: Failed to created/initialize EGL display incl. fallback default: native 0x0, error 0x3008/0x3000 on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDisplayUtil.eglGetDisplayAndInitialize(EGLDisplayUtil.java:381)
    [1]: jogamp.opengl.egl.EGLDisplayUtil.access$300(EGLDisplayUtil.java:61)
    [2]: jogamp.opengl.egl.EGLDisplayUtil$1.eglGetAndInitDisplay(EGLDisplayUtil.java:404)
    [3]: com.jogamp.nativewindow.egl.EGLGraphicsDevice.open(EGLGraphicsDevice.java:125)
    [4]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createEGLSharedResourceImpl(EGLDrawableFactory.java:575)
    [5]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:559)
    [6]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [7]: java.base/java.lang.Thread.run(Thread.java:833)
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
Caught handled GLException: EGLGLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x2ac8b01f, isOwner true, <29aa2a1b, 2cfa7f4>[count 1, qsz 0, owner <main-SharedResourceRunner>]]] on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:561)
    [1]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [2]: java.base/java.lang.Thread.run(Thread.java:833)
Caused[0] by GLException: Failed to created/initialize EGL display incl. fallback default: native 0x0, error 0x3008/0x3000 on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDisplayUtil.eglGetDisplayAndInitialize(EGLDisplayUtil.java:381)
    [1]: jogamp.opengl.egl.EGLDisplayUtil.access$300(EGLDisplayUtil.java:61)
    [2]: jogamp.opengl.egl.EGLDisplayUtil$1.eglGetAndInitDisplay(EGLDisplayUtil.java:404)
    [3]: com.jogamp.nativewindow.egl.EGLGraphicsDevice.open(EGLGraphicsDevice.java:125)
    [4]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createEGLSharedResourceImpl(EGLDrawableFactory.java:575)
    [5]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:559)
    [6]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [7]: java.base/java.lang.Thread.run(Thread.java:833)
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
OpenGL error 1280 at bot beginDraw(): invalid enumerant
[-] PixelFlow v1.3.0 - www.thomasdiewald.com

[-] DEVICE ... llvmpipe (LLVM 12.0.0, 128 bits)
[-] GLSL ..... #version 450 core / 4.50.0
[-] GL ....... 4.5 (Core profile, arb, compat[ES2, ES3, ES31, ES32], FBO, software) - 4.5 (Core Profile) Mesa 21.2.6

X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 3/3, reusable (open, marked uncloseable): 0, pending (open in creation order): 3)
X11Util: Open X11 Display Connections: 3
X11Util: Open[0]: NamedX11Display[:0, 0x7f1c001640, refCount 1, unCloseable false]
X11Util: Open[1]: NamedX11Display[:0, 0x7fac6e4e00, refCount 1, unCloseable false]
X11Util: Open[2]: NamedX11Display[:0, 0x7f1c016100, refCount 1, unCloseable false]

It looks like you don’t have a hardware OpenGL driver installed since that is only showing the Mesa software gl implementation. The command inxi -G should tell what graphics hardware you have. See if you can find hardware graphics drivers for your machine.

1 Like