Skip to content

Commit b492023

Browse files
[L0] Fix hang on counter based events when regular commandlist from resets
Signed-off-by: Zhang, Winston <winston.zhang@intel.com>
1 parent 6e3be6f commit b492023

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

source/adapters/level_zero/context.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,9 @@ ur_result_t ur_context_handle_t_::getAvailableCommandList(
721721
// are still associated with another command list. We disable cache for
722722
// regular command list when counter based events are enabled to avoid race
723723
// condition.
724-
if (!Queue->CounterBasedEventsEnabled) {
724+
if (!Queue->CounterBasedEventsEnabled &&
725+
Queue->Device->useDriverInOrderLists() && Queue->isInOrderQueue() &&
726+
!Queue->UsingImmCmdLists) {
725727
// Initally, we need to check if a command list has already been created
726728
// on this device that is available for use. If so, then reuse that
727729
// Level-Zero Command List and Fence for this PI call.

source/adapters/level_zero/queue.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,10 @@ ur_result_t ur_queue_handle_t_::executeOpenCommandList(bool IsCopy) {
16441644
ur_result_t ur_queue_handle_t_::resetCommandList(
16451645
ur_command_list_ptr_t CommandList, bool MakeAvailable,
16461646
std::vector<ur_event_handle_t> &EventListToCleanup, bool CheckStatus) {
1647+
if (CounterBasedEventsEnabled && Device->useDriverInOrderLists() &&
1648+
isInOrderQueue() && !UsingImmCmdLists) {
1649+
return UR_RESULT_SUCCESS;
1650+
}
16471651
bool UseCopyEngine = CommandList->second.isCopy(this);
16481652

16491653
// Immediate commandlists do not have an associated fence.

0 commit comments

Comments
 (0)