SWDEV-352197 - Destroy virtual device in thread destructor

Windows kills threads on exit without any notification. However,
runtime can still destroy VirtualGPU object from the host thread with
HostQueue destruction.
This change also forces RGP trace transfer on the last capture without
any delays.

Change-Id: I768e87e99e1d23a021e63c12f36e450817743759
Tento commit je obsažen v:
German
2023-01-30 13:11:14 -05:00
odevzdal German Andryeyev
rodič 054ab2d4ae
revize ad33a021cb
4 změnil soubory, kde provedl 28 přidání a 10 odebrání
+15
Zobrazit soubor
@@ -278,6 +278,21 @@ void RgpCaptureMgr::PostDispatch(VirtualGPU* gpu) {
// continue until we find the right queue...
} else if (Pal::Result::Success == res) {
trace_.sqtt_disp_count_ = 0;
// Stop the trace and save the result. Currently runtime can't delay upload in HIP,
// because default stream doesn't have explicit destruction and
// OS kills all threads on exit without any notification. That includes PAL RGP threads.
{
if (trace_.status_ == TraceStatus::WaitingForSqtt) {
auto result = EndRGPTrace(gpu);
}
// Check if runtime is waiting for the final trace results
if (trace_.status_ == TraceStatus::WaitingForResults) {
// If results are ready, then finish the trace
if (CheckForTraceResults() == Pal::Result::Success) {
FinishRGPTrace(gpu, false);
}
}
}
} else {
FinishRGPTrace(gpu, true);
}