You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/rocr-runtime/files/rocr-runtime-2.8.0-fix_door...

58 lines
2.3 KiB

https://github.com/RadeonOpenCompute/ROCR-Runtime/pull/71
From d2a6ad97eb96a28d8f8b658b26ab94e911886cf2 Mon Sep 17 00:00:00 2001
From: Sean Keely <Sean.Keely@amd.com>
Date: Thu, 5 Sep 2019 20:58:57 -0500
Subject: [PATCH] Correct doorbell_queue_map allocation.
doorbell_queue_map should be allocated unconditionally.
---
core/runtime/amd_gpu_agent.cpp | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/core/runtime/amd_gpu_agent.cpp b/core/runtime/amd_gpu_agent.cpp
index 9b79a6b..76df913 100644
--- a/core/runtime/amd_gpu_agent.cpp
+++ b/core/runtime/amd_gpu_agent.cpp
@@ -1182,12 +1182,22 @@ void GpuAgent::SyncClocks() {
}
void GpuAgent::BindTrapHandler() {
+ // Make an empty map from doorbell index to queue.
+ // The trap handler uses this to retrieve a wave's amd_queue_t*.
+ auto doorbell_queue_map_size = MAX_NUM_DOORBELLS * sizeof(amd_queue_t*);
+
+ doorbell_queue_map_ = (amd_queue_t**)core::Runtime::runtime_singleton_->system_allocator()(
+ doorbell_queue_map_size, 0x1000, 0);
+ assert(doorbell_queue_map_ != NULL && "Doorbell queue map allocation failed");
+
+ memset(doorbell_queue_map_, 0, doorbell_queue_map_size);
+
if (isa_->GetMajorVersion() == 7) {
// No trap handler support on Gfx7, soft error.
return;
}
- // Disable trap handler on Carrizo until KFD is fixed.
+ // Disable trap handler on APUs until KFD is fixed.
if (profile_ == HSA_PROFILE_FULL) {
return;
}
@@ -1195,16 +1205,6 @@ void GpuAgent::BindTrapHandler() {
// Assemble the trap handler source code.
AssembleShader("TrapHandler", AssembleTarget::ISA, trap_code_buf_, trap_code_buf_size_);
- // Make an empty map from doorbell index to queue.
- // The trap handler uses this to retrieve a wave's amd_queue_t*.
- auto doorbell_queue_map_size = MAX_NUM_DOORBELLS * sizeof(amd_queue_t*);
-
- doorbell_queue_map_ = (amd_queue_t**)core::Runtime::runtime_singleton_->system_allocator()(
- doorbell_queue_map_size, 0x1000, 0);
- assert(doorbell_queue_map_ != NULL && "Doorbell queue map allocation failed");
-
- memset(doorbell_queue_map_, 0, doorbell_queue_map_size);
-
// Bind the trap handler to this node.
HSAKMT_STATUS err = hsaKmtSetTrapHandler(node_id(), trap_code_buf_, trap_code_buf_size_,
doorbell_queue_map_, doorbell_queue_map_size);