Skip to content

Commit

Permalink
feature: events deadlock detection in validation layer
Browse files Browse the repository at this point in the history
Related-To: NEO-12810

Signed-off-by: Chandio, Bibrak Qamar <[email protected]>
  • Loading branch information
bibrak committed Nov 4, 2024
1 parent fbff0cb commit 00217b0
Show file tree
Hide file tree
Showing 5 changed files with 455 additions and 48 deletions.
8 changes: 4 additions & 4 deletions samples/zello_events_deadlock/zello_events_deadlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ int main(int argc, char *argv[]) {
<< std::endl;

// Action_0: Host to Device, is dependent on a future action called Action_2 (see below).
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(command_list, device_mem_ptr, host_mem_ptr, buffer_size, event[0], 1 /* 1 */, &event[2] /* &start_event */));
// SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(command_list, device_mem_ptr, host_mem_ptr, buffer_size, event[0], 0, nullptr));
// SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(command_list, device_mem_ptr, host_mem_ptr, buffer_size, event[0], 1 /* 1 */, &event[2] /* &start_event */));
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(command_list, device_mem_ptr, host_mem_ptr, buffer_size, event[0], 0, nullptr));
std::cout << std::endl
<< std::endl;

Expand All @@ -214,7 +214,7 @@ int main(int argc, char *argv[]) {
<< std::endl;

// Action_2: Host to Device, is dependent on Action_1. It also creates a deadlock by having Action_0 dependent on it.
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(command_list, device_mem_ptr, host_mem_ptr, buffer_size, event[2], 1, &event[1]));
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(command_list, device_mem_ptr, host_mem_ptr, buffer_size, nullptr /* event[2] */, 1, &event[1]));
std::cout << std::endl
<< std::endl;

Expand All @@ -233,7 +233,7 @@ int main(int argc, char *argv[]) {
SUCCESS_OR_TERMINATE(zeCommandQueueCreate(context, pDevice, &command_queue_description, &command_queue));

// This segfaults. TODO!!! Fix
// SUCCESS_OR_TERMINATE(zeCommandQueueExecuteCommandLists(command_queue, 1, &command_list, nullptr));
SUCCESS_OR_TERMINATE(zeCommandQueueExecuteCommandLists(command_queue, 1, &command_list, nullptr));

SUCCESS_OR_TERMINATE(zeCommandQueueSynchronize(command_queue, UINT64_MAX));

Expand Down
Loading

0 comments on commit 00217b0

Please sign in to comment.