Hi
I am a beginner inOpenGL ES 2.0,and get a problem,
After decompress Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0.9310_Linux.tar.gz
and install Sourcery CodeBench Lite Edition for ARM (arm-2013.05-24-arm-none-linux-gnueabi.bin),
build the sample (Cube)
bash build-x86-linux.sh Cube succeed
cd build/x86/Cube
ls
assets Cube
./Cube
Error: eglGetError() = 12291 (0x00003003) at /home/pass2014/Software/Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0/samples/linux/Cube/Cube.cpp:177
code
int main(void)
{
/* Intialize the Platform object for platform specific functions. */
Platform* platform = Platform::getInstance();
/* Initialize windowing system. */
platform->createWindow(WINDOW_W, WINDOW_H);
/* Initialize EGL. */
EGLRuntime::initializeEGL(EGLRuntime::OPENGLES2);
EGL_CHECK(eglMakeCurrent(EGLRuntime::display, EGLRuntime::surface, EGLRuntime::surface, EGLRuntime::context)); //line 177
/* Initialize OpenGL ES graphics subsystem. */
setupGraphics(WINDOW_W, WINDOW_H);
/* Timer variable to calculate FPS. */
Timer fpsTimer;
fpsTimer.reset();
bool end = false;
/* The rendering loop to draw the scene. */
while(!end)
/* If something has happened to the window, end the sample. */
if(platform->checkWindow() != Platform::WINDOW_IDLE)
end = true;
}
/* Calculate FPS. */
float fFPS = fpsTimer.getFPS();
if(fpsTimer.isTimePassed(1.0f))
LOGI("FPS:\t%.1f\n", fFPS);
/* Render a single frame */
renderFrame();
/*
* Push the EGL surface color buffer to the native window.
* Causes the rendered graphics to be displayed on screen.
*/
eglSwapBuffers(EGLRuntime::display, EGLRuntime::surface);
/* Shut down OpenGL ES. */
/* Shut down Text. */
delete text;
/* Shut down EGL. */
EGLRuntime::terminateEGL();
/* Shut down windowing system. */
platform->destroyWindow();
/* Shut down the Platform object. */
delete platform;
return 0;
What should I do to fix the problem?
Thanks
Hi mofeng,
Thanks for feeding back, can you let us know what the GLES environment you are using is?
Hi Chris,
I use Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0.9310_Linux.tar on Lubuntu, and Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0.9310_Win32.exe on win7,configure GLES 2.0 environment in linux just as Mali OpenGL ES 2.0 SDK for Linux on ARM User Guide.pdf,and install some libraries, correct bash,configure DASH.And then I can run samples for linux on Lubuntu,but I failed to run samples for arm on pcDuino V2,I dont know why,
mofeng
Can you let us know the output of "ldd <sdkbinary>" on the pcDuino? It's possible it doesn't have the Mali drivers or maybe mesa was installed and that has overridden them?
Thanks,
Chris
I know this is an old thread but I'm having the exact problem. I just added a print for the error, and its coming out with 12291 (0x3003). The major and minor versions are coming out zero.
I'm using a cubieboard2 running cubieez 1.0, and that is supposed to have opengles support although I don't know how to verify that.
My "Hello_Triangle" is working but another test case I want to run, the opengles version of glxgears isn't.
My program is called "test". The outout of ldd test is:
cubie@cubieboard2:~/Projects/Tests/TestMali$ ldd test
libEGL.so => /usr/lib/mali/libEGL.so (0xb6dfb000)
libdri2.so.1 => /usr/local/lib/libdri2.so.1 (0xb6df0000)
libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6cfb000)
libXfixes.so.3 => /usr/lib/arm-linux-gnueabihf/libXfixes.so.3 (0xb6cef000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6c38000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6bc4000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6b9a000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6aac000)
libUMP.so.3 => /usr/lib/libUMP.so.3 (0xb6a97000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6a74000)
libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0xb6a5b000)
libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6a48000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6a35000)
/lib/ld-linux-armhf.so.3 (0xb6f86000)
libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb6a10000)
libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6a06000)
libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb69fb000)
cubie@cubieboard2:~/Projects/Tests/TestMali$ uname -a
Linux cubieboard2 3.4.79 #1 SMP PREEMPT Thu Nov 6 18:00:18 CST 2014 armv7l GNU/Linux
In my Hello_Triangle program (which is working) I added a print of the Major and Minor values: 1 and 4.
Anything jump out at you in the ldd output?
I'm going try bringing the gear drawing into a Hello_Triangle like wrapper to see where I get with that.
Chris Arena
The only thing that jumps out from the ldd output is that it doesn't link against libGLES, so I'd be surprised indeed if you got any rendering to work.... I guess at this point your Hello_Triangle app is just calling egl functions and not gles ones? Does /usr/lib/mali contain anything other than libEGL.so? What is the ldd output for glxgears?
Hth,
Chris,
Hi Chris,
1、 I also got the problem , when i run the demo of the "Mali OpenGL ES SDK for Linux on ARM v2.0.0"in a framebuffer device ( Allwiner A20 soc)
# ./Cube
Error: eglGetError(): 12291 (0x3003)
Error: Failed to initialize EGL at : \Mali OpenGL ES SDK for Linux on ARM v2.0.0\simple-framework\src\EGLRuntime.cpp:115
2、The code
success = eglInitialize(display, NULL, NULL);
if(success != EGL_TRUE)
EGLint error = eglGetError();
LOGE("eglGetError(): %i (0x%.4x)\n", (int)error, (int)error);
LOGE("Failed to initialize EGL at %s:%i\n", __FILE__, __LINE__);
exit(1);
3、ldd output
# ldd Cube
libGLESv2.so => /lib/libGLESv2.so (0xb6f6a000)
libEGL.so => /lib/libEGL.so (0xb6f4a000)
libMali.so => /lib/libMali.so (0xb6eae000)
libUMP.so => /lib/libUMP.so (0xb6ea0000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6dc9000)
libm.so.6 => /lib/libm.so.6 (0xb6d24000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6d11000)
libc.so.6 => /lib/libc.so.6 (0xb6bca000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb6baa000)
libdl.so.2 => /lib/libdl.so.2 (0xb6b9d000)
/lib/ld-linux.so.3 (0xb6fa0000)
Any advice?
Thanks ,
Hi jackfeng,
Is it possible you're trying to run a version compiled for x11 on fbdev? whats the return code from eglGetDisplay?
1、It seems that it runs the branch of "Linux on ARM"
#if defined(_WIN32)
/* Win32 */
display = eglGetDisplay(platform->deviceContext);
#elif defined(__arm__)
/* Linux on ARM */
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
printf("ARM eglGetDisplay(): %i (0x%.4x)\n", (int)display, (int)display);
#else
/* Desktop Linux */
platform->display = XOpenDisplay(NULL);
display = eglGetDisplay(platform->display);
#endif
2、 The return code from eglGetDisplay is "1"
# ./cube
ARM eglGetDisplay(): 1 (0x0001)
3、The code
void EGLRuntime::initializeEGL(OpenGLESVersion requestedAPIVersion)
EGLBoolean success = EGL_FALSE;
if(display == EGL_NO_DISPLAY)
LOGE("No EGL Display available at %s:%i\n", __FILE__, __LINE__);
The latest SDK release is version 2.4.4, I'd recommend updating to that just in case it's an SDK issue which has been fixed in recent versions. Or is there a reason you're using an old version?
Also, how did you come by the kernel/userspace drivers for your board, were they supplied by the vendor specifically for use with the board and kernel you are using, or have you grabbed them from elsewhere?
Hi Chris ,
I have updated the SDK to v2.4.4 , and got the same result when i ran the sample.
Could you please tell me the different usage between the mali kernel and userspace drivers in detail?
The mali and ump kernel driver include in the BSP supplied by the Allwiner.but i have no idea about the userspace drivers,seems it could be fetched from the link below:
http://linux-sunxi.org/Mali_binary_driver
Generally speaking, it is highly advised to use a matching driver version for both the User side and Kernel side Mali driver. This ensures maximum compatibility.
Ideally also you should obtain both components from the same source, the OEM or Silicon manufacturer, as they may have modified either/both parts to include further optimisations or features that the vanilla driver that we provide may not have.
It is also worth mentioning that the kernel side is GPL and you should be entitled access to this. We provide the vanilla code on our website: Open Source Mali Midgard GPU Kernel Drivers - Mali Developer Center and Open Source Mali Utgard GPU Linux Kernel Drivers - Mali Developer Center depending on your Mali architecture. You should also be allowed access to the integrated/modified version from your OEM/Silicon Manufacturer.
However the user side driver is proprietary so you will need to get a binary version from 'somewhere'. As I mentioned above, for best results, you should get this from the OEM. We do provide a vanilla version on our website but it is device dependent and we do not have any Allwinner versions up. (For reference, ARM Mali Midgard GPU User Space Drivers - Mali Developer Center and ARM Mali Utgard GPU series User Space Drivers )
I hope that helps explain the situation a little better.
Kind Regards,
Michael McGeagh
Hi mcgeagh,
It is appreciated for your detailed explanation. I am going to apply for the drivers from my distributor of the board .