Creating The SGX Driver For Ubuntu 14.04

Robert,

The instructions in the last post did the trick with loading the driver (omaplfb), thanks :slight_smile: However I have no clear way of telling if hardware rendering is being used. Running glxinfo reveals SGI once again :frowning: Is there an alternative CLI tool around that can provide details about the video driver that is used?

Robert,

The instructions in the last post did the trick with loading the driver (omaplfb), thanks :slight_smile: However I have no clear way of telling if hardware rendering is being used. Running glxinfo reveals SGI once again :frowning: Is there an alternative CLI tool around that can provide details about the video driver that is used?

That’s as far as I got… What you have now is all that John needed to run qt 5.1 in ews? mode. I also think it’s enough for Wayland egl mode, but don’t have much to show for that yet either. So, that’s as far as we got.

Ran glxgears and the tool reported an average of 32 FPS which is average. Before loading the driver the average was 28 FPS. CPU load is still around 100%, something seems a bit off…

Strange that the sample JavaFX 8 program still doesn’t work even though it requires EGL 2.0 support from the video driver. Still getting the same errors like the following for example:

ant -f /home/a_user/NetBeans_Projects/JavaFX_Test -Dremote.platform.rp.target=linuxarmvfphflt-15 -Dremote.platform.password=***** -Dremote.platform.rp.filename=linuxarmvfphflt -Dremote.platform.java.spec.ver=18 run-remote
init:
Deleting: /home/a_user/NetBeans_Projects/JavaFX_Test/build/built-jar.properties
deps-jar:
Updating property file: /home/a_user/NetBeans_Projects/JavaFX_Test/build/built-jar.properties
compile:
Detected JavaFX Ant API version 1.3
jfx-deployment:
jar:
Connecting to xxx.xxx.xxx.xxx:22
cmd : mkdir -p '/home/ubuntu/NetBeans_Projects/JavaFX_Test/dist’
Connecting to xxx.xxx.xxx.xxx:22
done.
profile-rp-calibrate-passwd:
Connecting to xxx.xxx.xxx.xxx:22
cmd : cd ‘/home/ubuntu/NetBeans_Projects/JavaFX_Test’; ‘/home/ubuntu/ejre-1.8.0_fx/bin/java’ -Dfile.encoding=UTF-8 -jar /home/ubuntu/NetBeans_Projects/JavaFX_Test/dist/JavaFX_Test.jar
libEGL warning: DRI2: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
libEGL warning: GLX: failed to load GLX
eglInitialize failed!
Graphics Device initialization failed for : es2
Error initializing QuantumRenderer: no suitable pipeline found

Well, the demos: /opt/gfxsdkdemos/ogles2/

work:

https://plus.google.com/106813818225399872098/posts/ZC9TEYjJNfP

Regards,

Tried running one of the demos remotely (via SSH) and ended up with error messages being spitted out (aka crash ‘n’ burn) like the following:

Ran a different demo locally and had different error messages appearing like the following:

Tried running one of the demos remotely (via SSH) and ended up with error
messages being spitted out (aka crash 'n' burn) like the following:

===========================================================
ubuntu@arm:/opt/gfxsdkdemos/ogles2$ ./OGLES2MagicLantern
Can't open keypad input device (/dev/input/event0)
libEGL warning: DRI2: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
libEGL warning: GLX: failed to load GLX
Exit message has been set to: "PVRShell: Unable to initialise EGL
".
PVRShell: EGL Error (EGL_NOT_INITIALIZED)
InitAPI failed!
PVRShell: Unable to initialise EGL

This happens when the mesa libegl.so get's installed..

Fixup with:

sudo cp -v /usr/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so
sudo cp -v /usr/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so

===========================================================

Very similar error messages when trying to run the sample JavaFX 8 program
remotely (via SSH). Robert can you please confirm if you can run one of the
SGX demos (eg Magic Lantern) successfully, and post the results from running
the fbset -i and es2_info commands (locally).

Regards,

Did install the mesa-dev type packages including mesa-dev-extra, which has the OpenGL ES 2.0 utilities (eg es2_info, es2gears).

Updated the OpenGL ES libraries so that the SGX ones are used. Ran the Magic Lantern demo again locally and ended up with different error messages appearing like the following:

Did install the mesa-dev type packages including mesa-dev-extra, which has the OpenGL ES 2.0 utilities (eg es2_info, es2gears).

Here is what I do to run QT5.1.1 on V3.12

/etc/init.d/335x-demo
reboot
insmod /lib/modules/3.12.5-bone10.4/extra/pvrsrvkm.ko
insmod /lib/modules/3.12.5-bone10.4/extra/omaplfb.ko
/etc/init.d/rc.pvr start
/opt/gfxsdkdemos/ogles2/OGLES2ChameleonMan

The demo works fine.

Regards,
John

Both omaplfb and pvrsrvkm modules are already loaded. Also the rc.pvr daemon is automatically started during boot. Where is 335x-demo on Ubuntu 14.04?

Both omaplfb and pvrsrvkm modules are already loaded. Also the rc.pvr daemon is automatically started during boot. Where is 335x-demo on Ubuntu 14.04?

I have attached a copy. It may not be suitable for your system so you may have to make modifications.

Regards,
John

335x-demo (611 Bytes)

Both omaplfb and pvrsrvkm modules are already loaded. Also the rc.pvr daemon is automatically started during boot. Where is 335x-demo on Ubuntu 14.04?

I suspect that Robert’s installer would have already done this setup, but if this is any help, this is what it does:

oot@arm:~# /etc/init.d/335x-demo
0x10205
release8.x
installing 8.x SGX release user libraries

Installing PowerVR Consumer/Embedded DDK ‘sgxddk_1.10@2359475’ on target

File system installation root is /

Uninstalling existing version sgxddk_1.10@2359475
Uninstallation completed.
boot script rc.pvr → /etc/init.d/rc.pvr
kernel module pvrsrvkm.ko → /lib/modules/3.12.5-bone10.4/extra/pvrsrvkm.ko
kernel module omaplfb.ko → /lib/modules/3.12.5-bone10.4/extra/omaplfb.ko
shared library libGLES_CM.so → /usr/lib/libGLES_CM.so.1.10.2359475
shared library libusc.so → /usr/lib/libusc.so.1.10.2359475
shared library libGLESv2.so → /usr/lib/libGLESv2.so.1.10.2359475
shared library libglslcompiler.so → /usr/lib/libglslcompiler.so.1.10.2359475
shared library libIMGegl.so → /usr/lib/libIMGegl.so.1.10.2359475
shared library libEGL.so → /usr/lib/libEGL.so.1.10.2359475
shared library libpvr2d.so → /usr/lib/libpvr2d.so.1.10.2359475
shared library libpvrPVR2D_BLITWSEGL.so → /usr/lib/libpvrPVR2D_BLITWSEGL.so.1.10.2359475
shared library libpvrPVR2D_FLIPWSEGL.so → /usr/lib/libpvrPVR2D_FLIPWSEGL.so.1.10.2359475
shared library libpvrPVR2D_FRONTWSEGL.so → /usr/lib/libpvrPVR2D_FRONTWSEGL.so.1.10.2359475
shared library libpvrPVR2D_LINUXFBWSEGL.so → /usr/lib/libpvrPVR2D_LINUXFBWSEGL.so.1.10.2359475
shared library libsrv_um.so → /usr/lib/libsrv_um.so.1.10.2359475
shared library libsrv_init.so → /usr/lib/libsrv_init.so.1.10.2359475
shared library libPVRScopeServices.so → /usr/lib/libPVRScopeServices.so.1.10.2359475
binary pvrsrvctl → /usr/local/bin/pvrsrvctl
binary sgx_init_test → /usr/local/bin/sgx_init_test
binary services_test → /usr/local/bin/services_test
binary sgx_blit_test → /usr/local/bin/sgx_blit_test
binary sgx_clipblit_test → /usr/local/bin/sgx_clipblit_test
binary sgx_flip_test → /usr/local/bin/sgx_flip_test
binary sgx_render_flip_test → /usr/local/bin/sgx_render_flip_test
binary pvr2d_test → /usr/local/bin/pvr2d_test
shader glsltest1_vertshader.txt → /usr/local/bin/glsltest1_vertshader.txt
shader glsltest1_fragshaderA.txt → /usr/local/bin/glsltest1_fragshaderA.txt
shader glsltest1_fragshaderB.txt → /usr/local/bin/glsltest1_fragshaderB.txt

Installation complete!
You may now reboot your target.

Regards,
John

Still getting the same errors when running the Magic Lantern demo again.

Still getting the same errors when running the Magic Lantern demo again.

I’m running Debian. If I don’t run /etc/init.d/rc.pvr, I get the same error you get.

root@arm:/opt/gfxsdkdemos/ogles2# ./OGLES2ChameleonMan
Can’t open keypad input device (/dev/input/event0)
Exit message has been set to: "PVRShell: Unable to initialise EGL
".
PVRShell: EGL Error (EGL_BAD_ALLOC)
InitAPI failed!
PVRShell: Unable to initialise EGL
root@arm:/opt/gfxsdkdemos/ogles2# /etc/init.d/rc.pvr start
Loaded PowerVR consumer services.
root@arm:/opt/gfxsdkdemos/ogles2# ./OGLES2ChameleonMan
Can’t open keypad input device (/dev/input/event0)
PVRShell: EGL 1.4 initialized

Regards,
John

Restarted the rc.pvr daemon without any issues. Ran the demo (Magic Lantern) again and ended up with the following errors:

ubuntu@arm:/opt/gfxsdkdemos/ogles2$ ./OGLES2MagicLantern
Can’t open keypad input device (/dev/input/event0)
PVRShell: EGL 1.4 initialized
Exit message has been set to: "PVRShell: Unable to create surface
".
InitAPI failed!
PVRShell: Unable to create surface

Have a funny feeling that I am getting very close to remotely running the sample JavaFX 8 program without any issues. Currently the following errors occur when running the sample JavaFX 8 program remotely, provided the rc.pvr daemon on the BBB is running:

Have a funny feeling that I am getting very close to remotely running the sample JavaFX 8 program without any issues. Currently the following errors occur when running the sample JavaFX 8 program remotely, provided the rc.pvr daemon on the BBB is running:

============================================================================================

Connecting to xxx.xxx.xxx.xxx:22
cmd : cd ‘/home/ubuntu/NetBeans_Projects/JavaFX_Test’; ‘/home/ubuntu/ejre-1.8.0_fx/bin/java’ -Dfile.encoding=UTF-8 -jar /home/ubuntu/NetBeans_Projects/JavaFX_Test/dist/JavaFX_Test.jar
eglCreateWindowSurface failed! eglGetError 12291
eglMakeCurrent failed - 12297
Failed to create EGLContext
Graphics Device initialization failed for : es2
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found

Seems as though the create surface problem is related to the issues with trying to run any of the SGX EGL2 demos.

Since this is related to SGX, I recommend that you post a question on Texas Instruments E2E forum.

Regards,
John

Created a new thread on the TI E2E forum for anyone that is interested in tracking the issue.