How to debug the Gcnano GPU with VTK

Revision as of 19:23, 5 January 2021 by Registered User








1. VTK overview[edit source]

The VTK (Vivante software ToolKit) is a set of tools :

Tool name Description execution plateform
vEmulator graphics and OpenCL emulator PC
vProfiler Embedded tracer for performance profiling
(generate log files to feed vAnalyzer)
SoC
vAnalyzer Visual anlyser for performance profiling
(based on logs generated by vProfiler)
PC
vShader standalone environnement for prototyping and optimizing shader programs PC
vCompiler standalone environnement for compiling shader code PC
vTexture image transfer utility for image compression/decompression PC
vTracer Embedded recorder of OpenGL ES API traces
(generate trace files to feed vPlayer)
SoC
vPlayer Tool to playback recorded API traces files
(based on logs generated by vProfiler)
SoC or PC

All these tools are provided in the Vivante SW deliveries.


To have full details about VTK, please refer to the Vivante Software Tool Kit User guide.


1.1. vEmulator[edit source]

Not tested.


1.2. vProfiler and vAnalyzer[edit source]

These tools assist software developers in optimizing application performance on Vivante enabled platforms.

1.2.1. vProfiler[edit source]

During runtime, vProfiler gathers data from performance counters included :

  • in GPU
  • in SW drivers
  • in hardware access layer.

It can track data for a range of frames or a single frame from any application.
These performance metrics are stored in a file (default filename is vprofiler.vpd)


vProfiler activation

  • Reload galcore driver with gpuProfiler=1
rmmod galcore.ko
insmod /lib/modules/4.x.x/galcore.ko gpuProfiler=1
  • set the following environnement variable
export VIV_PROFILE=1

This will allow basic tracing.


In order to fine tune the configuration of the tracing method, other values are possible for VIV_PROFILE and other environnement variables can be set, as described in the table below :

Env variable Description
VIV_PROFILE

0 - Disable vProfiler (default)
1 - Enable vProfiler
2 - Control via application call
3 - Allows control over which frames to profile with vProfiler

VP_OUTPUT Specify the output file name of vProfiler (default is vprofiler.vpd)
VP_FRAME_NUM When VIV_PROFILE=1, specify the number of frames dumped by vProfiler
VP_FRAME_START When VIV_PROFILE=3, specify the frame to start profiling with vProfiler
VP_FRAME_END When VIV_PROFILE=3, specify the frame to end profiling with vProfiler
VP_SYNC_MODE

0 - Disable the synchronous mode of vProfiler
1 - Enable the synchronous mode of vProfiler (default)

VP_USE_GLFINISH

0 - Disable the use of glFinish() instead of eglSwapBuffers() as the frame delimiter (default)
1 - Disable the use of glFinish() instead of eglSwapBuffers() as the frame delimiter

1.2.2. vAnalyzer[edit source]

This GUI-based tool will allow to open the file generated by the vProfile (.vpd file), and provide a visual analysis of performance results based on :

  • customizable charts of performance counters (counters are listed in Appendix A of the Vivante Tool Kit User Guide)
  • OpenGL function call statistics
  • shader programs statistics (Vertex shader & Pixel shader).

1.3. vShader[edit source]

Not tested..

1.4. vCompiler[edit source]

Not tested..

1.5. vTexture[edit source]

Not tested..

1.6. vTracer and vPlayer[edit source]

1.6.1. vTracer[edit source]

Here are some tips but it is not running properly


vTracer setup :

  • libraries addition :
cp /media/sdcard/libGLES_vlogger19.so /usr/lib/
cp /media/sdcard/libGLES_vtracer19.so /usr/lib/
cp /media/sdcard/vtracer.conf .

These libraries are provided in the Vivante SW deliveries : vTracer.zip/bin/xxx/
2 trace modes are suppported : Intercept trace mode & Direct Trace mode. (cf Vivante doc for details)

  • activation of the traces in Intercept Trace mode
export LD_PRELOAD=/usr/lib/libGLES_vtracer19.so
  • deactivation of the traces in Intercept Trace mode
export LD_PRELOAD=

  • activation of the traces in Direct Trace mode
export VIV_TRACE=2
  • configuration of the tracer

Optionnaly, configuration parameters can be set in the vtracer.conf file

  • tracer execution

Trace file will be generated as soon as application is launched (trace_xxx_yyy.bin)

1.6.2. vPlayer[edit source]

Here are some tips but it is not running properly


vPlayer will allow playback of recorded file from vTracer.
The vPlayer application is capable of running trace files created on another platform

vPLayer setup :

  • installation from : vTracer.zip/bin/windows/vplayer_install.zip/setup.exe
  • execution :
vplayer [options] tracefilename 

(cf Vivante doc for options details)