rocprofiler-pc-sampling
Installation
SKILL.md
PC Sampling
Prerequisites
- The system must have a ROCm installation and an accessible AMD GPU; that is,
amd-smishould return at least one valid device. - The GPU must support PC sampling. Available PC sampling configurations can be determined via
rocprofv3-avail info --pc-samplingorrocprofv3 -L. Your sampling method and interval must align with the outputs of this command. Also pay attention to any flags reported for a given configuration; at time of writing, stochastic sampling intervals must be powers of two. - The application should be built with debug symbols AND optimization flags (e.g.
-g -O3) in order to get source line attribution and a representative execution profile.
How to use PC Sampling
To run rocprofv3 with PC sampling:
- explicitly enable pc sampling with the flag
--pc-sampling-beta-enabled. - specify the pc sampling method with
--pc-sampling-method:host_traporstochastic - specify the interval unit for the sampling with
--pc-sampling-unit:timefor host_trap andcyclesfor stochastic - specify the sampling interval with
--pc-sampling-interval: an integer representing microseconds if you specifiedtimeor cycles if you specifiedcycles. - add the
--kernel-traceflag to track kernel launches for attribution - specify either the
jsonorcsvoutput format with--output-format; the default output format,rocpd, does not currently support PC sampling output.