Forums - GPU Profiling of Ubuntu Touch

4 posts / 0 new
Last post
GPU Profiling of Ubuntu Touch
ipterbuk
Join Date: 9 Jun 15
Posts: 4
Posted: Wed, 2015-06-10 06:53

Hey,

I have a Nexus 7 (2013 model) with an Adreno GPU inside. I've installed Ubuntu Touch[1] on it. GUI performance is quite good, but I'd like to more accurately profile what the GPU is doing. So I'd like to try enabling the GPU profiler with Ubuntu Touch.

Ubuntu Touch is based on Ubuntu linux. It boots using the android kernel for the device, into a standard linux userspace. Hardware bringup (like the GPU) relies on the android-based tools & drivers however, so these are placed in a bionic-only chroot. It uses libhybris to bridge the bionic<->glibc gap, so standard linux-based userspace can talk to the android-based drivers. This is how the adreno driver is used. adb logcat shows:

Quote:
D/libEGL ( 4556): loaded /system/lib/egl/libEGL_adreno.so
D/libEGL ( 4556): loaded /system/lib/egl/libGLESv1_CM_adreno.so
D/libEGL ( 4556): loaded /system/lib/egl/libGLESv2_adreno.so
I/Adreno-EGL ( 4556): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13
This is the contents of /system/lib/egl:

Quote:
-rw-r--r--. 1 root root 23 May 21 02:56 egl.cfg
-rw-r--r--. 1 root root 38128 May 21 02:54 eglsubAndroid.so
-rw-r--r--. 1 root root 153684 May 21 02:54 libEGL_adreno.so
-rw-r--r--. 1 root root 79224 May 21 02:57 libGLES_android.so
-rw-r--r--. 1 root root 202132 May 21 02:54 libGLESv1_CM_adreno.so
-rw-r--r--. 1 root root 1227076 May 21 02:54 libGLESv2_adreno.so
-rw-r--r--. 1 root root 83260 May 21 02:54 libplayback_adreno.so
-rw-r--r--. 1 root root 566904 May 21 02:54 libq3dtools_adreno.so

Do I understand correctly that libq3dtools_adreno.so is the profiling helper library? I've set the debug.egl.profiler android property to 1, but I see no evidence that this library is being loaded. So could someone explain to me what is supposed to load this library, and should I see any evidence of this load in the logcat (a line printed maybe)?

Thanks
Ipter

 

[1] https://wiki.ubuntu.com/Touch

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2015-06-10 07:57

The library on the device will be used by Adreno Profiler which needs to be running on a desktop machine.

 

  • Up0
  • Down0
ipterbuk
Join Date: 9 Jun 15
Posts: 4
Posted: Wed, 2015-06-10 13:54

Dear mhfeldma,

thanks for the reply. I failed to mention that I have the Adreno Profiler running on a desktop machine. However while it detects the Ubuntu Touch over adb, it does not detect an application to profile. So I suspect the profiling library is not being loaded.

Hence I'd like to debug the loading of the profiling library on the device. If there was an obvious way to know if the library was loaded, it would help - should something be printed to logcat if it is? Is the egl/gles library responsible for loading the profiling library?

Thanks

  • Up0
  • Down0
ipterbuk
Join Date: 9 Jun 15
Posts: 4
Posted: Fri, 2015-06-12 13:01

Hey all,

so I managed to get it working! For the record, here are the steps I've made:

First need to set the android variable to enable the profiler. Do this by editing /var/lib/lxc/android/pre-start.d/10-no-adbd and add the line:

Quote:
echo "debug.egl.profiler=1" >> $LXC_ROOTFS_PATH/default.prop

Now I'm unsure if this step is totally necessary, but I saw that the path to the profiler library is incorrect in the driver binaries, so I patched them. First I needed to get write access to them:

Quote:
mkdir temp; mount /var/lib/lxc/android/system.img temp; cd temp/lib/egl

You should be in the directory with the driver binaries. Correct the paths with:

Quote:
sed -i 's|/vendor/lib/egl/libq3dtools_adreno.so|/system/lib/egl/libq3dtools_adreno.so|g' libEGL_adreno.so
sed -i 's|/vendor/lib/egl/libq3dtools_adreno.so|/system/lib/egl/libq3dtools_adreno.so|g' libGLES_android.so
sed -i 's|/vendor/lib/egl/libq3dtools_adreno.so|/system/lib/egl/libq3dtools_adreno.so|g' libGLESv1_CM_adreno.so
sed -i 's|/vendor/lib/egl/libq3dtools_adreno.so|/system/lib/egl/libq3dtools_adreno.so|g' libGLESv2_adreno.so
sed -i 's|/vendor/lib/egl/libq3dtools_adreno.so|/system/lib/egl/libq3dtools_adreno.so|g' libplayback_adreno.so

Reboot for good measure, ensure UI appears ok. Then run the AdrenoProfiler on your machine, and try the Connect dialog.

Note I found that it doesn't always notice a profilable application is running, sometimes restarting the application helps it detect it.

Hope this helps someone!

 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.