Forums - Tracing Rendering Stages

11 posts / 0 new
Last post
Tracing Rendering Stages
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Tue, 2023-03-14 07:30

I have a vulkan application and I can trace the application. However I am particulary interested in the rendering stages (e.g. time spent binning etc.). I can see on several screenshots and documents (mentioned multiple times in the Release Notes for example) that this option exist(ed) however I don't have an option for that. I can trace many GPU and CPU metrics but "Rendering Stages" or "GPU Stages" is not among them.

Searching the forum showed a few threads about people having the same problem, however none of them contains an answer.

Can somebody share some insights? Do I have to do something in the application to make it work?

 

Running Snapdragon Profiler 2022.5 on an Snapdragon 888 (Adreno 660).

  • Up0
  • Down0
eshaw Moderator
Join Date: 12 May 16
Location: San Diego
Posts: 142
Posted: Tue, 2023-03-14 13:25

Please ensure you are using the Launch button in Snapdragon Profiler to start your app. Vulkan apps in particular require this to enable GPU profiling functionality.

  • Up0
  • Down0
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Tue, 2023-03-14 13:35

I am starting it using the launch button. Is there something I can do to find out why it is not working?

  • Up0
  • Down0
eshaw Moderator
Join Date: 12 May 16
Location: San Diego
Posts: 142
Posted: Tue, 2023-03-14 14:36

Profling a Vulkan app requires a Vulkan profiling layer to be loaded. You should see messages in logcat showing this, similar to below:

03-14 14:24:24.179  2214  2300 I ActivityManager: Start proc 9379:de.saschawillems.vulkanBloom/u0a235 for pre-top-activity {de.saschawillems.vulkanBloom/de.saschawillems.vulkanSample.VulkanActivity}
03-14 14:24:24.294  2214  2298 I ActivityTaskManager: Displayed de.saschawillems.vulkanBloom/de.saschawillems.vulkanSample.VulkanActivity: +134ms
03-14 14:24:24.306  9379  9406 D vulkan  : searching for layers in '/data/user/0/de.saschawillems.vulkanBloom'
03-14 14:24:24.306  9379  9406 D vulkan  : searching for layers in '/data/app/~~dwhbnklz1z1Qd6cJFwb-PA==/com.qualcomm.snapdragonprofiler.profilerlayer.armeabi_v7a-iKkz1fldNcqKmNhRkpH7Dw==/lib/arm'
03-14 14:24:24.348  9379  9406 D vulkan  : added global layer 'VK_LAYER_PROFILER_Capture' from library '/data/app/~~dwhbnklz1z1Qd6cJFwb-PA==/com.qualcomm.snapdragonprofiler.profilerlayer.armeabi_v7a-iKkz1fldNcqKmNhRkpH7Dw==/lib/arm/libVkLayer_PROFILER_Snapshot.so'
03-14 14:24:24.350  9379  9406 D vulkan  : added global layer 'VK_LAYER_ADRENO_debug' from library '/data/app/~~dwhbnklz1z1Qd6cJFwb-PA==/com.qualcomm.snapdragonprofiler.profilerlayer.armeabi_v7a-iKkz1fldNcqKmNhRkpH7Dw==/lib/arm/libVkLayer_adreno.so'
03-14 14:24:24.351  9379  9406 D vulkan  : added global layer 'VK_LAYER_PROFILER_Trace' from library '/data/app/~~dwhbnklz1z1Qd6cJFwb-PA==/com.qualcomm.snapdragonprofiler.profilerlayer.armeabi_v7a-iKkz1fldNcqKmNhRkpH7Dw==/lib/arm/libVkLayer_PROFILER_Trace.so'
03-14 14:24:24.351  9379  9406 D vulkan  : searching for layers in '/data/app/~~dwhbnklz1z1Qd6cJFwb-PA==/com.qualcomm.snapdragonprofiler.profilerlayer.armeabi_v7a-iKkz1fldNcqKmNhRkpH7Dw==/base.apk!/lib/armeabi-v7a'
03-14 14:24:24.351  9379  9406 D vulkan  : searching for layers in '/data/app/~~caFhZ0weyJY5pj-iLuLhUA==/de.saschawillems.vulkanBloom-yy8ZlPTQsVZVQh15AnHOxQ==/lib/arm'
03-14 14:24:24.360  9379  9406 D vulkan  : added global layer 'VK_LAYER_ADRENO_qprofiler' from library '/data/app/~~caFhZ0weyJY5pj-iLuLhUA==/de.saschawillems.vulkanBloom-yy8ZlPTQsVZVQh15AnHOxQ==/lib/arm/libVkLayer_ADRENO_qprofiler.so'
03-14 14:24:24.360  9379  9406 D vulkan  : searching for layers in '/data/app/~~caFhZ0weyJY5pj-iLuLhUA==/de.saschawillems.vulkanBloom-yy8ZlPTQsVZVQh15AnHOxQ==/base.apk!/lib/armeabi-v7a'
03-14 14:24:24.361  9379  9406 I vulkan  : Loaded layer VK_LAYER_PROFILER_Trace
03-14 14:24:24.369  9379  9406 I AdrenoVK-0: ===== BEGIN DUMP OF OVERRIDDEN SETTINGS =====
03-14 14:24:24.369  9379  9406 I AdrenoVK-0: ===== END DUMP OF OVERRIDDEN SETTINGS =====
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: QUALCOMM build          : 3740789, I79a044285a
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Build Date              : 07/25/22
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Shader Compiler Version : E031.40.16.00
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Local Branch            :
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Remote Branch           :
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Remote Branch           :
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Reconstruct Branch      :
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Build Config            : S P 10.0.7 AArch32
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Driver Path             : /vendor/lib/hw/vulkan.adreno.so
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Driver Version          : 670.0
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: PFP                     : 0x016dc109
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: ME                      : 0x00000000
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Application Name    : vulkanExample
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Application Version : 0x00000000
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Engine Name         : vulkanExample
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Engine Version      : 0x00000000
03-14 14:24:24.370  9379  9406 I AdrenoVK-0: Api Version         : 0x00400000
03-14 14:24:24.370  9379  9406 I vulkanandroid: Loading instance based function pointers...
03-14 14:24:24.372  9379  9406 I SDP.VulkanShim: Initializing the profiler layer...
03-14 14:24:24.372  9379  9406 I SDP.VulkanShim: Profiler layer initialized. API tracing support is enabled.
 
 

 

  • Up0
  • Down0
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Thu, 2023-03-16 01:01

I found some hints using logcat

W, 03-16 08:54:21.772, 1918, 3974, , ziparchive, Unable to open '/data/app/~~v1T3x2r_VDWkLZA3ZoJpqw==/jetzt.akronyme_analogiker.kotzilla-3rz-dS3Z_e1ubFJ_B_JjJw==/base.dm': No such file or directory,
W, 03-16 08:54:23.057, 19498, 19498, , libc, Unable to set property "vendor.debug.vulkan.profiler.layer" to "VK_LAYER_ADRENO_debug:VK_LAYER_PROFILER_Trace": error code: 0x18,

W, 03-16 08:54:23.231, 19507, 19507, , libc, Access denied finding property "vendor.ro.build.version.release",
W, 03-16 08:54:23.366, 19511, 19511, , libc, Access denied finding property "vendor.debug.vulkan.profiler.layer",
W, 03-16 08:54:23.511, 1918, 3942, , ziparchive, Unable to open '/data/app/~~v1T3x2r_VDWkLZA3ZoJpqw==/jetzt.akronyme_analogiker.kotzilla-3rz-dS3Z_e1ubFJ_B_JjJw==/base.dm': No such file or directory,
W, 03-16 08:54:23.702, 19526, 19526, , libc, Access denied finding property "vendor.debug.vulkan.profiler.layer",

 

It seems Snapdragon Profiler tries to inject the layers but fails due to permissions? Any idea how to fix that? :S

 

Some more info: This is an unrooted OnePlus 9 Pro with Android 13

  • Up0
  • Down0
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Thu, 2023-03-16 02:24

Ok. After enabling "GPU Debug layers" and "Disable Permission Monitoring" in the developer options it seems that layers get loaded.

My application is now reporting:

03-16 10:17:39.893 26059 29841 I kotzilla: available validation layers:
03-16 10:17:39.893 26059 29841 I kotzilla:      VK_LAYER_PROFILER_Trace
03-16 10:17:39.893 26059 29841 I kotzilla:      VK_LAYER_PROFILER_Capture
03-16 10:17:39.893 26059 29841 I kotzilla:      VK_LAYER_ADRENO_debug

When I create the vulkan instance I see the following:

03-16 10:17:39.893 26059 29841 I kotzilla: Trying to create instance
03-16 10:17:39.896 26059 29841 I vulkan  : Loaded layer VK_LAYER_PROFILER_Trace
03-16 10:17:39.913 26059 29841 I kotzilla: Instance created with api version 1.2.0

I can also see some performance hints when enabling that option in the Launch screen.

So it seems everything is working?

However in the system trace view I still don't see anything new. I would expect "Rendering stages" or something like that somewhere?

  • Up0
  • Down0
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Thu, 2023-03-16 02:31

Sidenote: When trying to do a frame capture it still doesn't work. The app is not appearing in the Data Sources pane.

logcat reports the following right after instance creation:

03-16 10:28:26.681 28304  6294 I vulkan  : Loaded layer VK_LAYER_PROFILER_Capture
03-16 10:28:26.683 28304  6294 I vulkan  : Loaded layer VK_LAYER_PROFILER_Capture

So something is still broken it seems :S

  • Up0
  • Down0
eshaw Moderator
Join Date: 12 May 16
Location: San Diego
Posts: 142
Posted: Thu, 2023-03-16 15:10

Does your app have internet permission? That is also required for GPU profiling.

Also, just for clarification, in Trace mode, the Rendering stages option would be under Process -> Vulkan in the data sources list.

  • Up0
  • Down0
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Fri, 2023-03-17 03:40

AHA! That was last missing piece. Thank you so much. My app does indeed not need any internet so it wasn't specified to use internet access. Now I can finally see Vulkan API Trace and Rendering Stages.

I am wondering: None of this was really obvious :D Maybe it is worthwhile to add some more checks/hints into Snapdragon Profiler. Or did I miss some documentation about this? The documentation I find about Snapdragon Profiler is from "01 Nov 16".

  • Up0
  • Down0
eshaw Moderator
Join Date: 12 May 16
Location: San Diego
Posts: 142
Posted: Fri, 2023-03-17 09:01

Great, I'm glad to hear it's working for you now.

There is documentation available from the Help menu in Snapdragon Profiler, and it does specify the internet requirement in a few places, including the troubleshooting section. The system configuration issues you had related to the Vulkan layers have not been previously reported, so we don't have any documentation related to that. That's something we'll look into further.

  • Up0
  • Down0
mop666
Join Date: 2 Dec 20
Posts: 7
Posted: Sat, 2023-03-18 00:34

ok I was expecting to find the documentation using googling and I was checking https://developer.qualcomm.com/software/snapdragon-profiler/tools.

Never checked the help menu :D

  • 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.