SWDEV-510319 - Fixed random segfaults in graph tests

This change fixes random segfaults in graph tests that
are seen after the change make internal callbacks non-blocking.
The callback thread that decreases the GraphExec ref count
may now run after the runtime shutdown. This can cause a segfault
because the hip::device that is accessed in GraphExec destructor
is already destroyed during runtime shutdown. This patch ensures
that the hip::device object  stays alive until after the
callback thread completes.

Change-Id: I75a6ac01f27a0b2250bbd10ed389ebfb322927af


[ROCm/clr commit: 21c223f8df]
This commit is contained in:
Ioannis Assiouras
2025-01-22 02:40:10 +00:00
parent e3c4a81b69
commit 8169855390
3 ha cambiato i file con 7 aggiunte e 5 eliminazioni
@@ -363,6 +363,7 @@ hipError_t GraphExec::Init() {
status = CaptureAQLPackets();
}
instantiateDeviceId_ = hip::getCurrentDevice()->deviceId();
static_cast<ReferenceCountedObject*>( hip::getCurrentDevice())->retain();
return status;
}