LWJGL doesn't recognize OpenGL on Raspberry Pi - opengl-es

So I am trying to run a LibGDX game which uses LWJGL as a backend on my Raspberry Pi 3. I tried various gl driver combinations on the pi:
experimental driver: game start but crashes soon after with JVM Errors, totally unstable
no experimental driver: software rendering seemes to be used, very slow
propretairy driver only (mesa uninstalled): LWJGL fails at initializing gl and crashes (stacktrace below)
Since I think the proprietary driver is the most stable GL driver I intend to use it. Also, I know that OpenGL is working because of glxgears an JOGL working fine.
So, has anybody any hint or an idea where to start looking? Is this a LWJGL issue or a GL driver issue?
Thank you in advance,
Manuel
Stacktrace:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.createDisplayPixelFormat(LwjglGraphics.java:322)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:216)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:144)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: org.lwjgl.LWJGLException: Could not init GLX
at org.lwjgl.opengl.LinuxDisplayPeerInfo.initDefaultPeerInfo(Native Method)
at org.lwjgl.opengl.LinuxDisplayPeerInfo.<init>(LinuxDisplayPeerInfo.java:61)
at org.lwjgl.opengl.LinuxDisplay.createPeerInfo(LinuxDisplay.java:831)
at org.lwjgl.opengl.DrawableGL.setPixelFormat(DrawableGL.java:61)
at org.lwjgl.opengl.Display.create(Display.java:846)
at org.lwjgl.opengl.Display.create(Display.java:757)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.createDisplayPixelFormat(LwjglGraphics.java:314)
... 3 more

LWJGL and LWJGL3 do support the open-source (Mesa) OpenGL driver. The numerous demos of Minecraft Java Edition for Raspberry Pi demonstrate this.
In fact LibGDX runs smoothly on a Raspberry Pi 3 as shown by PokeMMO.
The right direction is to pursue the open-source driver, which at the time of writing is no longer labeled experimental. In fact it is the only way to use accelerated 3D graphics on a Raspberry Pi 4.
Since I think the proprietary driver is the most stable GL driver I intend to use it. Also, I know that OpenGL is working because of glxgears and JOGL working fine.
JOGL has the advantage of supporting both the proprietary GLES driver (for a Pi Zero) as well as an OpenGL backend. The proprietary driver cannot run full OpenGL though, so it may appear to work only because the Pi 3's CPU is sufficient to run glxgears in software rendering at full speed.

Related

Deploying Qt5 on Windows without Hardware Acceleration

Qt5 can use the OpenGL driver or the DirectX Driver by using ANGLE. As we cannot depend on an installed OpenGL driver, we need to use the ANGLE backend. Unfortunately, this doesn't solve all deployment problems especially on Windows virtual machines without hardware acceleration. On these systems, we're getting an error message saying that the creation of an OpenGL context failed.
Screenshot: Failed to create OpenGL context for format QSurfaceFormat
We're deploying all required libraries (libEGL.dll libGLESv2.dll libeay32.dll msvcp110.dll msvcr110.dll d3dcompiler_46.dll) but we're still getting this error message.
How do you deploy a QML application that needs to run on end user machines without OpenGL driver and on (virtual) machines without Direct3D Acceleration?
There is a page on the Qt wiki mentioning this problem, but that's not very helpful for solving it.
Update for Qt 5.4.0:
My findings so far are:
Setting QT_ANGLE_PLATFORM=warp -> creates a windows without content.
Setting QT_ANGLE_PLATFORM=d3d9 -> same error dialog, as expected.
Setting QT_ANGLE_PLATFORM=d3d11 -> same error dialog, as expected.
Setting QT_OPENGL=desktop -> same as QT_ANGLE_PLATFORM=warp.
Setting QT_OPENGL=angle -> same error dialog, as expected.
Setting QT_OPENGL=software + opengl32sw.dll (mesa for windows) -> unpredictable: May run, may crash, may show the error dialog.
Update for Qt Quick 2D Renderer
Although, Mesa seems to be a partial solution, the configration seems to be very crash often in Qt 5.4.0 .
Another fallback could be the Qt Quick 2D Renderer, but unfortunately this crashes too.
Copying softwarecontext.dll into /scenegraph + Setting QMLSCENE_DEVICE=softwarecontext -> crash
Update after some user experience:
Angle
Has some render bugs on some systems
Does not work reliable on all systems
Angle with Warp
Not reliable
Desktop OpenGL
The default implements OpenGL 1.1, which is too old.
Not reliable, even if the OpenGL version is ok.
Has render bugs, if used by Qt
QtQuick2dRenderer
Has some major render issues
Crashes, Freezes
Works on systems without HW acceleration
Mesa OpenGL Backend
Seems to be quite reliable at the moment
quite slow in general, very slow on some systems.
Heavy Deployment weight
Conclusion: there is still no real solution for these systems
Update for Qt 5.5
Anno 2015: Broken graphics drives are still broken.
My conclusion for the moment is:
Use QtQuick2dRenderer if possible.
Use Mesa backend otherwise.
Skip Angle, skip Desktop OpenGL, skip Warp.
QT 5 has huge compatibility issue with opengl on some hardware configurations
Combination of Intel HD3000 driver and Nvidia/ATI card won't work on Windows 10.
https://bugreports.qt.io/browse/QTBUG-42240
Intel drops support for this card but their drivers has bug that leads to crash.
You cannot rely on hardware opengl if you want to support customers with HD3000.
Under Windows, opengl32.dll is the default OpenGL driver. It implements OpenGL 1.1 (really old version).
ANGLE has a baseline of OpenGL ES 2.0 and needs DirectX 9/11 installed to map the calls into.
So if you got a video card that doesn't have an OpenGL driver installed, an OpenGL driver less than 2.0, and/or DirectX 9/11 not installed, your app is not going to work.
In regards to virtualization and 3D acceleration, these maybe worth a read:
Why does Qt Creator 3.0.0 Welcome Mode not work in VM?
https://bugreports.qt.io/browse/QTBUG-34964
Also, if you run a multi monitor Windows environment under VirtualBox, 3d acceleration will be disabled.
I re-checked this to see if these problems have been fixed by the latest release of QT 5.12.2, but no they have not. The function described in the QT wiki entry OP referenced
https://wiki.qt.io/Qt_5_on_Windows_ANGLE_and_OpenGL sounds good but in practice it simply doesn't work.
I conclude avoid OpenGL on QT in any form. It's just too unreliable.

Red/System binding for 3D graphics on Raspberry Pi

For someone getting started with Red/System programming on the Raspberry Pi, what is the best way to access the GPU for 3D rendering? Can this method also be used for Rebol3 on the Raspberry Pi?
My OpenGL binding for Red/System would be the starting point:
http://red.esperconsultancy.nl/Red-OpenGL
I'm currently working on extending it for the Raspberry Pi. The current binding is for desktop OpenGL. For Raspberry Pi and other small platforms, I'm working on an OpenGL-ES binding. Further, OpenGL needs an environment on the target platform. The binding has several backends, such as SDL, but these don't work on the Raspberry Pi as it uses EGL in combination with its own environment as defined by Broadcom. I'm also working on extra backends for those.
Bindings for Red, including this one when Raspberry Pi support is finished, can be used to base REBOL 3 extensions on, with my Red/REBOL 3 bridge:
http://red.esperconsultancy.nl/Red-REBOL-3
However, writing such an extension is an extra effort.
The site in the answer by Kaj de Vos is no longer works.
You may find its mirror useful:
https://github.com/red/RS-fossil-mirror
Or the red/code repository:
https://github.com/red/code/tree/master/Library/OpenGL

OpenGL ES 2.0 software library

I have an application written on embedded device which is running on OpenGL ES 2.0. I want to debug issues with the application using PC . Currently My PC is running Ubuntu 11.04 and it doesnt have any Graphics card.
For the purpose of debugging , I want to have any software based OpenGL ES2.0 libraries. Is there any such libraries preset? If so can any one provide me a link?
Thanks
You have emulator from ARM AMD and Imagination Technologies to run opengl es 2.0 on windows/ubuntu.
I suggest going with Imagination technologies one.
here is the link http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp

QtOpenGL and MacOS X -- Software rendering?

I'm developing a cross-platform application and am not very familiar with the Mac platform. I use Qt for the GUI. I use a QGLWidget to make sure the drawing (with QPainter) is done in OpenGL.
My project built fine in XCode and runs. However, drawing is slow as hell, in situations where on Windows and Linux machines speed is not an issue. The Macbook has an Nvidia GPU, whereas the Windows machine has only onboard intel graphics.
When I look at the binary, it seems that while linking to QtOpenGL lib, it does not explicitely link to the GL lib itself.
How can I test if hardware acceleration is working or software fallback rendering is doing the job?
Shouldn't my binary link to the GL lib, or is this hidden as being a recursive dependency?
The best way to see what OpenGL implementation is using is to print the value of glGetString(GL_VENDOR) and glGetString(GL_RENDERER), this should help pinpoint the problem.

Easiest way to run a simple GLES/EGL/OpenVG app on a PC?

I thought this should be easy, but... geesh! A vendor gave me a fairly simple demo program meant to showcase some trivial icon animations. The target platform is an embedded system (MX51) with accelerated OpenGL ES 2.0/OpenVG and EGL support.
Unfortunately, the demo also has an annoying dependency on a few Qt utility classes (e.g., QImage). If not for this dependency, I would compile/run the thing on the target. But I don't relish the thought of cross-compiling Qt just to run this little demo---even if there were enough room for it on the embedded board.
I hoped I might be able to run the app on a standard(ish) Ubuntu 10.04 VM, and started following these directions to make it happen. And I actually managed---like, 10 hours later---to compile everything and get a runnable binary of the demo program. However, when I run it, I see the following error:
eglCreateWindowSurface: egl error "EGL_BAD_CONFIG" (0x3005)
Sigh. Not what I wanted to see after all that effort. This seems way more difficult than it should be.
Is the embedded GL landscape really such a ghetto that I have to run even trivial programs on the target using some vendor-supplied BSP? Judging from the lack of responses to this guy's question, I'm thinking the answer might be yes. But I don't even care about acceleration (yet). I just want to run the stupidest of OpenGL ES 2/OpenVG programs on a desktop PC and get an idea of how it looks. (It doesn't matter to me whether the PC is running Linux or Windows.) How do people do this sort of thing?
There are several OpenGL ES 2.0 emulators, such as:
For ARM Mali GPUs
For PowerVR GPUs
Also very recently, AMD has posted drivers that expose OpenGL ES 2.0 on desktop.
More recently, OpenGL 4.1 exposes the GL_ARB_ES2_compatibility extension, which makes OpenGL 4.1 drivers GL ES 2.0 compatible.
For OpenVG, you can use AmanithVG GLE.
Qualcomm's OpenGL ES emulator includes OpenVG support. You can download it from http://developer.qualcomm.com

Resources