diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index 805cedf729..27aa4cb0e1 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -329,6 +329,8 @@ class AMDSMICommands(): asic_info['rev_id'] = hex(asic_info['rev_id']) if asic_info['asic_serial'] != '': asic_info['asic_serial'] = hex(int(asic_info['asic_serial'], base=16)) + else: + asic_info['asic_serial'] = "N/A" if asic_info['oam_id'] == 0xFFFF: # uint 16 max asic_info['oam_id'] = "N/A" static_dict['asic'] = asic_info diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index ac6bbf736e..ac0065bd3c 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -358,11 +358,12 @@ class AmdSmiProcessorType(IntEnum): NON_AMD_GPU = amdsmi_wrapper.NON_AMD_GPU NON_AMD_CPU = amdsmi_wrapper.NON_AMD_CPU -class AmdSmiCacheTypeNames(Enum): - DATA_CACHE = 2 - INST_CACHE = 4 - CPU_CACHE = 8 - SIMD_CACHE = 16 +class AmdSmiCacheTypeNames(IntEnum): + ENABLED = amdsmi_wrapper.CACHE_FLAGS_ENABLED + DATA_CACHE = amdsmi_wrapper.CACHE_FLAGS_DATA_CACHE + INST_CACHE = amdsmi_wrapper.CACHE_FLAGS_INST_CACHE + CPU_CACHE = amdsmi_wrapper.CACHE_FLAGS_CPU_CACHE + SIMD_CACHE = amdsmi_wrapper.CACHE_FLAGS_SIMD_CACHE class AmdSmiEventReader: def __init__( @@ -1556,7 +1557,7 @@ def amdsmi_get_gpu_asic_info( "market_name": asic_info.market_name.decode("utf-8"), "vendor_id": asic_info.vendor_id, "vendor_name": asic_info.vendor_name.decode("utf-8"), - "subvendor_id": asic_info.subvendor_id, + "subvendor_id": hex(asic_info.subvendor_id), "device_id": asic_info.device_id, "rev_id": asic_info.rev_id, "asic_serial": asic_info.asic_serial.decode("utf-8"), diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index 4d3e696d23..08a0d549c9 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -672,15 +672,21 @@ amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_i status = rsmi_wrapper(rsmi_dev_vendor_id_get, processor_handle, &vendor_id); if (status == AMDSMI_STATUS_SUCCESS) info->vendor_id = vendor_id; - - status = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, processor_handle, - &subvendor_id); - if (status == AMDSMI_STATUS_SUCCESS) info->subvendor_id = subvendor_id; } // For other sysfs related information, get from rocm-smi + status = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, processor_handle, + &subvendor_id); + if (status == AMDSMI_STATUS_SUCCESS) info->subvendor_id = subvendor_id; + status = rsmi_wrapper(rsmi_dev_pcie_vendor_name_get, processor_handle, info->vendor_name, AMDSMI_MAX_STRING_LENGTH); + // If vendor name is empty and the vendor id is 0x1002, set vendor name to AMD vendor string + if ((info->vendor_name != NULL && info->vendor_name[0] == '\0') && info->vendor_id == 0x1002) { + memset(info->vendor_name, 0, 38); + strncpy(info->vendor_name, "Advanced Micro Devices Inc. [AMD/ATI]", 37); + } + // default to 0xffff as not supported info->oam_id = std::numeric_limits::max(); status = rsmi_wrapper(rsmi_dev_oam_id_get, processor_handle,