From a60212b9b47cc5f05421d8078fb467d7b41b6e46 Mon Sep 17 00:00:00 2001 From: "Patel, Jaydeepkumar" Date: Wed, 25 Jun 2025 20:59:17 +0530 Subject: [PATCH] SWDEV-536226 - Avoid waiting for lastCommand completion if GPU has already reported an error otherwise it causes hang due to status of cmd is not becoming CL_COMPLETE. (#478) --- rocclr/platform/commandqueue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rocclr/platform/commandqueue.cpp b/rocclr/platform/commandqueue.cpp index 1e150f08c7..1f47483bdd 100644 --- a/rocclr/platform/commandqueue.cpp +++ b/rocclr/platform/commandqueue.cpp @@ -79,7 +79,9 @@ bool HostQueue::terminate() { lastCommand = command; } } - lastCommand->awaitCompletion(); + if (device_.gpu_error_ == CL_SUCCESS) { + lastCommand->awaitCompletion(); + } // Note that if lastCommand isn't a marker, it may not be lastEnqueueCommand_ now // after lastCommand->awaitCompletion() is called. if (lastEnqueueCommand_ != nullptr) {