Imagination PowerVR SDK Blog

Cross compiled OpenGLESHelloAPI example program is not running on target board

I am working on RcarH3.
OpenGl source code(https://github.com/powervr-graphics/Native_SDK) Crosscompiled using below cmake command:
cmake -DWS=NullWS -DCMAKE_TOOLCHAIN_FILE=/home/aiiec/opengl/Native_SDK-master/cmake/toolchains/Linux-gcc-armv8.cmake …/

I copied the cross compiled OpenGLESHelloAPI excutable to the board and tried to run it, but I got this error:

Host library ‘libEGL.so’ loadedEGL Bindings: Successfully loaded library libEGL.[ 9374.147340] audit: type=1701 audit(1535966883.396:8): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=3992 comm="OpenGLES1
so
Failed to load function [eglCreateSync] from library ‘libEGL.so’.
Failed to load function [eglDestroySync] from library ‘libEGL.so’.
Failed to load function [eglClientWaitSync] from library ‘libEGL.so’.
Failed to load function [eglGetSyncAttrib] from library ‘libEGL.so’.
Failed to load function [eglCreateImage] from library ‘libEGL.so’.
Failed to load function [eglDestroyImage] from library ‘libEGL.so’.
Failed to load function [eglGetPlatformDisplay] from library ‘libEGL.so’.
Failed to load function [eglCreatePlatformWindowSurface] from library ‘libEGL.so’.
Failed to load function [eglCreatePlatformPixmapSurface] from library ‘libEGL.so’.
Failed to load function [eglWaitSync] from library ‘libEGL.so’.
Segmentation fault (core dumped)

Please help me to resolve the above issue.
Thanks

Hi Raj,

You can ignore the messages “Failed to load function”. It is only checking from EGL 1.5 capabilities. The real problem here is that you are getting a segmentation fault. Could be possible to send us a full backtrace? If you do not want to do it in a public forum, you can contact us at: https://pvrsupport.imgtec.com/

Regards.

Carlos.

Hi Carlos,

Thank you for your help.

Below is the backtrace of OpenGLESHelloAPI application

Reading symbols from OpenGLESHelloAPI…done.
(gdb) b main
Breakpoint 1 at 0x404af8
(gdb) r
Starting program: /home/opengl/OpenGLESHelloAPI

Breakpoint 1, 0x0000000000404af8 in main ()
(gdb) n
Single stepping until exit from function main,
which has no line number information.
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/libthread_db.so.1”.
Host library ‘libEGL.so’ loadedEGL Bindings: Successfully loaded library libEGL.so
Failed to load function [eglCreateSync] from library ‘libEGL.so’.
Failed to load function [eglDestroySync] from library ‘libEGL.so’.
Failed to load function [eglClientWaitSync] from library ‘libEGL.so’.
Failed to load function [eglGetSyncAttrib] from library ‘libEGL.so’.
Failed to load function [eglCreateImage] from library ‘libEGL.so’.
Failed to load function [eglDestroyImage] from library ‘libEGL.so’.
Failed to load function [eglGetPlatformDisplay] from library ‘libEGL.so’.
Failed to load function [eglCreatePlatformWindowSurface] from library ‘libEGL.so’.
Failed to load function [eglCreatePlatformPixmapSurface] from library ‘libEGL.so’.
Failed to load function [eglWaitSync] from library ‘libEGL.so’.

Program received signal SIGSEGV, Segmentation fault.
0x0000ffffbef3a208 in ?? () from /usr/lib/libpvrWAYLAND_WSEGL.so
(gdb) backtrace
#0 0x0000ffffbef3a208 in ?? () from /usr/lib/libpvrWAYLAND_WSEGL.so
#1 0x0000000000449c70 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Hi Raj,

It looks like you’re using /usr/lib/libpvrWAYLAND_WSEGL.so but you’ve configured the example to use the NullWS window system (using -DWS=NullWS). Was it your intention to use libpvrWAYLAND_WSEGL.so? If so you’ll need to change your WS argument to “-DWS=Wayland”.
If you still have issues after making this change could you provide a backtrace when running a debug build (Use “-DCMAKE_BUILD_TYPE=Debug”) so we can see a little more of whats going on?

Thanks,
James

Thank you,James

My intention is to run openGLES example program on RcarH3 target board

Getting below cmake error

cmake -DWS=Wayland -DCMAKE_TOOLCHAIN_FILE=/home/aiiec/opengl/Native_SDK-master/cmake/toolchains/Linux-gcc-armv8.cmake …/
– Could NOT find WAYLAND_CLIENT (missing: WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR)
– Could NOT find WAYLAND_SERVER (missing: WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR)
– Could NOT find WAYLAND_EGL (missing: WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR)
– Could NOT find WAYLAND_CURSOR (missing: WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR)
– Could NOT find WAYLAND (missing: WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR)
Wayland libraries could not be found. Please try setting: -DCMAKE_PREFIX_PATH pointing towards your Wayland libraries
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
WAYLAND_CLIENT_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI
used as include directory in directory /home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI
used as include directory in directory /home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI
WAYLAND_EGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI
used as include directory in directory /home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI
used as include directory in directory /home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI

– Configuring incomplete, errors occurred!
See also “/home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI/build/CMakeFiles/CMakeOutput.log”.
See also “/home/aiiec/opengl/Native_SDK-master/examples/OpenGLES/01_HelloAPI/build/CMakeFiles/CMakeError.log”.

Thanks for giving that a go providing the log.
Right so it looks like we’ve been unable to find the wayland libraries and include directories for the given arch. As far as I can see you’ve got a driver using the wayland window system. I believe if you’re cross compiling for RcarH3 you should also be passing -DCMAKE_SYSROOT to point towards a sysroot which should contain the wayland libraries and header files for the given platform.

In Build Instructions they mentioned -DWS
“Can be used to control the windowing system used. Supported values: [NullWS, X11, Wayland, Screen]. Usually, desktop Linux systems will be running an X11/XCB or using a Wayland server. Development platforms often use a NullWS system which is where the GPU renders to the screen directly without using a windowing system. Screen is commonly used on QNX.”

What i understood is for target board we have to use NullWS,Is my understanding is correct?

if yes my source code is compiling with NullWS,But not running on target board.

-DWS can be used to control the windowing system used by the SDK examples but will have no affect on the window system used by the platform. The window system used by the driver and the window system used in the -DWS argument will need to be consistent.
From one of your earlier messages it appeared as if your platform was using a wayland driver (/usr/lib/libpvrWAYLAND_WSEGL.so was being used and appeared in your backtrace). You’ll need to confirm whether your driver is wayland or nullws. If your driver is indeed using the wayland window system then you’ll need to use -DWS=Wayland as I suggested and you’ll also need to use -DCMAKE_SYSROOT to point towards a sysroot which should contain the wayland libraries and header files for the given platform.

Thanks for your input.

i have compiled source code with wayland libraries

“cmake -DWS=Wayland -DCMAKE_SYSROOT=/home/aiiec/git/salvatorx/3.19.0/build/build/tmp/deploy/sdk/poky_toolchain/sysroots/aarch64-poky-linux/ -DCMAKE_TOOLCHAIN_FILE=/home/aiiec/opengl/Native_SDK-master/cmake/toolchains/Linux-gcc-armv8.cmake …”

Below is the backtrace of OpenGLESHelloAPI application

root@salvator-x:/home/opengl# gdb OpenGLESHelloAPI
GNU gdb (GDB) 8.0
Copyright © 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “aarch64-poky-linux”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from OpenGLESHelloAPI…done.
(gdb) b main
Breakpoint 1 at 0x4026bc
(gdb) r
Starting program: /home/opengl/OpenGLESHelloAPI
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/libthread_db.so.1”.

Breakpoint 1, 0x00000000004026bc in main ()
(gdb) n
Single stepping until exit from function main,
which has no line number information.
Host library ‘libEGL.so’ loadedEGL Bindings: Successfully loaded library libEGL.so
Failed to load function [eglCreateSync] from library ‘libEGL.so’.
Failed to load function [eglDestroySync] from library ‘libEGL.so’.
Failed to load function [eglClientWaitSync] from library ‘libEGL.so’.
Failed to load function [eglGetSyncAttrib] from library ‘libEGL.so’.
Failed to load function [eglCreateImage] from library ‘libEGL.so’.
Failed to load function [eglDestroyImage] from library ‘libEGL.so’.
Failed to load function [eglGetPlatformDisplay] from library ‘libEGL.so’.
Failed to load function [eglCreatePlatformWindowSurface] from library ‘libEGL.so’.
Failed to load function [eglCreatePlatformPixmapSurface] from library ‘libEGL.so’.
Failed to load function [eglWaitSync] from library ‘libEGL.so’.
Created wl egl window
Host library ‘libGLESv2.so’ loadedOpenGL ES Bindings: Successfully loaded library libGLESv2.so for OpenGL ES 2.0
[New Thread 0xffffbdf4f1d0 (LWP 3420)]
NOTE: This GSX library has the time limitation by reason of an evaluation module.
[Thread 0xffffbdf4f1d0 (LWP 3420) exited]

Thread 1 “OpenGLESHelloAP” received signal SIGSEGV, Segmentation fault.
0x0000ffffbf694e50 in wl_proxy_destroy () from /usr/lib/libwayland-client.so.0
(gdb) backtrace
#0 0x0000ffffbf694e50 in wl_proxy_destroy () from /usr/lib/libwayland-client.so.0
#1 0x0000000000403e28 in releaseWaylandConnection() ()
#2 0x0000000000402728 in main ()
(gdb)

Please refer attached output of the application

Expected output should be a triangle.

Glad to see you’ve managed to get OpenGLESHelloAPI building/running even if the output doesn’t appear quite right! Would you mind building/running OpenGLESIntroducingPVRUtils please? We’d like to get a better understanding of whether the main render surface is being rendered off the main display - as you can see the clear color appears to be rendered correctly. We may very well have some bugs in our wayland surface creation code in the SDK wrt. size and position of the window.

OpenGLESIntroducingPVRUtils application is not running on target

Below is backtrace
root@salvator-x:/home/opengl# gdb ./OpenGLESIntroducingPVRUtils
GNU gdb (GDB) 8.0
Copyright © 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “aarch64-poky-linux”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from ./OpenGLESIntroducingPVRUtils…done.
(gdb) b main
Breakpoint 1 at 0x41a4d8
(gdb) r
Starting program: /home/opengl/OpenGLESIntroducingPVRUtils
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/libthread_db.so.1”.

Breakpoint 1, 0x000000000041a4d8 in main ()
(gdb) n
Single stepping until exit from function main,
which has no line number information.
Exit message set to: InitApplication threw a runtime exception with message: ‘[GnomeToy.pod]: File not found - [pvr::shell::getAssetStream]’
InitApplication() failed with pvr error ‘Error while initializing’

InitApplication threw a runtime exception with message: ‘[GnomeToy.pod]: File not found - [pvr::shell::getAssetStream]’
__libc_start_main (main=0x0, argc=0, argv=0x0, init=, fini=, rtld_fini=, stack_end=) at /usr/src/debug/glibc/2.26-r0/git/csu/libc-start.c:342
342 exit (result);
(gdb) backtrace
#0 __libc_start_main (main=0x0, argc=0, argv=0x0, init=, fini=, rtld_fini=, stack_end=)
at /usr/src/debug/glibc/2.26-r0/git/csu/libc-start.c:342
#1 0x000000000041b5b0 in _start () at …/sysdeps/aarch64/start.S:83
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

James,

Now I am able to see the actual output of the OpenGLESHelloAPI application by connecting the mouse to target board and drag the output image.

Ah great, glad to hear that OpenGLESHelloAPI is running correctly. We’ll need to look into why the default position for the window is offscreen.
With regard to the issue you’re seeing when running OpenGLESIntroducingPVRUtils - what platform is this running on?
Do you have an “Assets_OpenGLESIntroducingPVRUtils” folder in the bin folder in which the binary was output?

I am running the applications on RcarH3(Yocto v3.19.0)
I have created ‘Assets_OpenGLESIntroducingPVRUtils’ folder in bin folder and copied the OpenGLESIntroducingPVRUtils application to it
I am getting the same error.

Can you change SDK/cmake/Functions.cmake line 82 from “if((UNIX OR QNX) AND NOT APPLE)” to “if((CMAKE_SYSTEM_NAME MATCHES “Linux” OR QNX) AND NOT APPLE)”. I would have assumed “UNIX” would have been defined for Yocto though.

I have changed the Functions.cmake file and generated executable files
But I am getting the same error.

Without the platform to hand its quite difficult to debug this problem. A few suggestions/thoughts:

  • Did you delete your cmake folder and do the cmake configuration and build again?
  • If you add a message inside the function add_rule_copy_assets_to_asset_folder outside and another inside the if statement do you see messages printed as expected?
  • After making the change do you get the Assets_{ExampleName} folder produced in the correct location?
  • If you create the Assets_{ExampleName} folder inside the bin directory and copy across the missing assets (i.e. GnomeToy.pod etc.) does it run correctly?

Thanks for your detailed inputs.

Assets_{ExampleName} folders generated with “if((UNIX OR QNX) AND NOT APPLE)” condition,
Copied all the files from “Assets_OpenGLESIntroducingPVRUtils” to bin folder, Application is running but i am not getting any output on display,please find the attached hardware timed out log.OpenGLESIntroducingPVRUtils_output_log.txt (15.0 KB)

Now OpenGLESIntroducingPVRUtils is running and i am able to see the expected output on my screen but after every poweron some portion of the output window is hidden so i have to connect mouse and drag the screen

I am working on surround view project,OpenGLESIntroducingPVRCamera application is not taking physical camera input

Could you please help me to get data from physical camera.

I’ve raised an issue internally for us to take a look at ensuring that the wayland window is properly positioned. If this is proving a big problem for you take a look at https://github.com/powervr-graphics/Native_SDK/blob/master/framework/PVRShell/OS/Wayland/ShellOS.cpp. It should be possible to position the window here. Feel free to raise a pull request if you end up fixing this before we do.
We currently only provide sample code for making use of the camera for android and ios platforms.

Please feel free to raise any issues you have with regard to the SDK on github https://github.com/powervr-graphics/Native_SDK/issues and we’ll take a look at them.

© Imagination Technologies Limited. All rights reserved.
Privacy PolicyTerms & ConditionsTrademarksCookies