远程环境为Ubuntu,CUDA12.2

  1. 找到nsight-compute的执行路径,为/usr/local/cuda-12.2/nsight-compute-2023.2.2/ncu.
  2. 使用sudo来执行ncu命令
    1
    sudo /usr/local/cuda-12.2/nsight-compute-2023.2.2/ncu --target-processes all  --set detailed -o ./test_llm_detail.ncu-rep ./test_llm
    --target-processes all表示分析所有子进程,-o ./test_llm_detail.ncu-rep表示设置输出目录为当前路径下的test_llm_detail.ncu-rep文件。
  3. 将生成的ncu-rep文件scp到本地,使用nsight-compute程序open File即可查看