[SWDEV-481004] Fix for incorrect gfx_version number (#8)
The target_graphics_version was not formatted properly and was showing incorrect Target Name. Corrected this by fomatting major, minor and revision numbers. Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>
This commit is contained in:
gecommit door
Charis Poag
bovenliggende
685c057acb
commit
6337f7b05b
@@ -48,6 +48,8 @@ $ rocm-smi --showmetrics
|
||||
|
||||
### Resolved issues
|
||||
|
||||
- **Fixed `rsmi_dev_target_graphics_version_get`, `rocm-smi --showhw`, and `rocm-smi --showprod` not displaying graphics version properly for MI2x, MI1x or Navi 3x ASICs.**
|
||||
|
||||
### Upcoming changes
|
||||
|
||||
## rocm_smi_lib for ROCm 6.3
|
||||
|
||||
@@ -397,11 +397,8 @@ def getTargetGfxVersion(device, silent=False):
|
||||
target_graphics_version = c_uint64()
|
||||
gfx_ver_ret = "N/A"
|
||||
ret = rocmsmi.rsmi_dev_target_graphics_version_get(device, byref(target_graphics_version))
|
||||
target_graphics_version = str(target_graphics_version.value)
|
||||
target_graphics_version = hex(target_graphics_version.value)[2:]
|
||||
if rsmi_ret_ok(ret, device, 'get_target_gfx_version', silent=silent):
|
||||
if target_graphics_version == "9010":
|
||||
hex_part = str(hex(int(str(target_graphics_version)[2:]))).replace("0x", "")
|
||||
target_graphics_version = str(target_graphics_version)[:2] + hex_part
|
||||
gfx_ver_ret = "gfx" + str(target_graphics_version)
|
||||
return gfx_ver_ret
|
||||
|
||||
|
||||
@@ -5365,7 +5365,7 @@ rsmi_status_t rsmi_dev_target_graphics_version_get(uint32_t dv_ind,
|
||||
}
|
||||
if (ret == RSMI_STATUS_SUCCESS) {
|
||||
version = amd::smi::removeString(version, "gfx");
|
||||
*gfx_version = std::stoull(version);
|
||||
*gfx_version = uint64_t(std::stoull(version, nullptr, 16));
|
||||
}
|
||||
ss << __PRETTY_FUNCTION__
|
||||
<< " | ======= end ======= "
|
||||
|
||||
@@ -1193,11 +1193,13 @@ rsmi_status_t rsmi_get_gfx_target_version(uint32_t dv_ind, std::string *gfx_vers
|
||||
// separate out parts -> put back into normal graphics version format
|
||||
major = static_cast<uint64_t>((orig_target_version / 10000) * 100);
|
||||
minor = static_cast<uint64_t>((orig_target_version % 10000 / 100) * 10);
|
||||
if ((minor == 0) && (countDigit(major) < 4)) {
|
||||
major *= 10; // 0 as a minor is correct, but bump up by 10
|
||||
}
|
||||
rev = static_cast<uint64_t>(orig_target_version % 100);
|
||||
*gfx_version = "gfx" + std::to_string(major + minor + rev);
|
||||
|
||||
ss << std::hex << rev;
|
||||
std::string revision = ss.str();
|
||||
*gfx_version = "gfx" + std::to_string((major + minor)/10) + revision;
|
||||
|
||||
ss.str("");
|
||||
ss << __PRETTY_FUNCTION__
|
||||
<< " | " << std::dec << "kfd_target_version = " << orig_target_version
|
||||
<< "; major = " << major << "; minor = " << minor << "; rev = "
|
||||
|
||||
Verwijs in nieuw issue
Block a user