From 1772d866c9636faa996bb790a6c78775a05549df Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Tue, 13 Jun 2023 12:58:44 -0400 Subject: [PATCH] Soften trap handler loading failure when exception handling not supported GFX11 and up including some GFX9 devices will not support old trap handling without the new exception handling. Instead of a hard assert failure that runs into a core dump, let ROCr initialization continue instead. Change-Id: I309becdc72ef4fb2fafd118c1faf0801407e658e [ROCm/ROCR-Runtime commit: bfb94b3b6e21fc061519ca41a3e0cba947729158] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 692ec8ba03..330aa81d21 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -1738,6 +1738,12 @@ void GpuAgent::BindTrapHandler() { AssembleShader("TrapHandlerKfdExceptions", AssembleTarget::ISA, trap_code_buf_, trap_code_buf_size_); } else { + if (isa_->GetMajorVersion() >= 11 || + (isa_->GetMajorVersion() == 9 && isa_->GetMinorVersion() == 4)) { + // No trap handler support without exception handling, soft error. + return; + } + AssembleShader("TrapHandler", AssembleTarget::ISA, trap_code_buf_, trap_code_buf_size_); // Make an empty map from doorbell index to queue.