File: 0006-initialize-chip-revision.patch

package info (click to toggle)
rocr-runtime 6.4.3%2Bdfsg-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 12,176 kB
  • sloc: cpp: 127,122; ansic: 41,837; lisp: 1,225; asm: 975; sh: 452; python: 117; makefile: 57
file content (37 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Sun, 17 Mar 2024 23:35:58 -0600
Subject: initialize chip revision

This patch fixes assertions on Rembrandt hardware. There are checks
that the chip revision is valid and will fail without this patch. I'm
not sure how this chip revision data gets initialized for other
architectures, but this is where the data is initialized for Rembrandt.

Bug-Debian: https://bugs.debian.org/1065410
---
 runtime/hsa-runtime/image/image_manager_kv.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/runtime/hsa-runtime/image/image_manager_kv.cpp
+++ b/runtime/hsa-runtime/image/image_manager_kv.cpp
@@ -97,6 +97,11 @@
       agent_, static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID), &family_type_);
   assert(status == HSA_STATUS_SUCCESS);
 
+  uint32_t chip_revision;
+  status = HSA::hsa_agent_get_info(
+      agent_, static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_ASIC_REVISION), &chip_revision);
+  assert(status == HSA_STATUS_SUCCESS);
+
   HsaGpuTileConfig tileConfig = {0};
   unsigned int tc[40];
   unsigned int mtc[40];
@@ -125,7 +130,7 @@
   }
 
   addr_create_input.chipFamily = family_type_;
-  addr_create_input.chipRevision = 0;  // TODO(bwicakso): find how to get this.
+  addr_create_input.chipRevision = chip_revision;
 
   ADDR_CREATE_FLAGS create_flags = {};
   create_flags.value = 0;