diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index dd2ead4937..fcd7cfd02e 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -1262,10 +1262,6 @@ hipError_t hipGraphInstantiate(hipGraphExec_t* pGraphExec, hipGraph_t graph, hipError_t status = ihipGraphInstantiate(&ge, reinterpret_cast(graph)); if (status == hipSuccess) { *pGraphExec = reinterpret_cast(ge); - if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) { - // For graph nodes capture AQL packets to dispatch them directly during graph launch. - status = ge->CaptureAQLPackets(); - } } HIP_RETURN(status); } diff --git a/projects/clr/hipamd/src/hip_graph_internal.cpp b/projects/clr/hipamd/src/hip_graph_internal.cpp index c164a8c55a..f0f9e71ce5 100644 --- a/projects/clr/hipamd/src/hip_graph_internal.cpp +++ b/projects/clr/hipamd/src/hip_graph_internal.cpp @@ -344,11 +344,18 @@ hipError_t GraphExec::Init() { for (auto& node : topoOrder_) { status = node->GetNumParallelStreams(min_num_streams); - if(status != hipSuccess) { + if (status != hipSuccess) { return status; } } status = CreateStreams(parallelLists_.size() - 1 + min_num_streams); + if (status != hipSuccess) { + return status; + } + if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) { + // For graph nodes capture AQL packets to dispatch them directly during graph launch. + status = CaptureAQLPackets(); + } return status; }