# OpenGL Problems with P2D and P3D

**URL:** <https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439>\
**Category:** Processing\
**Created:** [October 26, 2022, 3:48am UTC](https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439 "2022-10-26T03:48:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheni](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Cheni](https://discourse.processing.org/u/Cheni)\
**Post date:** [October 26, 2022, 3:48am UTC](https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439/1 "2022-10-26T03:48:56Z")

</div>

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:

- SoC – SoC – [Rockchip RK3588] octa-core processor with 4x Arm Cortex-A76 cores @ up to 2.4 GHz, 4x Arm Cortex-A55 cores, Arm Mali-G610 MP4 GPU with support for OpenGL ES3.2, OpenCL 2.2, Vulkan1.1, 6 TOPS NPU, 48MP ISP, 8Kp60 video decoding, 8Kp30 video encoding  
([Rockchip RK3588 datasheet available, SBC's coming soon - CNX Software](https://www.cnx-software.com/2021/12/16/rockchip-rk3588-datasheet-sbc-coming-soon/))

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

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [October 27, 2022, 10:13am UTC](https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439/2 "2022-10-27T10:13:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![scudly](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/scudly/32/5597_2.png) [@scudly](https://discourse.processing.org/u/scudly)\
**Post date:** [October 27, 2022, 4:31pm UTC](https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439/3 "2022-10-27T16:31:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Cheni](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Cheni](https://discourse.processing.org/u/Cheni)\
**Post date:** [October 31, 2022, 5:06am UTC](https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439/4 "2022-10-31T05:06:39Z")

</div>

Thank you for your reply!!!

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

```auto
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:

```

```auto
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.

```auto
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]

```

 ![Screenshot](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/d/5/d5adf9fdde28916c153a25ae6d10aec9a014b661.png)

---

<div class="post-metadata">

**Author:** ![scudly](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/scudly/32/5597_2.png) [@scudly](https://discourse.processing.org/u/scudly)\
**Post date:** [October 31, 2022, 6:08am UTC](https://discourse.processing.org/t/opengl-problems-with-p2d-and-p3d/39439/5 "2022-10-31T06:08:36Z")

</div>

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.
