当利用nsight进行性能分析时,当涉及到内核级别的性能分析时,nvidia提供了系统级别(nsight system),和内核级别的性能分析工具(nsight compute)。
其中,内核级别的性能分析,可以检查kernel实现的性能好坏及bottleneck。
本次分析参考的kernel实现代码为:
https://github.com/siboehm/SGEMM_CUDA
本次主要对比的是cublas和基于naive cuda实现的kernel性能对比:
cublas的实现可以理解为最优解,而naive cuda的kernel没有进行,global memory。 共享内存或者寄存器相关的优化。
参考下列执行执行nsight compute的分析。。。
step 1: enble the usage of ncu
based on the first reference
step 2; generate report
```
ncu -o profile_matrix --set full ./a.out```
step 3: use nsight compute to watch report
Reference:[1] https://developer.nvidia.com/nvidia-development-tools-solutions-err_nvgpuctrperm-permission-issue-performance-counters<