用途:在命令行中编排 NVIDIA Nsight Graphics 的官方活动,面向 Windows 环境,适合自动化与智能体工作流。
主要能力:探测已安装的 Nsight 二进制与兼容模式;以 detached 方式启动应用或在运行中的 PID 上附加;触发 Graphics Capture 或 OpenGL Frame Debugger 捕获;触发 GPU Trace 捕获并自动导出、汇总;通过 ngfx-replay 分析已有 .ngfx-capture 文件;对 .ngfx-gputrace 输入给出兼容性诊断;触发 Generate C++ Capture。
使用方式:常用子命令包括 doctor(info/versions)、launch(detached/attach)、frame capture、gpu-trace capture/summarize、replay analyze、cpp capture。示例:cli-anything-nsight-graphics --json doctor info;cli-anything-nsight-graphics launch detached --activity "Graphics Capture" --exe "C:\Path\To\App.exe";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 --json replay analyze --capture-file D:\captures\frame.ngfx-capture --output-dir D:\analysis。可用 --nsight-path 指定安装目录或 ngfx.exe,--json 用于程序化流程。
适用场景:性能排查与捕获自动化,建议先用 doctor info 确认兼容模式,多版本时用 doctor versions 列出安装;一步式性能分诊优先用 gpu-trace capture --auto-export --summarize,其汇总含导出表清单、指标清单、帧预算分类、工作负载分类、吞吐排名、瓶颈提示及空事件/regime 表警告。
限制:replay analyze 使用官方 ngfx-replay 的元数据/日志/截图/性能报告输出,并非 RenderDoc 式着色器、管线、纹理或资源检查器;ngfx-replay 文档标注输入为 Graphics Capture 文件,.ngfx-gputrace 输入在 Nsight Graphics 2026.1.0 上可能报 Invalid file header,此时应改用 gpu-trace summarize。Frame/GPU/C++ 捕获命令需通过 --exe 或预配置的根级 --project 指定启动目标。若全局命令指向旧 worktree,可从 nsight-graphics/agent-harness 用 python -m pip install -e . 重装。其他平台支持与收费信息暂未提供。