You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nsight Systems无法显示CUDA Kernel分析输出的问题求助

求助:Nsight Systems无法显示CUDA Kernel分析输出

系统环境

  • GPU:V100
  • NVIDIA驱动版本:450.80.02,CUDA版本:11.6
  • Nsight Systems版本:2021.5.2.53-28d0e6e
  • 操作系统:Ubuntu,内核版本:5.0.0-1032-azure

问题现象

已生成Nsight分析文件/home/build/Baseline.nsys-rep,但在Nsight Viewer中无法看到CUDA Kernel数据输出。

已尝试操作及异常信息

  1. 修改perf_event_paranoid失败
    当前perf_event_paranoid值为3,执行命令sudo sh -c "echo 2 >/proc/sys/kernel/perf_event_paranoid"时报错:
    /bin/bash: /proc/sys/kernel/perf_event_paranoid: Read-only file system
    
  2. 使用的采集命令
    nsys profile --capture-range=cudaProfilerApi --trace-fork-before-exec true --force-overwrite true -s cpu --cudabacktrace=all --stats=true -t cuda,nvtx,osrt,cudnn,cublas -o Baseline -w true
    
  3. nsys status -e输出
    nsys status -e
    Timestamp counter supported: No
    Sampling Environment Check
    Linux Kernel Paranoid Level = -1: OK
    Linux Distribution = Ubuntu
    Linux Kernel Version = 5.0.0-1032-azure: OK
    Linux perf_event_open syscall available: OK
    Sampling trigger event available: OK
    Intel(c) Last Branch Record support: Not Available
    Sampling Environment: OK
    
    注意:该输出显示的Linux Kernel Paranoid Level = -1与实际值3不符

排查与解决建议

  • 修复/proc只读问题

    • 执行mount | grep /检查根分区是否为只读挂载(含ro标记)
    • 临时重新挂载根分区为读写:sudo mount -o remount,rw /
    • 用sysctl修改参数(比直接写proc文件更可靠):sudo sysctl -w kernel.perf_event_paranoid=2
    • 若为Azure云主机,需检查虚拟机磁盘挂载配置,确保磁盘处于可写状态
  • 修正参数读取矛盾
    在同一终端环境下执行sysctl kernel.perf_event_paranoid和nsys status -e,排除容器/虚拟化隔离导致的参数读取差异

  • 调整Nsight采集命令

    • 若代码未显式调用cudaProfilerStart()/cudaProfilerStop(),移除--capture-range=cudaProfilerApi参数,避免错过所有Kernel采集
    • 使用最简命令测试:nsys profile -t cuda -o TestProfile ./your-application(替换./your-application为你的程序路径)
    • 添加--sample=none参数,避免CPU采样干扰CUDA事件捕获
  • 版本兼容性检查
    CUDA 11.6推荐搭配Nsight Systems 2022.3及以上版本,当前2021.5版本可能存在兼容性问题,建议升级

  • 验证分析文件完整性
    导出分析文件为SQLite格式检查:nsys export --type sqlite -o Baseline.sqlite /home/build/Baseline.nsys-rep,查看CudaKernel表是否有数据

内容的提问来源于stack exchange,提问作者Hossam Amer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 22:55:19