Since Magic Leap 2 is an Android Open Source Project (AOSP) device, we can leverage many of the robust tools that have been developed for profiling, debugging, and testing AOSP devices.
📄️ Radeon GPU Profiler
Radeon GPU Profiler (RGP) is a tool that helps you analyze the performance of your graphics applications on AMD GPUs. It captures a single frame of rendering and shows you how the GPU executes it, including the time spent on each draw call, pipeline state, shader, and memory operation. This document explains how to install RGP and provides an overview about how use it with a Magic Leap 2 device. For more information about RGP, see the official RGP documentation.
📄️ Draw Tracing
Draw tracing is a tool that aids you in understanding how long your draw calls take. The process involves running the tool on the Magic Leap 2 (ML2) device to generate a trace log on the device while your app is running. This captures the relevant app activity in the file. The file is then transferred onto the host PC to view in the browser. The tool used on device is called Perfetto, and when it's run it generates a file called trace.pftrace on the device.