Hello!
I have a trouble with profiling my Unity project. (latest Unity 2019.2.12)
I'm failed to use Graphics Analyzer from latest Arm Mobile Studio to profile Vulkan-based Unity application. I have just create empty test scene, add Vulkan interceptor (as specified at https://developer.arm.com/docs/101545/0504/target-installation/android/unrooted-android/installation/installing-for-an-opengl-es-unity-application), build apk, install it on Samsung Galaxy S9 phone, run it and faced a crash. Its not shown in the traceable list in GA Daemon Application also.
At the same time GLES interception method worked as expected. Empty scene with GLES rendering API and libMGD.so interceptor lib have worked without crashes, listed in GA Daemon Application and sends data to host application (I have set Android API level to 25).
Maybe Vulkan interception lib embedding instruction lacks some important steps? Are there succesfull attempts to profile Unity Vulkan-based projects? What the steps I should take to provide more info to solve this problem?
Thanks in advance, Alex.
Silentor said:Hello! I have a trouble with profiling my Unity project. (latest Unity 2019.2.12) I'm failed to use Graphics Analyzer from latest Arm Mobile Studio to profile Vulkan-based Unity application. I have just create empty test scene, add Vulkan interceptor (as specified at https://developer.arm.com/docs/101545/0504/target-installation/android/unrooted-android/installation/installing-for-an-opengl-es-unity-application), build apk, install it on Samsung Galaxy S9 phone, run it and faced a crash. Its not shown in the traceable list in GA Daemon Application also. At the same time GLES interception method worked as expected. Empty scene with GLES rendering API and libMGD.so interceptor lib have worked without crashes, listed in GA Daemon Application and sends data to host application (I have set Android API level to 25). Maybe Vulkan interception lib embedding instruction lacks some important steps? Are there succesfull attempts to profile Unity Vulkan-based projects? What the steps I should take to provide more info to solve this problem? Thanks in advance, Alex.
facing the same issue. following for solutions
Hi both,
At the moment we know we have some issues with Vulkan interception on Android devices, due to how we load the interceptor library. This is planned for a fix for Mobile Studio 2020.0 next year, but we have some ideas for workarounds which we'll test out next week and let you know how it goes.
The workaround tends to be specific to the Android version being targeted (targetSdkVersion in the Android manifest file) and the Android version on the device running the application. If you can let me know this info for your application / test device we can see if we can resolve your specific issue.
Thanks, Pete
Thank you!
I have mostly tested our app performance at targetSdkVersion 28 (on Android 9.0 smartphone). Also I have set minimumSdkVersion at 26 to support Android 8.0, so I interested at two cases
1) API 28 - Android 9.0
2) API 26 - Android 8.0
Sorry for the slow reply; I was hoping to make more progress on this, but our attempts to get a stable workaround are currently not proving effective.
Hi Alex,
Some progress on this one, but the route to getting it working is a little different.
Note: Do not try to use the direct connection methods or the layer install methods in the table at the top of Connection dialog; they will try to use the Daemon APK, rather than the command line daemon, which no longer works with the new Android security model and will be removed in the next release.
@echo off set APP_NAME=com.arm.vulkan_best_practice set LAYER_NAME=VK_LAYER_ARM_AGA set LOCAL_LIB_NAME=rooted/arm64-v8a/libGLES_aga.so set LAYER_LIB_NAME=libVkLayerAGA.so adb push %LOCAL_LIB_NAME% /data/local/tmp/%LAYER_LIB_NAME% adb shell run-as %APP_NAME% cp /data/local/tmp/%LAYER_LIB_NAME% . adb shell run-as %APP_NAME% ls %LAYER_LIB_NAME% adb shell settings put global enable_gpu_debug_layers 1 adb shell settings put global gpu_debug_app %APP_NAME% adb shell settings put global gpu_debug_layers %LAYER_NAME% python3 aga_me.py %APP_NAME%
Let us know how you get on, and sorry for the time it took for us to work this one out,
Pete
Hello Peter!
Sorry for the long response. Is this method applicable for rooted devices only? Because my device is not rooted :)
I have tried your script and I've tried to change lib path to unrooted/arm64-v8a/libAGA.so but with no luck. Script works good, install interceptor like:
rooted/arm64-v8a/libGLES_aga.so: 1 file pushed. 27.1 MB/s (10595792 bytes in 0.373s)libVkLayerAGA.so
or
unrooted/arm64-v8a/libAGA.so: 1 file pushed. 28.3 MB/s (10976752 bytes in 0.369s)libVkLayerAGA.so
But I cannot connect to deamon from Device Manager:
Connection refused when connecting to 127.0.0.1:5002.
Problem reading the trace version: 'Read timed out'.
How can I check that the deamon is working?
Thanks for you assistance!
Alex
No, this should work with non-rooted devices. Note that you definitely do want the "rooted" build of the interceptor - the unrooted one is designed for in-app symbol patching and will conflict with the Vulkan layer driver loader.
Also, the aga_me.py script will install the command line daemon, make sure that you don't have the Daemon APK installed (it doesn't work with the Android security model in latest Android devices, and will get removed in the next release).
In terms debugging, you should get some logging showing up in "adb logcat".
We've just published Mobile Studio 2020.0, which includes some fixes and an updated aga_me.py script which should now support this better out of the box. Note that we've had some problems with some devices on Android 8.0 (seem to have non-standard layer driver search paths), but Android 9.0 has been tested.