Register the default queue error handler for all internal queues.

Also make failure to handle queue errors fatal.

Motivation is to improve detection of queue error conditions
that currently appear as application hangs.

Change-Id: I655643616dc0bd303d7df3ce8aca2c099bec3d46


[ROCm/ROCR-Runtime commit: 907679c989]
Этот коммит содержится в:
Sean Keely
2021-08-05 14:44:08 -05:00
родитель 2692cac562
Коммит f6dcfa4246
3 изменённых файлов: 15 добавлений и 4 удалений
+10 -2
Просмотреть файл
@@ -332,8 +332,16 @@ class GpuAgent : public GpuAgentInt {
static const uint32_t minAqlSize_ = 0x1000; // 4KB min
static const uint32_t maxAqlSize_ = 0x20000; // 8MB max
// @brief Create a queue through HSA API to allow tools to intercept.
core::Queue* CreateInterceptibleQueue();
// @brief Create an internal queue allowing tools to be notified.
core::Queue* CreateInterceptibleQueue() {
return CreateInterceptibleQueue(core::Queue::DefaultErrorHandler, nullptr);
}
// @brief // @brief Create an internal queue, with a custom error handler, allowing tools to be
// notified.
core::Queue* CreateInterceptibleQueue(void (*callback)(hsa_status_t status, hsa_queue_t* source,
void* data),
void* data);
// @brief Create SDMA blit object.
//
+4 -2
Просмотреть файл
@@ -533,10 +533,12 @@ hsa_status_t GpuAgent::VisitRegion(
return HSA_STATUS_SUCCESS;
}
core::Queue* GpuAgent::CreateInterceptibleQueue() {
core::Queue* GpuAgent::CreateInterceptibleQueue(void (*callback)(hsa_status_t status,
hsa_queue_t* source, void* data),
void* data) {
// Disabled intercept of internal queues pending tools updates.
core::Queue* queue = nullptr;
QueueCreate(minAqlSize_, HSA_QUEUE_TYPE_MULTI, NULL, NULL, 0, 0, &queue);
QueueCreate(minAqlSize_, HSA_QUEUE_TYPE_MULTI, callback, data, 0, 0, &queue);
if (queue != nullptr)
core::Runtime::runtime_singleton_->InternalQueueCreateNotify(core::Queue::Convert(queue),
this->public_handle());
+1
Просмотреть файл
@@ -54,6 +54,7 @@ void Queue::DefaultErrorHandler(hsa_status_t status, hsa_queue_t* source, void*
const char* msg = "UNKNOWN ERROR";
HSA::hsa_status_string(status, &msg);
fprintf(stderr, "Queue at %p inactivated due to async error:\n\t%s\n", source, msg);
abort();
}
}