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
Cette révision appartient à :
Ioannis Assiouras a révisé 2025-01-25 09:54:15 -05:00
1 Parent c460b0541b
révision 21c223f8df
3 fichiers modifiés
+7 -5

Aucun fichier ne correspond à votre recherche

+3 -1
Voir le fichier
@@ -235,11 +235,13 @@ bool HsaAmdSignalHandler(hsa_signal_value_t value, void* arg) {
// Reset last used SDMA engine mask
gpu->setLastUsedSdmaEngine(0);
bool isBlocking = ts->GetBlocking();
// Update the batch, since signal is complete
gpu->updateCommandsState(ts->command().GetBatchHead());
// Reset API callback signal. It will release AQL queue and start commands processing
if (callback_signal.handle != 0 && ts->GetBlocking()) {
if (callback_signal.handle != 0 && isBlocking) {
hsa_signal_subtract_relaxed(callback_signal, 1);
}