2
3
4
5
22
23
24 m_NvPerf.outputOptions.directoryName = SPICES_GPUPROFILEREPORT_PATH;
25 m_NvPerf.outputOptions.writeCounterConfigImage =
true;
26 m_NvPerf.outputOptions.writeCounterDataImage =
true;
27 m_NvPerf.outputOptions.appendDateTimeToDirName = nv::perf::AppendDateTime::yes;
28 m_NvPerf.outputOptions.enableCsvReport =
false;
31
32
33
34
35 m_NvPerf.additionalMetrics = {
36 "zrop__cycles_elapsed",
37 "lts__t_sector_hit_rate",
38 "crop__write_throughput"
40 NSPERF_CHECK(m_NvPerf.InitializeReportGenerator(state.m_Instance, state.m_PhysicalDevice, state.m_Device))
41 m_NvPerf.SetFrameLevelRangeName(
"Frame");
42 m_NvPerf.SetNumNestingLevels(10);
43 m_NvPerf.SetMaxNumRanges(100);
44 m_NvPerf.SetOpenReportDirectoryAfterCollection(
true);
47
48
49 m_ClockStatus = nv::perf::VulkanGetDeviceClockState(
51 state.m_PhysicalDevice ,
57 state.m_PhysicalDevice ,
59 NVPW_DEVICE_CLOCK_SETTING_LOCK_TO_RATED_TDP
67 if (!m_NsightPerfGPUProfilerReportGenerator)
69 m_NsightPerfGPUProfilerReportGenerator = std::make_shared<NsightPerfGPUProfilerReportGenerator>(state);
79 if (m_NvPerf.IsCollectingReport())
82
83
84
85
86 VK_CHECK(vkDeviceWaitIdle(state.m_Device))
87 SPICES_CORE_INFO(
"Nsight Perf: Report Generator is sampling.");
89 else if (m_NvPerf.GetInitStatus() != nv::perf::profiler::ReportGeneratorInitStatus::Succeeded)
91 SPICES_CORE_ERROR(
"Nsight Perf: Report Generator UnKnown failed.");
100 NSPERF_CHECK(m_NvPerf.OnFrameStart(queue, queueFamilyIndex))
107 NSPERF_CHECK(m_NvPerf.rangeCommands.PushRange(commandBuffer, pRangeName.c_str()))
114 NSPERF_CHECK(m_NvPerf.rangeCommands.PopRange(commandBuffer))
122 NSPERF_CHECK(nv::perf::VulkanSetDeviceClockState(state.m_Instance, state.m_PhysicalDevice, state.m_Device, m_ClockStatus))
#define NSPERF_CHECK(val)
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
static std::shared_ptr< NsightPerfGPUProfilerReportGenerator > m_NsightPerfGPUProfilerReportGenerator
This Single Instance.
void BeginFrame(VkQueue queue, uint32_t queueFamilyIndex)
Begin a Frame. OnFrameStart and OnFrameEnd will not perform any operation until collection is initiat...
void EndFrame(VulkanState &state)
End a Frame. The vkQueueWaitIdle() call in the code sequence above is a workaround for a driver/OS is...
void CollectionNextFrame()
Capture next frame and generate report.
static void CreateInstance(VulkanState &state)
Create this Single Instance.
void Reset(VulkanState &state)
Reset Reporter.
void PushRange(VkCommandBuffer commandBuffer, const std::string &pRangeName) const
Struct VulkanRangeCommands provides a reliable set of function pointers, that are safe to call on any...
NsightPerfGPUProfilerReportGenerator(VulkanState &state)
Constructor Function.
void PopRange(VkCommandBuffer commandBuffer) const
Pop Range.
bool m_CapturedThisFrame
true if captured this frame.
Wrapper of Nvidia NsightPerf GPU Performance ReportGenerator.
This struct contains all Vulkan object in used global.