diff --git a/hipamd/src/hip_graph.cpp b/hipamd/src/hip_graph.cpp index 1cc286ec15..a851ee3348 100644 --- a/hipamd/src/hip_graph.cpp +++ b/hipamd/src/hip_graph.cpp @@ -1144,7 +1144,9 @@ hipError_t hipStreamGetCaptureInfo(hipStream_t stream, hipStreamCaptureStatus* p } hip::Stream* s = reinterpret_cast(stream); *pCaptureStatus = s->GetCaptureStatus(); - *pId = s->GetCaptureID(); + if (*pCaptureStatus == hipStreamCaptureStatusActive) { + *pId = s->GetCaptureID(); + } HIP_RETURN(hipSuccess); }