From b2690fdf1e70f0b7c813851db65ebb73a0ab0f64 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Mon, 11 Mar 2024 15:17:45 -0500 Subject: [PATCH] Unable to reset GPU from CLI The CLI helper compares the hex vendor id string with the number and never match it as AMD GPU. Change-Id: I1ababdce3a3694a5e26e5b0feef4d3d8cd40df7a --- amdsmi_cli/amdsmi_helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/amdsmi_cli/amdsmi_helpers.py b/amdsmi_cli/amdsmi_helpers.py index 080cc3538e..2083c15530 100644 --- a/amdsmi_cli/amdsmi_helpers.py +++ b/amdsmi_cli/amdsmi_helpers.py @@ -617,8 +617,11 @@ class AMDSMIHelpers(): """ # Get card vendor id asic_info = amdsmi_interface.amdsmi_get_gpu_asic_info(device_handle) - return asic_info['vendor_id'] == AMD_VENDOR_ID - + try: + vendor_value = int(asic_info['vendor_id'], 16) + return vendor_value == AMD_VENDOR_ID + except: + return False def get_perf_levels(self): perf_levels_str = [clock.name for clock in amdsmi_interface.AmdSmiDevPerfLevel]