hkuds--cli-anything
3.3 KiB
3.3 KiB
HARNESS.md – Nsight Graphics CLI Harness Specification
Overview
This harness wraps the official NVIDIA Nsight Graphics command-line tools
into a Click-based CLI named cli-anything-nsight-graphics.
V1 is intentionally orchestration-focused:
- installation and capability probing
- detached launch and PID attach via
ngfx.exe - Graphics Capture / OpenGL Frame Debugger capture
- GPU Trace capture and auto-export
- replay metadata/log/screenshot/perf-report analysis for existing captures
- Generate C++ Capture
Replay analysis uses official ngfx-replay outputs. It does not attempt
RenderDoc-style offline object inspection of pipeline state, shaders, textures,
or resources.
Architecture
agent-harness/
├── HARNESS.md
├── NSIGHT_GRAPHICS.md
├── setup.py
└── cli_anything/
└── nsight_graphics/
├── __init__.py
├── __main__.py
├── README.md
├── nsight_graphics_cli.py
├── core/
│ ├── doctor.py
│ ├── launch.py
│ ├── frame.py
│ ├── gpu_trace.py
│ ├── replay.py
│ └── cpp_capture.py
├── utils/
│ ├── nsight_graphics_backend.py
│ ├── output.py
│ ├── errors.py
│ └── repl_skin.py
├── skills/
│ └── SKILL.md
└── tests/
├── TEST.md
├── test_core.py
└── test_full_e2e.py
Command Groups
| Group | Commands |
|---|---|
doctor |
info |
launch |
detached, attach |
frame |
capture |
gpu-trace |
capture, summarize |
replay |
analyze |
cpp |
capture |
Backend Strategy
- Resolve Nsight executables from
NSIGHT_GRAPHICS_PATH,PATH, then common Windows install directories. - Detect compatibility mode:
unified: legacyngfx.exeactivity-driven CLIsplit: modernngfx-capture/ngfx-replaypresentunified+split: both tool families are present
- Prefer
ngfx.exewhen available, because it covers launch, attach, GPU Trace, and Generate C++ Capture. - Create explicit output directories before invoking
ngfx.exe, then use version-tolerant artifact discovery by diffing the output directory before and after a command instead of depending on one filename. - Use
ngfx-replayfor analysis of existing.ngfx-capturefiles. Accept.ngfx-gputraceinputs only to report clear compatibility diagnostics, becausengfx-replaydocuments its filename input as a Graphics Capture file and can reject standalone GPU Trace files withInvalid file header.
Testing Strategy
test_core.py: mock-based unit tests for discovery, parsing, command construction, output directory preparation, GPU Trace summary parsing, error handling, and CLI help.test_full_e2e.py: conditional tests using a real Nsight installation and a user-supplied test executable via environment variables.
Notes
- V1 is Windows-first and only claims verified support on Windows hosts.
- Replay helpers are metadata/log/perf oriented and do not claim deep shader/pipeline/texture/resource inspection.