Collect and view SPM counters#
2026-08-18
2 min read time
ROCprof Compute Viewer (RCV) can load rocprofv3 Streaming Performance Monitor (SPM) JSON output either by itself or alongside a matching SQTT trace.
Collect SPM#
Always include SQ_CYCLES. RCV uses it to:
convert each XCC’s SPM timestamps into shader-clock cycles;
follow shader-clock frequency changes;
identify and reconstruct accumulated missing sample windows.
For example:
rocprofv3 --spm-beta-enabled \
--spm SQ_CYCLES SQ_WAVES TCP_TOTAL_CACHE_ACCESSES \
--spm-sample-interval-unit sclk_cycles \
--spm-sample-interval 4096 \
--output-format json -- ./application
The supported counters and sample-interval range depend on the GPU and ROCm
version. Use rocprofv3-avail list --spm-config and
rocprofv3-avail list --spm to inspect them.
Attach SPM to SQTT#
Load the matching rocprofv3 UI output directory or raw
.atttrace.Go to Import > SPM JSON….
Select the rocprofv3 results JSON containing the SPM collection.
The SQTT input must contain realtime records (realtime.json or decoder
REALTIME records). RCV aligns every XCC independently using the first SQTT
realtime anchor and SQ_CYCLES.
If the realtime ranges do not overlap, RCV displays a warning but still performs the alignment.
Open standalone SPM#
Use Import > SPM JSON…, or pass the JSON file on the command line:
./rocprof-compute-viewer results.json
Without SQTT realtime anchors, the plot uses timestamps relative to the first SPM timestamp rather than aligned shader-clock cycles.
Plot behavior#
XCC, shader engine, and hardware instance are tensor dimensions.
RCV sums the SE and instance dimensions for plotting.
XCC clocks remain independent. Combined curves update whenever any XCC advances and keep the last value from the other XCCs.
Missing hardware windows accumulated into a later sample are divided evenly across reconstructed windows.
Derived counters#
SPM definitions can reference:
the raw SPM counter names;
SCLOCK: the aligned per-XCC shader-clock sample endpoints;SPM_CLOCK: the original per-XCC timestamp deltas.
For example:
WAVES_PER_CYCLE := SQ_WAVES / SQ_CYCLES
XCC2_WAVES := select[SQ_WAVES, 2, axis=XCC]
SE and CU/instance dimensions are automatically summed when a result is plotted.
Note
Loading SPM data from ROCpd is not implemented yet.