mcpField
C
cli-anything-nsight-graphics

cli-anything-nsight-graphics

github.com/hkuds开发57.6k420 次安装5 周前更新
代码仓库

关于 cli-anything-nsight-graphics

cli-anything-nsight-graphics 是用于编排 NVIDIA Nsight Graphics 采集与分析任务的命令行工具,面向排查应用帧和 GPU 性能的图形开发者,整合采集、回放分析和结构化摘要。

主要功能

  1. 01检测 Nsight 安装和兼容模式
  2. 02启动应用或按 PID 附加
  3. 03采集帧和 GPU 追踪
  4. 04导出并汇总 GPU 追踪数据
  5. 05分析已有的 Graphics Capture 文件

适用场景

  1. 01采集前检查已安装的 Nsight 版本
  2. 02采集目标应用的帧
  3. 03汇总 GPU 追踪性能数据
  4. 04分析现有的 .ngfx-capture 文件

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-nsight-graphics

安装后在 Claude Code 中输入/cli-anything-nsight-graphics确认已加载。

详细介绍

Nsight Graphics CLI 技能

通过命令行编排 NVIDIA Nsight Graphics 官方活动。

功能

  • 探测已安装的 Nsight 二进制文件与兼容模式
  • 以分离模式在 Nsight 下启动应用
  • 将 Nsight 附加到正在运行的 PID
  • 触发 Graphics Capture 或 OpenGL Frame Debugger 捕获
  • 触发 GPU Trace 捕获、自动导出并汇总
  • 通过 ngfx-replay 分析已有的 .ngfx-capture 文件
  • 为 .ngfx-gputrace 输入提供清晰的兼容性诊断报告
  • 触发 Generate C++ Capture

命令

doctor
cli-anything-nsight-graphics --json doctor info
cli-anything-nsight-graphics --json doctor versions
cli-anything-nsight-graphics --nsight-path "C:\Path\To\Nsight Graphics 2024.2\host\windows-desktop-nomad-x64" --json doctor info
launch
cli-anything-nsight-graphics launch detached --activity "Graphics Capture" --exe "C:\Path\To\App.exe"
cli-anything-nsight-graphics launch attach --activity "Graphics Capture" --pid 12345
frame capture
cli-anything-nsight-graphics --output-dir D:\captures frame capture ^
  --exe "C:\Path\To\App.exe" ^
  --wait-frames 10
GPU Trace
cli-anything-nsight-graphics --output-dir D:\traces gpu-trace capture ^
  --exe "C:\Path\To\App.exe" ^
  --start-after-ms 1000 ^
  --limit-to-frames 1 ^
  --auto-export ^
  --summarize

cli-anything-nsight-graphics gpu-trace summarize ^
  --input-dir D:\traces
Replay 分析
cli-anything-nsight-graphics --json replay analyze ^
  --capture-file D:\captures\frame.ngfx-capture ^
  --output-dir D:\analysis
Generate C++ Capture
cli-anything-nsight-graphics --output-dir D:\cpp cpp capture ^
  --exe "C:\Path\To\App.exe" ^
  --wait-seconds 5

Agent 说明

  • 优先使用 doctor info 来发现可用的兼容模式。
  • 当存在多个 Nsight Graphics 版本时,使用 doctor versions 列出检测到的安装。
  • 使用 --nsight-path 强制指定某个安装目录或 ngfx.exe。
  • 在程序化工作流中使用 --json。
  • 对于一步式性能分诊,优先使用 gpu-trace capture --auto-export --summarize。摘要包含导出的表格清单、指标清单、帧预算分类、工作负载分类、吞吐量排名、瓶颈提示,以及针对空事件/状态表的警告。
  • 当输入是已有的 .ngfx-capture 文件时,使用 replay analyze。在没有任何分析开关的情况下,它会导出元数据、日志、捕获的日志错误以及 replay 性能报告,然后添加结构化的 analysis.highlights / analysis.warnings。
  • ngfx-replay 将其输入记录为 Graphics Capture 文件。接受 .ngfx-gputrace 输入是为了提供清晰的诊断,但在 Nsight Graphics 2026.1.0 上它们可能会报告 Invalid file header;请使用 gpu-trace summarize 进行导出的 GPU Trace 表分析。
  • replay analyze 使用官方 ngfx-replay 的元数据/日志/截图/性能报告输出;它不是 RenderDoc 风格的着色器、管线、纹理或资源检查器。
  • Frame/GPU/C++ 捕获命令需要通过 --exe 指定启动目标,或使用预先配置的根级 --project。
  • 如果全局 cli-anything-nsight-graphics 命令指向旧的工作树,请从 nsight-graphics/agent-harness 使用 python -m pip install -e . 重新安装。

评论

支持 Markdown