Difference between revisions of "How to debug the Gcnano GPU with VTK"

[quality revision] [pending revision]
m (Replaced content with "<noinclude> {{ArticleMainWriter|VincentA}} {{ArticleApprovedVersion | Jean-ChristopheT | Nobody | No previous approved version | Automatic approval (article under construc...")
(Tag: Replaced)
m
 







Under construction.png Coming soon

1 VTK overview[edit]

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]

Not tested.


1.2 vProfiler and vAnalyzer[edit]

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

1.2.1 vProfiler[edit]

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]

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]

Not tested..

1.4 vCompiler[edit]

Not tested..

1.5 vTexture[edit]

Not tested..

1.6 vTracer and vPlayer[edit]

1.6.1 vTracer[edit]

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]

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)

<noinclude>

{{ArticleMainWriter|VincentA}}
{{ArticleApprovedVersion | Jean-ChristopheT | Nobody | No previous approved version | Automatic approval (article under construction) | 19Feb’19}}
[[{{ReviewsComments|PCO (W803) : "gcnano" in the article name (we have to be homogeneous), to be discussed together with NSA}}
{{ReviewsComments|PCO (W803) : Please clarify with NSA if the category STM32MP1 should be use or not}}

{{ReviewsComments|PCO (W803) : Maybe a summary is missing}}

{{ReviewsComments|PCO (W803) : Do not use Soc, use instead "microprocessor device", see [[Contributors:Guidelines_for_article_edition#Preferred terms, concepts and acronyms]]}}
{{ReviewsComments|PCO (W803) : Do not use PC, use instead ? (check with NSA), see [[Contributors:Guidelines_for_article_edition#Preferred terms, concepts and acronyms]]}}

{{ReviewsComments|PCO (W803) : avoid "br" }}

{{ReviewsComments|PCO (W803) : instead of "not tested", maybe put instead something like "under construction"...}}

==VTK overview==

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

{| class="wikitable"
|-
! Tool name  !!  Description !!  execution plateform
|-
|vEmulator       || graphics and OpenCL emulator || PC
|-
|vProfiler       || Embedded tracer for performance profiling <br />(generate log files to feed vAnalyzer)  || SoC 
|-
|vAnalyzer       || Visual anlyser for performance profiling <br />(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 <br />(generate trace files to feed vPlayer) || SoC
|-
|vPlayer  || Tool to playback recorded API traces files <br />(based on logs generated by vProfiler) || SoC or PC
|-
|}

All these tools are provided in the Vivante SW deliveries.<br />

{{ReviewsComments|PCO (W803) : Where? how? please clarify}}

To have full details about VTK, please refer to the ''Vivante Software Tool Kit User guide''.<br />

{{ReviewsComments|PCO (W803) : Where? how? please clarify}}

===vEmulator===

Not tested.<br />


===vProfiler and vAnalyzer===
These tools assist software developers in optimizing application performance on Vivante enabled platforms.<br />


====vProfiler====

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. <br />

These performance metrics are stored in a file (default filename is ''vprofiler.vpd'') <br />

<br /> 

'''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 :

{| class="wikitable"
|-
! Env variable !!  Description 
|-
|VIV_PROFILE       || 
0 - Disable vProfiler (default)  <br />

1 - Enable vProfiler <br />

2 - Control via application call <br />

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  <br /> 

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)<br /> 

1 - Disable the use of glFinish() instead of eglSwapBuffers() as the frame delimiter 
|-
|}

====vAnalyzer====
{{ReviewsComments|PCO (W803) : a screen capture could be great}}
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). 

===vShader===

Not tested..<br />


===vCompiler===

Not tested..<br />


===vTexture===

Not tested..<br />


===vTracer and vPlayer===


====vTracer====

'''Here are some tips but it is not running properly'''
{{ReviewsComments|PCO (W803) : not a so nice comment, we can discuss together to find a solution : )}}

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/<br /> 

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)

====vPlayer====
'''Here are some tips but it is not running properly'''
{{ReviewsComments|PCO (W803) : maybe put instead something like "under construction"...}}

vPlayer will allow playback of recorded file from vTracer. <br /> 

The vPlayer application is capable of running trace files created on another platform<br /> 


vPLayer setup :
* installation from : vTracer.zip/bin/windows/vplayer_install.zip/setup.exe

* execution : 
 vplayer [options] tracefilename 
(cf Vivante doc for options details)
<noinclude>

[[Category:How to trace and debug]]</noinclude>

{{UnderConstruction}}
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
{{ReviewsComments|PCO (W803) : "gcnano" in the article name (we have to be homogeneous), to be discussed together with NSA}}
  +
{{ReviewsComments|PCO (W803) : Please clarify with NSA if the category STM32MP1 should be use or not}}
  +
  +
{{ReviewsComments|PCO (W803) : Maybe a summary is missing}}
  +
  +
{{ReviewsComments|PCO (W803) : Do not use Soc, use instead "microprocessor device", see [[Contributors:Guidelines_for_article_edition#Preferred terms, concepts and acronyms]]}}
  +
{{ReviewsComments|PCO (W803) : Do not use PC, use instead ? (check with NSA), see [[Contributors:Guidelines_for_article_edition#Preferred terms, concepts and acronyms]]}}
  +
  +
{{ReviewsComments|PCO (W803) : avoid "br" }}
  +
  +
{{ReviewsComments|PCO (W803) : instead of "not tested", maybe put instead something like "under construction"...}}
  +
  +
==VTK overview==
  +
  +
The VTK (Vivante software ToolKit) is a set of tools :
  +
  +
{| class="wikitable"
  +
|-
  +
! Tool name  !!  Description !!  execution plateform
  +
|-
  +
|vEmulator      || graphics and OpenCL emulator || PC
  +
|-
  +
|vProfiler      || Embedded tracer for performance profiling <br />(generate log files to feed vAnalyzer)  || SoC
  +
|-
  +
|vAnalyzer      || Visual anlyser for performance profiling <br />(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 <br />(generate trace files to feed vPlayer) || SoC
  +
|-
  +
|vPlayer  || Tool to playback recorded API traces files <br />(based on logs generated by vProfiler) || SoC or PC
  +
|-
  +
|}
  +
  +
All these tools are provided in the Vivante SW deliveries.<br />
  +
{{ReviewsComments|PCO (W803) : Where? how? please clarify}}
  +
  +
To have full details about VTK, please refer to the ''Vivante Software Tool Kit User guide''.<br />
  +
{{ReviewsComments|PCO (W803) : Where? how? please clarify}}
  +
  +
===vEmulator===
  +
  +
Not tested.<br />
  +
  +
  +
===vProfiler and vAnalyzer===
  +
These tools assist software developers in optimizing application performance on Vivante enabled platforms.<br />
  +
  +
====vProfiler====
  +
  +
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. <br />
  +
These performance metrics are stored in a file (default filename is ''vprofiler.vpd'') <br />
  +
  +
<br />
  +
'''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 :
  +
 
  +
{| class="wikitable"
  +
|-
  +
! Env variable !!  Description
  +
|-
  +
|VIV_PROFILE      ||
  +
0 - Disable vProfiler (default)  <br />
  +
1 - Enable vProfiler <br />
  +
2 - Control via application call <br />
  +
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  <br />
  +
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)<br />
  +
1 - Disable the use of glFinish() instead of eglSwapBuffers() as the frame delimiter
  +
|-
  +
|}
  +
  +
====vAnalyzer====
  +
{{ReviewsComments|PCO (W803) : a screen capture could be great}}
  +
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).
  +
  +
===vShader===
  +
  +
Not tested..<br />
  +
  +
===vCompiler===
  +
  +
Not tested..<br />
  +
  +
===vTexture===
  +
  +
Not tested..<br />
  +
  +
===vTracer and vPlayer===
  +
  +
  +
  +
====vTracer====
  +
  +
'''Here are some tips but it is not running properly'''
  +
{{ReviewsComments|PCO (W803) : not a so nice comment, we can discuss together to find a solution : )}}
  +
  +
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/<br />
  +
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)
  +
  +
====vPlayer====
  +
'''Here are some tips but it is not running properly'''
  +
{{ReviewsComments|PCO (W803) : maybe put instead something like "under construction"...}}
  +
  +
vPlayer will allow playback of recorded file from vTracer. <br />
  +
The vPlayer application is capable of running trace files created on another platform<br />
  +
  +
vPLayer setup :
  +
* installation from : vTracer.zip/bin/windows/vplayer_install.zip/setup.exe
  +
  +
* execution :
  +
vplayer [options] tracefilename
  +
(cf Vivante doc for options details)
  +
 
<noinclude>
 
<noinclude>
{{ArticleMainWriter|VincentA}}
 
{{ArticleApprovedVersion | Jean-ChristopheT | Nobody | No previous approved version | Automatic approval (article under construction) | 19Feb’19}}
 
 
[[Category:How to trace and debug]]
 
[[Category:How to trace and debug]]
 
</noinclude>
 
</noinclude>
{{UnderConstruction}}
 

Attachments

Discussions