SpiecsEngine
 
Loading...
Searching...
No Matches

◆ EndFrame()

void Spices::NsightPerfGPUProfilerOneshotCollection::EndFrame ( )

End a Frmae.

End this frame.

ResolveQueries.

Write traces to files.

Open timelineview

Clear and Reset.

Do not want to capture next frame.

Debug Status.

End this frame.

ResolveQueries.

Write traces to files.

Open timelineview

Clear and Reset.

Do not want to capture next frame.

Debug Status.

Definition at line 143 of file NsightPerfGPUProfilerOneshotCollection.cpp.

144 {
146
151
152 if (!m_OutputDirectory.empty())
153 {
157 std::vector<nv::perf::mini_trace::APITraceData> apiTraceData;
158 for (auto& apiTracer : m_ApiTracers)
159 {
160 NSPERF_CHECK(apiTracer.ResolveQueries(apiTraceData))
161 }
162
166 const std::string yamlText = SerializeAPITraceDataToYaml(apiTraceData);
167 const std::string filename = std::string(m_OutputDirectory) + NV_PERF_PATH_SEPARATOR + "traces.yaml";
168 std::ofstream file(filename);
169 if (file.is_open())
170 {
171 file << yamlText;
172 }
173 else
174 {
175 std::stringstream ss;
176 ss << "Failed to open file: " << filename;
177 SPICES_CORE_WARN(ss.str());
178 }
179
183 std::stringstream ss;
184 ss << SPICES_EXTENT_PROCESS_PATH << "TimelineViewer/TimelineViewer.exe";
185 ProcessLibrary::OpenProcess(ss.str().c_str());
186
191 Reset();
192 SPICES_CORE_INFO("Nsight Perf: One-Shot sampling Finished.");
193 }
194
199 {
201 }
202
206 SamplerStatus samplerStatus = m_PeriodicSamplerOneShot.GetSamplerStatus();
207 if (samplerStatus == SamplerStatus::Failed)
208 {
209 SPICES_CORE_ERROR("Nsight Perf: Failed to initialize");
210 }
211 else if (samplerStatus == SamplerStatus::Sampling)
212 {
213 SPICES_CORE_INFO("Nsight Perf: One-Shot is sampling.");
214 }
215 }
#define NSPERF_CHECK(val)
#define SPICES_PROFILE_ZONE
nv::perf::sampler::PeriodicSamplerOneShotVulkan::SamplerStatus SamplerStatus
std::vector< nv::perf::mini_trace::APITracerVulkan > m_ApiTracers
APITracerVulkan Per FlightFrame.
nv::perf::sampler::PeriodicSamplerOneShotVulkan m_PeriodicSamplerOneShot
PeriodicSamplerOneShotVulkan.
static bool OpenProcess(const char *processPath, const char *commandLine="")
Open a Process with command.

References m_EnableCaptureNextFrame, m_IsInSession, m_OutputDirectory, Spices::ProcessLibrary::OpenProcess(), and Reset().