[vdi] Add device assertion support.

- Once device assertion occurs, abort the host execution as well.
- TODO: This's the initial support. As we need to drain hostcall queue
  to ensure device assertion message being flushed out, hostcall
  listener needs an interface to explicitly drain its queue.

Change-Id: I8a04400aa7109bfd054ae5777c41a4abbf0db4a9
This commit is contained in:
Michael LIAO
2020-04-21 17:09:17 -04:00
committed by Michael Hong Bin Liao
parent 43a8e929a2
commit 97f55b5c7f
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -1841,6 +1841,13 @@ void VirtualGPU::submitMigrateMemObjects(amd::MigrateMemObjectsCommand& vcmd) {
profilingEnd(vcmd);
}
static void callbackQueue(hsa_status_t status, hsa_queue_t* queue, void* data) {
if (status != HSA_STATUS_SUCCESS && status != HSA_STATUS_INFO_BREAK) {
// Abort on device exceptions.
abort();
}
}
bool VirtualGPU::createSchedulerParam()
{
if (nullptr != schedulerParam_) {
@@ -1856,7 +1863,7 @@ bool VirtualGPU::createSchedulerParam()
// The queue is written by multiple threads of the scheduler kernel
if (HSA_STATUS_SUCCESS != hsa_queue_create(gpu_device(), 2048, HSA_QUEUE_TYPE_MULTI,
nullptr, nullptr, std::numeric_limits<uint>::max(), std::numeric_limits<uint>::max(),
callbackQueue, this, std::numeric_limits<uint>::max(), std::numeric_limits<uint>::max(),
&schedulerQueue_)) {
break;
}