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
이 커밋은 다음에 포함됨:
Sean Keely
2021-08-05 14:44:08 -05:00
부모 9e7d4629ca
커밋 907679c989
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();
}
}