Hello everybody! It's my first post here . (Hope I've posted in the correct section...)
I'm on Ubuntu 14.04 (64 bit), and I'm trying to use the Mali OpenGLES3 emulator version 1.4.0.
I already got the Mesa libs (libEGL.so and libGLESv2.so) installed on my system (via Synaptic) and they work as expected.
Because of that, I did NOT install the Mali libraries: instead, I downloaded the tgz package.
To be able to override the Mesa libraries, I've tried all the possible approaches (rpath,LD_LIBRARY_PATH and LD_PRELOAD),
and the only one that seemed to work was the LD_PRELOAD way through a script like the following (all the .so files are in the same folder as 'appCube'):
#!/bin/bash export MY_FOLDER=`dirname $0` export LD_PRELOAD=$MY_FOLDER/libMaliEmulator.so.1.4.0:$MY_FOLDER/libcompiler_manager.so:$MY_FOLDER/liblog4cplus.so.1.1.2:$MY_FOLDER/libEGL.so.1.4.0:$MY_FOLDER/libGLESv2.so.2.0.0:$LD_PRELOAD $MY_FOLDER/appCube
#!/bin/bash
export MY_FOLDER=`dirname $0`
export LD_PRELOAD=$MY_FOLDER/libMaliEmulator.so.1.4.0:$MY_FOLDER/libcompiler_manager.so:$MY_FOLDER/liblog4cplus.so.1.1.2:$MY_FOLDER/libEGL.so.1.4.0:$MY_FOLDER/libGLESv2.so.2.0.0:$LD_PRELOAD
$MY_FOLDER/appCube
The problem is that as an output I get these errors (and the program quits):
FATAL - EGL: (initialize 104) GLX returned Error base : a9, Event Base : 68 FATAL - EGL: GLX supports the following extensions: GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_swap_control_tear GLX_EXT_texture_from_pixmap GLX_EXT_buffer_age GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_NV_multisample_coverage GLX_ARB_get_proc_address FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glGetQueryObjecti64v' in 'libGL.so' (required for version of GL)! FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glFramebufferTexture2DMultisampleEXT' in 'libGL.so' (required for extension of GL)! FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glGetInternalformativ' in 'libGL.so' (required for extension of GL)! FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glQueryCounter' in 'libGL.so' (required for version of GL)! FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glGetQueryObjectui64v' in 'libGL.so' (required for version of GL)! GL renderer: [NULL] GL vendor:[NULL] GL version: [NULL] GL shading language version: [NULL] GL API Version: [0.0] FATAL - GLES: (configureDepthStencilAttachments 242) Will use GL_DEPTH_COMPONENT24 for system FBO's depth+stencil attachment FATAL - GLES: (configureColorAttachment 294) Using GL_RGB8 for color attachment FATAL - GLES: (recreateSystemFBO 1027) An invalid framebuffer object was created! FATAL - GLES: (init_context_data_from_within_active_context 105) Could not initialize system FBO! GL_VENDOR ARM Ltd (*) GL_VERSION OpenGL ES 2.0 (*) glGetError() = 1281 (0x00000501) at line 63
FATAL - EGL: (initialize 104) GLX returned Error base : a9, Event Base : 68
FATAL - EGL: GLX supports the following extensions: GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_swap_control_tear GLX_EXT_texture_from_pixmap GLX_EXT_buffer_age GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_NV_multisample_coverage GLX_ARB_get_proc_address
FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glGetQueryObjecti64v' in 'libGL.so' (required for version of GL)!
FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glFramebufferTexture2DMultisampleEXT' in 'libGL.so' (required for extension of GL)!
FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glGetInternalformativ' in 'libGL.so' (required for extension of GL)!
FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glQueryCounter' in 'libGL.so' (required for version of GL)!
FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glGetQueryObjectui64v' in 'libGL.so' (required for version of GL)!
GL renderer: [NULL]
GL vendor:[NULL]
GL version: [NULL]
GL shading language version: [NULL]
GL API Version: [0.0]
FATAL - GLES: (configureDepthStencilAttachments 242) Will use GL_DEPTH_COMPONENT24 for system FBO's depth+stencil attachment
FATAL - GLES: (configureColorAttachment 294) Using GL_RGB8 for color attachment
FATAL - GLES: (recreateSystemFBO 1027) An invalid framebuffer object was created!
FATAL - GLES: (init_context_data_from_within_active_context 105) Could not initialize system FBO!
GL_VENDOR ARM Ltd (*)
GL_VERSION OpenGL ES 2.0 (*)
glGetError() = 1281 (0x00000501) at line 63
(*) These output lines are cause by these two lines I've added to the code:
fprintf(stderr,"GL_VENDOR %s\n",(char*)glGetString(GL_VENDOR));
fprintf(stderr,"GL_VERSION %s\n",(char*)glGetString(GL_VERSION));
When I run the program without this script, I get the following output (and the program works as expected using the Mesa implementation):
libEGL warning: DRI2: failed to authenticate GL_VENDOR VMware, Inc. (*) GL_VERSION OpenGL ES 3.0 Mesa 10.1.3 (*) [Mesa seems to provide an ES 3.0 context whenever is supported...] XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0" after 298 requests (210 known processed) with 0 events remaining.
libEGL warning: DRI2: failed to authenticate
GL_VENDOR VMware, Inc. (*)
GL_VERSION OpenGL ES 3.0 Mesa 10.1.3 (*) [Mesa seems to provide an ES 3.0 context whenever is supported...]
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 298 requests (210 known processed) with 0 events remaining.
P.S. My graphic card is an (old) NVidia GT 120, and it's working with the default proprietary driver (331.38).
Maybe the Mali emulator does not support it (However it should support OpenGL 3.3.0).
P.S.2: When trying to force a OpenGLES3 context the output is similiar to the one posted above, with the additional line:
FATAL - GLES: (initializeGLFunctionProxy 689) At least one GL33 function is unavailable - potential crash ahead.
P.S.3: The Mali OpenGLES Emulator manual states that I should add to my script the line:
export MALI_EMULATOR_COMPILER_MANAGER_PATH=/MyFullPath/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/share/mali-compiler-manager/
However this does not seem to change the output in any way (even if I append libMali-T600_r4p0-00rel0.so to LD_PRELOAD).
Any help is welcome. Thank you in advance .
Hi lemontree,
If you follow Jacek's instructions above and still have trouble, can you let us know the output of ldd $MY_FOLDER/appCube?
Thanks,
Chris
Hi lemontree!
Welcome to ARM Community Forums.
Although it is recommended to run linux-install.sh to copy the libraries and set the environment variables, it is possible to set up the environment manually.
In order to run mali-cube you need to:
Also, make sure that libGL.so provided (in your case) by NVIDIA driver is in the system search path.
If not, then you can add it to LD_LIBRARY_PATH (assuming that the driver libraries are in /usr/lib/nvidia-331):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/MyFullPath/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/lib:/usr/lib/nvidia-331
Hope that helps,
Jacek
Well, first: thank you for your quick support !
@kubacki: As I've already written, the only way I managed to override the Mesa installed openGLES library was to use LD_PRELOAD. All the other ways I've tried (both rpath=$ORIGIN at link time and LD_LIBRARY_PATH for some odd reasons don't seem to be able to override the mesa libraries). As a result, using your suggestion, the program runs (with the same "Mesa output" I reported above.
@Chris Varnsverry: After exporting LD_LIBRARY_PATH (or after doing nothing):
ldd ./appCube linux-vdso.so.1 => (0x00007fff23dfe000) libEGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1 (0x00007fd92a3de000) libGLESv2.so.2 => /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2 (0x00007fd92a1d5000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fd929ea0000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd929b9a000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd9297d4000) libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fd9295d1000) libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007fd9293cc000) libxcb-xfixes.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fd9291c5000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fd928fa5000) libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fd928d98000) libwayland-server.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-server.so.0 (0x00007fd928b87000) libgbm.so.1 => /usr/lib/x86_64-linux-gnu/libgbm.so.1 (0x00007fd92897e000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd928760000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd92855c000) libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fd92834f000) libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007fd928128000) /lib64/ld-linux-x86-64.so.2 (0x00007fd92a64a000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fd927f23000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fd927d1d000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fd927b15000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd92790c000)
ldd ./appCube
linux-vdso.so.1 => (0x00007fff23dfe000)
libEGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1 (0x00007fd92a3de000)
libGLESv2.so.2 => /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2 (0x00007fd92a1d5000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fd929ea0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd929b9a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd9297d4000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fd9295d1000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007fd9293cc000)
libxcb-xfixes.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fd9291c5000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fd928fa5000)
libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fd928d98000)
libwayland-server.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-server.so.0 (0x00007fd928b87000)
libgbm.so.1 => /usr/lib/x86_64-linux-gnu/libgbm.so.1 (0x00007fd92897e000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd928760000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd92855c000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fd92834f000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007fd928128000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd92a64a000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fd927f23000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fd927d1d000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fd927b15000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd92790c000)
However when I use the LD_PRELOAD approach (and please remember that I copied all the .so files into the demo folder too) I get:
linux-vdso.so.1 => (0x00007fff062fd000) /home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libMaliEmulator.so.1.4.0 (0x00007f384b5f9000) /home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libcompiler_manager.so (0x00007f384b3f1000) /home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/liblog4cplus.so.1.1.2 (0x00007f384b182000) /home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libEGL.so.1.4.0 (0x00007f384af7e000) /home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libGLESv2.so.2.0.0 (0x00007f384ad67000) /home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libMali-T600_r4p0-00rel0.so (0x00007f384aa12000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f384a698000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f384a392000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3849fcb000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3849dc7000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3849ba9000) libGL.so.1 => /usr/lib/nvidia-331/libGL.so.1 (0x00007f3849875000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3849571000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f384935b000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3849152000) libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f3848f38000) /lib64/ld-linux-x86-64.so.2 (0x00007f384bd7f000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f3848d18000) libnvidia-tls.so.331.38 => /usr/lib/nvidia-331/tls/libnvidia-tls.so.331.38 (0x00007f3848b15000) libnvidia-glcore.so.331.38 => /usr/lib/nvidia-331/libnvidia-glcore.so.331.38 (0x00007f3846307000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f38460f4000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f3845ef0000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f3845ce9000)
/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libMaliEmulator.so.1.4.0 (0x00007f384b5f9000)
/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libcompiler_manager.so (0x00007f384b3f1000)
/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/liblog4cplus.so.1.1.2 (0x00007f384b182000)
/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libEGL.so.1.4.0 (0x00007f384af7e000)
/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libGLESv2.so.2.0.0 (0x00007f384ad67000)
/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit/examples/cube/libMali-T600_r4p0-00rel0.so (0x00007f384aa12000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f384a698000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f384a392000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3849fcb000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3849dc7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3849ba9000)
libGL.so.1 => /usr/lib/nvidia-331/libGL.so.1 (0x00007f3849875000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3849571000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f384935b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3849152000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f3848f38000)
/lib64/ld-linux-x86-64.so.2 (0x00007f384bd7f000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f3848d18000)
libnvidia-tls.so.331.38 => /usr/lib/nvidia-331/tls/libnvidia-tls.so.331.38 (0x00007f3848b15000)
libnvidia-glcore.so.331.38 => /usr/lib/nvidia-331/libnvidia-glcore.so.331.38 (0x00007f3846307000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f38460f4000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f3845ef0000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f3845ce9000)
The problem is that in the latter case the demo crashes ...
To narrow down the problem could you please try to run mali-cube supplied with Mali OpenGL ES Emulator using LD_PRELOAD approach?
If it doesn't work, then there is probably a problem with environment configuration and that's why appCube doesn't work.
If mali-cube works, then could you please let us know - if possible - what part of appCube is causing the crash (e.g. creating rendering context with eglCreateContext())
Cheers,
FATAL - EGL: (initialize 104) GLX returned Error base : a9, Event Base : 68 FATAL - EGL: GLX supports the following extensions: GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_swap_control_tear GLX_EXT_texture_from_pixmap GLX_EXT_buffer_age GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_NV_multisample_coverage GLX_ARB_get_proc_address FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glGetQueryObjecti64v' in 'libGL.so' (required for version of GL)! FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glFramebufferTexture2DMultisampleEXT' in 'libGL.so' (required for extension of GL)! FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glGetInternalformativ' in 'libGL.so' (required for extension of GL)! FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glQueryCounter' in 'libGL.so' (required for version of GL)! FATAL - GLES: (checkMissingVersions 824) Couldn't find symbol 'glGetQueryObjectui64v' in 'libGL.so' (required for version of GL)! FATAL - GLES: (initializeGLFunctionProxy 689) At least one GL33 function is unavailable - potential crash ahead. GL renderer: [NULL] GL vendor:[NULL] GL version: [NULL] GL shading language version: [NULL] GL API Version: [0.0] FATAL - GLES: (configureDepthStencilAttachments 242) Will use GL_DEPTH_COMPONENT24 for system FBO's depth+stencil attachment FATAL - GLES: (configureColorAttachment 294) Using GL_RGB8 for color attachment FATAL - GLES: (recreateSystemFBO 1027) An invalid framebuffer object was created! FATAL - GLES: (init_context_data_from_within_active_context 105) Could not initialize system FBO! Running: Mali OpenGL ES Emulator 1.4.0 glGetError() = 1281 (0x00000501) at line 27 of shader.cpp
Running: Mali OpenGL ES Emulator 1.4.0
glGetError() = 1281 (0x00000501) at line 27 of shader.cpp
This was the output that I got by:
1) copying mali-cube into a folder
2) copying all the content of the mali emulator's lib subfolder in the same folder
3) copying libMali-T600_r4p0-00rel0.so in the same folder
4) running from the command line the following script:
#!/bin/bash export MY_BASE_FOLDER=/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit export MY_FOLDER=$MY_BASE_FOLDER/examples/cube export LD_PRELOAD=$MY_FOLDER/libMaliEmulator.so.1.4.0:$MY_FOLDER/libcompiler_manager.so:$MY_FOLDER/liblog4cplus.so.1.1.2:$MY_FOLDER/libEGL.so.1.4.0:$MY_FOLDER/libGLESv2.so.2.0.0:$MY_FOLDER/libMali-T600_r4p0-00rel0.so:$LD_PRELOAD export MALI_EMULATOR_COMPILER_MANAGER_PATH=$MY_FOLDER $MY_FOLDER/mali-cube echo Press any key to quit. read key
export MY_BASE_FOLDER=/home/guido/Desktop/Libraries/OpenGLES/Mali/Mali_OpenGL_ES_Emulator-1.4.0-Linux-64bit
export MY_FOLDER=$MY_BASE_FOLDER/examples/cube
export LD_PRELOAD=$MY_FOLDER/libMaliEmulator.so.1.4.0:$MY_FOLDER/libcompiler_manager.so:$MY_FOLDER/liblog4cplus.so.1.1.2:$MY_FOLDER/libEGL.so.1.4.0:$MY_FOLDER/libGLESv2.so.2.0.0:$MY_FOLDER/libMali-T600_r4p0-00rel0.so:$LD_PRELOAD
export MALI_EMULATOR_COMPILER_MANAGER_PATH=$MY_FOLDER
$MY_FOLDER/mali-cube
echo Press any key to quit.
read key
(BTW: I believe that my "appCube" is the same program as "mali-cube" (its source code was included in a previous version of the Mali emulator, as far as I can remember).
So the difference seems to be that before I had:
and now:
I don't have the source of "shader.cpp", I just got a "shader.c" (and line 27 is not a gl call).
However I get your point: it could be that that's some wrong environment configuration.
It should be much easier to install the library to fix it, or just go ahead with the Mesa libraries (it's not a personal preference, it's just that installing them directly via Synaptic from the default Ubuntu repositories is simpler).
Thank you anyway
No worries! Let us know if you have any other issues with Mali OpenGL ES 3.0 Emulator.
BTW: Did you know that new version (1.4.1) has been released? You can download it from OpenGL ES 3.0 Emulator - Mali Developer Center Mali Developer Center.
And one more hint - environment variable MALI_EMULATOR_COMPILER_MANAGER_PATH should point to the directory that contains openglessl directory with Mali-T600_r4p0-00rel0.so (see User Guide).In your case - if MALI_EMULATOR_COMPILER_MANAGER_PATH=$MY_FOLDER then in $MY_FOLDER you should have openglessl directory and copy Mali-T600_r4p0-00rel0.so there.
It may solve "glGetError() = 1281 (0x00000501) at line 27 of shader.cpp" issue.
My last post here. I give up .
Just to tell that I've tried the 1.4.1 version without success. Here is my experience:
After unpacking the tgz package, if I launch the program without setting any environment variable, I get:
./mali-cube: error while loading shared libraries: libMaliEmulator.so.1: cannot open shared object file: No such file or directory
That's fine.
Then I add:
export MALI_EMULATOR_COMPILER_MANAGER_PATH=$MY_BASE_FOLDER/share/mali-compiler-manager
(MY_BASE_FOLDER is the folder where I extracted the tgz package)
From now on, if I set (assuming that I use: export MY_LIB_FOLDER=$MY_BASE_FOLDER/lib):
export LD_PRELOAD=$MY_LIB_FOLDER/libGLESv2.so:$MY_LIB_FOLDER/libMaliEmulator.so:$MY_LIB_FOLDER/liblog4cplus.so:$MY_LIB_FOLDER/libcompiler_manager.so:$MY_LIB_FOLDER/libEGL.so:$LD_PRELOAD
Or alternatively (and much concisely):
export LD_LIBRARY_PATH=$MY_LIB_FOLDER:$LD_LIBRARY_PATH
Well, I get the same errors as before (ending again with: glGetError() = 1281 (0x00000501) at line 27 of shader.cpp)
The funny thing is that if I just set:
export LD_PRELOAD=$MY_LIB_FOLDER/libMaliEmulator.so:$MY_LIB_FOLDER/liblog4cplus.so:$MY_LIB_FOLDER/libcompiler_manager.so:$LD_PRELOAD
(without adding the Mali libEGL.so and libGLESv2.so) then the program runs fine using the Mesa libraries.
That means that LD_PRELOAD manages somehow to provide linkage to "libMaliEmulator.so.1" and related libraries.
It's probably the Mali "libEGL.so" that is causing problems (FATAL - EGL: (initialize 104) GLX returned Error base : a9, Event Base : 68).
Maybe it's something wrong with my card (it can be), but I wonder when the program needs "libMali-T600_r4p0-00rel0.so": that library does not appear in "ldd mali-cube" outputs as far as I remember, and if I don't export MALI_EMULATOR_COMPILER_MANAGER_PATH, nothing seems to change (I've tried preloading it, but that is not working if ldd doesn't list it, I suppose).
However, as I've said at the beginning, I'm giving up.
Still, thank you again for all your time, support and patience!
Hello lemontree,
From the description you've sent it looks like NVIDIA's GL driver library is not properly loaded by the emulator.
After downloading and unpacking the .tgz, you should be able to execute included mali-cube binary from within unpacked emulator directory with this command:
MALI_EMULATOR_COMPILER_MANAGER_PATH=./share/mali-compiler-manager/ LD_LIBRARY_PATH=/usr/lib/nvidia-331:./lib ./bin/mali-cube
The indication that your intended GL driver is properly picked by the emulator is the following output to the console:
GL renderer: [NVS 300/PCIe/SSE2] GL vendor:[NVIDIA Corporation] GL version: [3.3.0 NVIDIA 331.20] GL shading language version: [3.30 NVIDIA via Cg compiler] GL API Version: [3.3]
Any NULLs reported there indicate that no libGL.so is dlopen'ed properly.
I'll be happy knowing you don't give up (well, at least not yet) and let us know whether you can get these strings reported by using one-liner provided as above.
Hey! That seems to work !
I get the following output (typying the command line from the base emulator directory, not from its "bin" subfolder):
$-> MALI_EMULATOR_COMPILER_MANAGER_PATH=./share/mali-compiler-manager/ LD_LIBRARY_PATH=/usr/lib/nvidia-331:./lib ./bin/mali-cube FATAL - EGL: (initialize 104) GLX returned Error base : a9, Event Base : 68 FATAL - EGL: GLX supports the following extensions: GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_swap_control_tear GLX_EXT_texture_from_pixmap GLX_EXT_buffer_age GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_NV_multisample_coverage GLX_ARB_get_proc_address FATAL - GLES: (checkMissingExtensions 836) Couldn't find symbol 'glFramebufferTexture2DMultisampleEXT' in 'libGL.so' (required for extension of GL)! GL renderer: [GeForce GT 120/PCIe/SSE2] GL vendor:[NVIDIA Corporation] GL version: [3.3.0 NVIDIA 331.38] GL shading language version: [3.30 NVIDIA via Cg compiler] GL API Version: [3.3] FATAL - GLES: (configureDepthStencilAttachments 248) Will use GL_DEPTH_COMPONENT24 for system FBO's depth+stencil attachment FATAL - GLES: (configureColorAttachment 300) Using GL_RGB8 for color attachment Running: Mali OpenGL ES Emulator 1.4.1
$-> MALI_EMULATOR_COMPILER_MANAGER_PATH=./share/mali-compiler-manager/ LD_LIBRARY_PATH=/usr/lib/nvidia-331:./lib ./bin/mali-cube
GL renderer: [GeForce GT 120/PCIe/SSE2]
GL vendor:[NVIDIA Corporation]
GL version: [3.3.0 NVIDIA 331.38]
GL shading language version: [3.30 NVIDIA via Cg compiler]
GL API Version: [3.3]
FATAL - GLES: (configureDepthStencilAttachments 248) Will use GL_DEPTH_COMPONENT24 for system FBO's depth+stencil attachment
FATAL - GLES: (configureColorAttachment 300) Using GL_RGB8 for color attachment
Running: Mali OpenGL ES Emulator 1.4.1
I can tell it works because otherwise the last line should have been:
Running: Gallium 0.4 on llvmpipe (LLVM 3.4, 128 bits)
that (for some odd reasons ), means that the Mesa implementation is running.
So in short: my scripts were not working because I had to set the full path of my libGL.so explicitely in:
export LD_LIBRARY_PATH=/usr/lib/nvidia-331:$MY_LIB_FOLDER:$LD_LIBRARY_PATH
I tested a "LD_LIBRARY_PATH script" with line above and it works !
So I'm happy now... the only thing that still puzzles me a bit is that if I use the "LD_PRELOAD version" adding libGL.so like this:
export LD_PRELOAD=/usr/lib/nvidia-331/libGL.so:$MY_LIB_FOLDER/libGLESv2.so:$MY_LIB_FOLDER/libMaliEmulator.so:$MY_LIB_FOLDER/liblog4cplus.so:$MY_LIB_FOLDER/libcompiler_manager.so:$MY_LIB_FOLDER/libEGL.so:$LD_PRELOAD
the demo still runs but,... surprise with the line:
[...] GL renderer: [NULL] GL vendor:[NULL] GL version: [NULL] GL shading language version: [NULL] GL API Version: [0.0] [...] Running: GeForce GT 120/PCIe/SSE2
[...]
Running: GeForce GT 120/PCIe/SSE2
What GLES implementation is this ? Isn't it just a GL renderer ?
PS. on a closer look all the NULLs probably mean that something wrong is happaning here...
Adding libGL.so to your LD_PRELOAD var (at least before libGLESv2.so) is probably going to break things as I imagine your application will find the libGL implementation of the bulk of the GL calls and will call them directly rather than through the emulator, which the "Running" line above seems to prove. LD_PRELOAD is pretty dangerous in this respect and I would recommend against its use, it is much simpler to guarantee the correct linkage by using the LD_LIBRARY_PATH mechanism. Glad to hear you got it working with the one liner.