PC Sampling: Disable coredump when sessions active

When doing a coredump, we try to park the wave and save its PC in
ttmp7/ttmp11, but these registers will be overwritten by PC Sampling
requests.

Change-Id: I60fb734eb3bed4ee3cc8d8bba9ec4a527fff9671
This commit is contained in:
David Yat Sin
2024-03-28 18:45:28 +00:00
orang tua 49e56ce782
melakukan 3443fdf665
4 mengubah file dengan 16 tambahan dan 4 penghapusan
@@ -1272,8 +1272,11 @@ bool AqlQueue::ExceptionHandler(hsa_signal_value_t error_code, void* arg) {
// generated by hsa-runtime.
if (!core::Runtime::runtime_singleton_->KfdVersion().supports_core_dump &&
queue->agent_->isa()->GetMajorVersion() != 11) {
if (amd::coredump::dump_gpu_core())
debug_print("GPU core dump failed\n");
if (pcs::PcsRuntime::instance()->SessionsActive())
fprintf(stderr, "GPU core dump skipped because PC Sampling active\n");
else if (amd::coredump::dump_gpu_core())
fprintf(stderr, "GPU core dump failed\n");
// supports_core_dump flag is overwritten to avoid generate core dump file again
// caught by a different exception handler. Such as VMFaultHandler.
core::Runtime::runtime_singleton_->KfdVersion(
@@ -1804,8 +1804,11 @@ bool Runtime::VMFaultHandler(hsa_signal_value_t val, void* arg) {
// generated by hsa-runtime.
if (faulty_agent && faulty_agent->isa()->GetMajorVersion() != 11 &&
!runtime_singleton_->KfdVersion().supports_core_dump) {
if (amd::coredump::dump_gpu_core())
debug_print("GPU core dump failed\n");
if (pcs::PcsRuntime::instance()->SessionsActive())
fprintf(stderr, "GPU core dump skipped because PC Sampling active\n");
else if (amd::coredump::dump_gpu_core())
fprintf(stderr, "GPU core dump failed\n");
}
assert(false && "GPU memory access fault.");
std::abort();