/veloq:ncu-profile-analysisfrom veloq
Analyzes NVIDIA Nsight Compute kernel reports via the VeloQ CLI for occupancy, warp stalls, memory/instruction bottlenecks, and metric export.
Ships in veloq. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill for Nsight Compute .ncu-rep and zstd-compressed
.ncu-repz kernel reports and
kernel-internal bottleneck analysis. NCU explains why a kernel is slow
internally; NSys explains what ran when. Use veloq ncu as the
evidence extractor for report data, then decide whether the evidence
points to occupancy, memory, scheduler, instruction, launch, or
source-line work.
This skill requires the VeloQ CLI on PATH. If veloq is missing,
install it before analysis.
Use veloq ncu verbs as the analysis interface. Do not parse
<file>.veloq/ncu-native.json.gz, disasm cache files, or other
.veloq/ artifacts directly unless the user explicitly asks for raw
artifact inspection or you are developing VeloQ itself.
veloq info path/to/report.ncu-rep
veloq ncu summary --help
If veloq is missing, install it:
# Pre-built binary (Linux x86_64/aarch64, macOS x86_64/arm64)
curl -fsSL https://raw.githubusercontent.com/lucifer1004/veloq/main/scripts/install.sh | bash
# Or build from source — clone the repo first, then:
cargo build --release -p veloq
JSON output is the agent contract. Success:
{
"schema": "v1",
"source": { "kind": "ncu", "version": "v1" },
"command": "ncu.launches",
"trace": { "kind": "ncu", "path": "..." },
"data": {
"count": 50,
"total_matched": 1234,
"rows": [
/* ... */
],
"auxiliary": {
/* per-verb */
}
}
}
trace_span is omitted on NCU verbs (NCU reports do not carry the
NSys-style primary-execution window). Every list verb returns
canonical data.rows[] with a stable per-row key:
ncu summary → one totals row (key: "totals")ncu launches / inspect → key = "launch:<idx>"ncu disasm → key = "kernel|<function_name>"; requested
launch id is echoed under data.auxiliary.row_idncu metrics (long form) → key = "launch:<idx>|counter:<name>"ncu metrics --per-launch → key = "launch:<idx>"ncu source-metrics --by line → key = "launch:<idx>|line:<file>:<line>"ncu source-metrics --by sass → key = "launch:<idx>|sass:0x<addr>"ncu source-metrics --by file → key = "launch:<idx>|file:<file>"ncu warp-stalls --by line → key = "launch:<idx>|line:<file>:<line>"ncu warp-stalls --by sass → key = "launch:<idx>|sass:0x<addr>"ncu warp-stalls --by reason → key = "launch:<idx>|reason:<stall_reason>"ncu sources → key = "source:<idx>"ncu ranges / graphs → key = "<kind>:<idx>"ncu metrics always keeps the primary list at data.rows[]; branch
on data.format ("long" vs "per_launch") before reading
long-only fields such as counter_name or wide-only fields such as
counters.
ncu inspect is partial-batch friendly: out-of-range, malformed, or
unsupported-kind row ids return success rows tagged type: "not_found".
Other NCU drill verbs may reject invalid row ids with handled diagnostic
errors.
Failure replaces data with error: { message, chain }. Parse
stdout, not stderr. veloq ncu schema <target> returns the
schemars-derived JSON Schema for any verb's response; schema targets are
the authoritative response field inventory.
Treat profiler numbers as evidence, not decoration:
ncu if needed.NCU is structured as a verb matrix that mirrors NSys's surface. All
trace-reading verbs share a per-report artifact root, <file>.veloq/,
built on first call; later calls deserialise cached data instead of
re-walking the report. ncu summary returns a slim totals overview;
the full per-launch metric list + rule findings live under ncu inspect;
cross-launch metric projection under ncu metrics; per-cubin disasm
under ncu disasm.
Start by classifying the kernel question:
| Symptom / question | Evidence path |
|---|---|
| "What's in this report?" | ncu summary → totals + session metadata; ncu launches for the per-launch headline list |
| "Why is this launch slow?" | ncu launches --kernel '<glob>' → pick launch:<idx> → ncu inspect --row-id launch:<idx> for the full metric list + rule findings |
| Low theoretical/achieved occupancy | ncu inspect --row-id launch:N (full metric list) or ncu metrics --counter '*occupancy*' → registers/thread, shared memory/block, block size |
| Memory throughput or poor coalescing | ncu metrics --counter 'dram__*' for a cross-launch comparison, or ncu inspect --row-id launch:N for the launch's full memory metrics |
| Warp stalls / scheduler issue | ncu warp-stalls --row-id launch:N --by line for the per-source-line stall-reason histogram (raw timed_warp_samples; --by reason for the kernel-wide breakdown, not_issued_samples for SM-issue stalls). Also ncu metrics --counter '*stall*' or ncu source-metrics --by line. |
| Instruction mix or pipe pressure | ncu metrics --counter 'sm__inst_*' (cross-launch) or ncu inspect --row-id launch:N |
| Source line suspected | ncu disasm --row-id launch:N for one launch's correlated SASS / PTX / source-index; pair with ncu inspect for the offending metric |
| Cross-launch regression | ncu metrics --counter '<glob>' long-form (one row per (launch, counter)) → jq diff between two reports by key |
| Kernel is slow only in one iteration | Use nsys-profile-analysis first to identify kernel:N; veloq nsys ncu-command T kernel:N --print can generate the native NCU rerun command |
| Need spreadsheet/terminal totals | ncu summary --format csv for a totals + session projection; use --format table for terminal review |
For a broad first pass:
veloq ncu summary report.ncu-rep for totals, then
veloq ncu launches report.ncu-rep --limit 100 for the
per-launch headline list. Filter with --kernel '<glob>' /
--nvtx-range '<glob>' / --grid WxHxD / --block WxHxD
to narrow the candidate set.veloq ncu inspect report.ncu-rep --row-id launch:<idx>. The
inspect response carries the launch's full metric list (each per-PC
instance placement-tagged) + rule findings; rule findings are NCU's
fastest bottleneck triage signal, verify against the named metrics.veloq ncu metrics report.ncu-rep --counter '<glob>'
returns one row per (launch, counter) pair — jq-friendly diff
shape. Compare two reports by INDEX(.data.rows; .key).veloq ncu disasm report.ncu-rep --row-id launch:<idx>
for SASS / PTX / source-line correlation on that launch's cubin.
Cached per-cubin under <file>.veloq/disasm/<sha>.correlated.json,
so second+ calls for the same cubin skip nvdisasm / cuobjdump.veloq ncu source-metrics report.ncu-rep --row-id launch:<idx> --counter '<glob>' --by line|sass|file. Joins per-PC MetricInstance
values with the DWARF source-line attribution from disasm so
"which lines have the most bank conflicts?" is one query. Run
veloq recipes source-line-hotspots (or source-instruction-walk
for the per-SASS drill) for the canonical invocation. Requires
the report to carry source counters (ncu --set source or --set full at capture time).ncu recapture/export workflows; see
references/limitations.md.Detailed kernel-analysis workflow notes: references/workflow.md
For spreadsheet or terminal review, ncu summary --format csv|table renders a totals + session projection (full flag detail
in veloq ncu summary --help); JSON emits the full payload. For
per-launch SASS / PTX / source-line correlation, use the dedicated
ncu disasm --row-id launch:<idx> — it is the only disasm entry
point, with a per-cubin cache.
All generated products live under the per-report artifact root,
<file>.veloq/. These files document cache behavior and cleanup only;
they are not the normal analysis API. Remove them with
veloq clean <file> when you need a fresh rebuild:
<file>.veloq/ncu-native.json.gz — the ncu_report-native sidecar
(v1 wire) and the single ingest path: summary / launches /
inspect / metrics / ranges / graphs / sources all read it.
Built once via the bundled ncu_report helper (NCU required at
build time only); invalidated on a sha256 content-hash of the
input report bytes (checkout-stable, so a committed sidecar serves
NCU-free).<file>.veloq/disasm/<sha>.correlated.json — per-cubin
SASS / PTX / source-line index from nvdisasm + cuobjdump. The cubin
is extracted from the report (embedded ELF); SHA-keyed so stale
entries are simply overwritten.Use veloq ncu to read and reshape existing .ncu-rep or .ncu-repz
evidence. Turn
to other tools when the next step requires new data or visual context:
ncu CLI: capture missing sections/metrics, replay kernels,
export official CSV pages, or use custom metric sets. When starting
from an NSys timeline row, veloq nsys ncu-command T kernel:N --print
can generate the initial native NCU command, but it still needs to be
reviewed and executed as a capture step.nsys-profile-analysis: determine whether the kernel matters
in the timeline, why it was launched late, or whether CPU/GPU overlap
is the real issue.Use ncu-profile-analysis for .ncu-rep / .ncu-repz and
kernel-internal metric
questions. Use nsys-profile-analysis for .nsys-rep / _pqtdir/
timeline questions, NVTX ranges, CPU↔GPU launch correlation, GPU idle
bubbles, and PM-counter time series.
references/analysis-dimensions.md (opens in a new tab)references/diagnosis-reference.md (opens in a new tab)references/limitations.md (opens in a new tab)references/metric-name-arch-notes.md (opens in a new tab)references/metrics-and-sections.md (opens in a new tab)references/report-template.md (opens in a new tab)references/workflow.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/nsys-profile-analysisAnalyze Nsight Systems `.nsys-rep` or `_pqtdir/` timeline traces using the VeloQ CLI. Use for GPU idle gaps, launch causes, CPU/GPU correlation, NVTX, CUDA graphs, metrics, sampling, and overlap/concurrency./pytorch-profile-analysisAnalyze single-file PyTorch/Kineto Chrome trace `.json(.gz)` files using the VeloQ CLI. Use for CPU/CUDA/kernel correlation, ProfilerStep/annotation slicing, memory/shape grouping, and single-trace NCCL evidence.npx claudepluginhub lucifer1004/veloq --plugin veloqOther plugins' skills for the same job