Unity apk crashes on start with Vulkan interceptor

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.

Parents
  • Hi Alex, 

    Some progress on this one, but the route to getting it working is a little different.

    • Using Mobile Studio 2019.2 (for the new aga_me.py helper script).
    • Ensure that your build is debuggable in its Android manifest.
    • Change your build to *not* package the interceptor library with the Android APK.
    • In a shell terminal use the recipe below (change app name as needed), run from the graphics_analyzer\target\android\arm directory. This will install the layer driver and configure the command line daemon.
    • Open the Graphics Analyzer GUI and use the network connection option at the bottom of the Connection dialog to connect to localhost port 5002.

    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

Reply
  • Hi Alex, 

    Some progress on this one, but the route to getting it working is a little different.

    • Using Mobile Studio 2019.2 (for the new aga_me.py helper script).
    • Ensure that your build is debuggable in its Android manifest.
    • Change your build to *not* package the interceptor library with the Android APK.
    • In a shell terminal use the recipe below (change app name as needed), run from the graphics_analyzer\target\android\arm directory. This will install the layer driver and configure the command line daemon.
    • Open the Graphics Analyzer GUI and use the network connection option at the bottom of the Connection dialog to connect to localhost port 5002.

    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

Children
More questions in this forum