diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 744d8bf072..82d2c71167 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -363,13 +363,15 @@ AqlQueue::~AqlQueue() { } // Remove kfd exception handler - exceptionState |= ERROR_HANDLER_TERMINATE; - while ((exceptionState & ERROR_HANDLER_DONE) != ERROR_HANDLER_DONE) { - const uint64_t timeout_ms = 5000; + if (core::Runtime::runtime_singleton_->KfdVersion().supports_exception_debugging) { + exceptionState |= ERROR_HANDLER_TERMINATE; + while ((exceptionState & ERROR_HANDLER_DONE) != ERROR_HANDLER_DONE) { + const uint64_t timeout_ms = 5000; - exception_signal_->StoreRelease(-1ull); - exception_signal_->WaitRelaxed(HSA_SIGNAL_CONDITION_NE, -1ull, timeout_ms, - HSA_WAIT_STATE_BLOCKED); + exception_signal_->StoreRelease(-1ull); + exception_signal_->WaitRelaxed(HSA_SIGNAL_CONDITION_NE, -1ull, timeout_ms, + HSA_WAIT_STATE_BLOCKED); + } } Inactivate();