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 .
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.
Chris