| void Spices::NsightPerfGPUProfilerContinuous::Create | ( | VulkanState & | state | ) |
Begin this Session.
Initialize the periodic sampler.
Create the metrics evaluator.
transfer ownership to m_metricsEvaluator.
Create the config builder, this is used to create a counter configuration.
transfer pRawMetricsConfig's ownership to configBuilder.
Add metrics into config builder.
By setting "keepInstances" to false, the counter data will only store GPU-level values, reducing its size and improving the performance of metric evaluation. However, this option has the drawback of making max/min submetrics non-evaluable.
Create the counter configuration out of the config builder.
Periodic sampler supports only single-pass configurations, meaning that all scheduled metrics must be collectable in a single pass.
Initialize the counter data Below setting determines the maximum size of a counter data image. However, because the counter data here is requested to work in the ring buffer mode, when the put pointer reaches the end, it will start from the beginning and overwrite previous data even if it hasn't been read yet. Therefore, the size specified here must be sufficient to cover the latency.
Update the metrics evaluator with the actual device's attributes stored in the counter data.
Output the header in CSV format.
Start a periodic sampler session.
Apply the previously generated counter configuration to the periodic sampler.
Start sampling. Ideally, sampling should only start right before executing the target workloads to prevent the record buffer from being occupied by records generated by GPU triggers before the target workloads. However, in this use case, it is acceptable because the trigger source is set to "NVPW_GPU_PERIODIC_SAMPLER_TRIGGER_SOURCE_GPU_ENGINE_TRIGGER", which doesn't automatically generate GPU triggers but relies on clients manually pushing triggers through the command list. Furthermore, since the metric configuration used is for low-speed sampling, no "overflow prevention records" will be emitted.
Set InSession true.
Initialize the periodic sampler.
Create the metrics evaluator.
transfer ownership to m_metricsEvaluator.
Create the config builder, this is used to create a counter configuration.
transfer pRawMetricsConfig's ownership to configBuilder.
Add metrics into config builder.
By setting "keepInstances" to false, the counter data will only store GPU-level values, reducing its size and improving the performance of metric evaluation. However, this option has the drawback of making max/min submetrics non-evaluable.
Create the counter configuration out of the config builder.
Periodic sampler supports only single-pass configurations, meaning that all scheduled metrics must be collectable in a single pass.
Initialize the counter data Below setting determines the maximum size of a counter data image. However, because the counter data here is requested to work in the ring buffer mode, when the put pointer reaches the end, it will start from the beginning and overwrite previous data even if it hasn't been read yet. Therefore, the size specified here must be sufficient to cover the latency.
Update the metrics evaluator with the actual device's attributes stored in the counter data.
Output the header in CSV format.
Start a periodic sampler session.
Apply the previously generated counter configuration to the periodic sampler.
Start sampling. Ideally, sampling should only start right before executing the target workloads to prevent the record buffer from being occupied by records generated by GPU triggers before the target workloads. However, in this use case, it is acceptable because the trigger source is set to "NVPW_GPU_PERIODIC_SAMPLER_TRIGGER_SOURCE_GPU_ENGINE_TRIGGER", which doesn't automatically generate GPU triggers but relies on clients manually pushing triggers through the command list. Furthermore, since the metric configuration used is for low-speed sampling, no "overflow prevention records" will be emitted.
Set InSession true.
Definition at line 59 of file NsightPerfGPUProfilerContinuous.cpp.
References m_IsInSession.
Referenced by BeginFrame(), and NsightPerfGPUProfilerContinuous().