TX2入门(8)——优化/性能查看工具nvprof(持续补充……)

关于nvprof,官方原文如是说:This document describes NVIDIA profiling tools that enable you to understand and optimize the performance of your CUDA or OpenACC applications. The Visual Profiler is a graphical profiling tool that displays a timeline of your application's CPU and GPU activity, and that includes an automated analysis engine to identify optimization opportunities. The nvprof profiling tool enables you to collect and view profiling data from the command-line.

其实就是说Visual Profiler是一个图形分析工具,能显示应用程序中CPU和GPU活动的时间线,并自动分析识别潜在的优化机会。而nvprof没有可视化的图形界面,但能从命令行收集、查看和分析数据。一些常用命令如下:

1.版本查看

nvprof --version

2.总结模式

其中,a.out是编译生成的可执行文件,aa.py是打算运行的py文件。生成的结果中,Profiling result:是GPU上的kernel函数运行的时间,API calls:是测量程序调用API的时间

nvprof aa.py
nvprof ./a.out

3.追踪GPU

nvprof --print-gpu-trace python aa.py
nvprof --print-gpu-trace ./a.out

4.追踪API 

nvprof --print-api-trace python aa.py
nvprof --print-api-trace ./a.out

不需要时可以通过–profile-api-trace none关掉这个功能

5. Event/metric总结模式

nvprof --events warps_launched,local_load --metrics ipc  ./a.out(python aa.py)

6.Event/metric追踪模式

nvprof --aggregate-mode off --events local_load --print-gpu-trace ./a.out(python aa.py)

7.Timeline

nvprof --export-profile timeline.prof ./a.out(python aa.py)
nvprof --metrics achieved_occupancy,executed_ipc -o metrics.prof <app> <app args>
nvprof --kernels <kernel specifier> --analysis-metrics -o analysis.prof <app> <app args>

8.保存为文件

nvprof -o profileOutput ./a.out
nvprof --export-profile timeline.prof ./a.out
nvprof --log-file output.log ./a.out



最近忙于考试,后续会接着补充……


参考:

profiler - read the output of nvprof in CUDA - Stack Overflow

nvprof工具使用及结果分析,持续更新。。。 - CSDN博客

CUDA Program Analysis - CSDN博客 

cuda nvprof 输出结果的理解和优化空间-布布扣-bubuko.com

CUDA性能优化----kernel调优(nvprof工具的使用) - CSDN博客

CUDA Program Analysis - CSDN博客

nvprof tx1 or tx2 - CSDN博客

  • 5
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值