How to profile Vivante GPU on iMX6
|
Introduction
This wiki explains how to enable the profiling of the Vivante GPUs in order to analyze the Vivante GPU usage on a i.MX6.
Testing setup
At the time this article was written the following environment was used:
- i.MX6 Sabre Lite evaluation board
- RidgeRun Irazu SDK with Vivante firmware 5.0.11
- Vivante VDK 1.4.6 - Please contact NXP to download the SDK.
Documents to download from: https://community.nxp.com/docs/DOC-95560
Some initial information
It is recommended as the first step to read the I.MX Graphics User's Guide chapter 7 to fully understand the different profiling tools that come with the Vivante VDK.
NXP will share the I.MX Graphics User's Guide: i.MX_Graphics_User's_Guide.pdf
How to enable the profiling mode in the Vivante firmware
For the latest versions of the Vivante firmware included in the SDK it is not required to replace the Vivante binaries with any kind of special ones, the existent binaries already have the profiling built-in and it is just a matter to activate it.
In order to activate the profiling in the Vivante firmware follows the next steps:
1. Enable the profiling at the galcore driver in the kernel at: drivers/mxc/gpu-viv/config
--- config~ 2015-04-27 10:42:52.000000000 -0600 +++ config 2018-05-23 07:50:48.983694000 -0600 @@ -34,3 +34,5 @@ BANK_BIT_END ?= 15 BANK_CHANNEL_BIT ?= 12 PLATFORM ?= freescale/gc_hal_kernel_platform_imx6q14 +USE_POWER_MANAGEMENT = 0 +USE_PROFILER = 1
2. Enable the profiling at u-boot's bootargs adding the following:
galcore.gpuProfiler=1
3. Once your board has started, make sure profiling is enabled:
cat /sys/module/galcore/parameters/gpuProfiler
The output should be 1 if profiling is enabled.
4. Set the following environment variables:
LOG_FILE_NAME=mysample export VIV_PROFILE=1 export VP_OUTPUT=${LOG_FILE_NAME}.vpd export VP_FRAME_NUM=0 export VP_FRAME_START=0 export VP_FRAME_END=0 export VP_SYNC_MODE=0
5. Run your GPU-based application. It shall generate a profiling file with .vpd extension.
How to analyze the profiling data
Once you have your profiling data you can use the vAnalyzer tool included in the Vivante VDK (vAnalyzer tool can be downloaded by contacting NXP).
1. Look for the vAnalyzer.zip, extract it and install it..
2. Once installed, execute the vAnalyzer application and open the .vpd file, it should look as follows:
3. That's it, now you can take a look at your GPU's statistics.
For direct inquiries, please refer to the contact information available on our Contact page. Alternatively, you may complete and submit the form provided at the same link. We will respond to your request at our earliest opportunity.
Links to RidgeRun Resources and RidgeRun Artificial Intelligence Solutions can be found in the footer below.