[SWDEV-450553] Added Subsystem Device ID to amd-smi static --asic
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I428b4993cca027a6eb1bb9c617fe715118a59407
[ROCm/amdsmi commit: bc4ca45862]
Этот коммит содержится в:
@@ -16,6 +16,9 @@ Changes propagate forwards into the python interface as well, however we are mai
|
||||
- **Added GPU memory overdrive percentage to `amd-smi metric -o`**.
|
||||
Added `amdsmi_get_gpu_mem_overdrive_level()` function to amd-smi C and Python Libraries.
|
||||
|
||||
- **Added Subsystem Device ID to `amd-smi static --asic`**.
|
||||
No underlying changes to amdsmi_get_gpu_asic_info
|
||||
|
||||
### Removals
|
||||
|
||||
- N/A
|
||||
|
||||
@@ -356,9 +356,26 @@ class AMDSMICommands():
|
||||
if args.asic:
|
||||
try:
|
||||
asic_info = amdsmi_interface.amdsmi_get_gpu_asic_info(args.gpu)
|
||||
static_dict['asic'] = asic_info
|
||||
static_dict["asic"] = asic_info
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
static_dict['asic'] = "N/A"
|
||||
static_dict["asic"] = "N/A"
|
||||
logging.debug("Failed to get asic info for gpu %s | %s", gpu_id, e.get_error_info())
|
||||
|
||||
# static["asic"] = "N/A"
|
||||
try:
|
||||
subsystem_id = amdsmi_interface.amdsmi_get_gpu_subsystem_id(args.gpu)
|
||||
if static_dict["asic"] != "N/A":
|
||||
# Reorder asic to include subsystem_id after device_id
|
||||
static_dict["asic"]["subsystem_id"] = subsystem_id
|
||||
static_dict["asic"]["rev_id"] = static_dict["asic"].pop("rev_id")
|
||||
static_dict["asic"]["asic_serial"] = static_dict["asic"].pop("asic_serial")
|
||||
static_dict["asic"]["oam_id"] = static_dict["asic"].pop("oam_id")
|
||||
static_dict["asic"]["num_compute_units"] = static_dict["asic"].pop("num_compute_units")
|
||||
else:
|
||||
static_dict["asic"]["subsystem_id"] = subsystem_id
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
if static_dict["asic"] != "N/A":
|
||||
static_dict["asic"]["subsystem_id"] = "N/A"
|
||||
logging.debug("Failed to get asic info for gpu %s | %s", gpu_id, e.get_error_info())
|
||||
if args.bus:
|
||||
bus_info = {
|
||||
|
||||
@@ -2403,7 +2403,7 @@ def amdsmi_get_gpu_subsystem_id(processor_handle: amdsmi_wrapper.amdsmi_processo
|
||||
processor_handle, ctypes.byref(id))
|
||||
)
|
||||
|
||||
return id.value
|
||||
return _padHexValue(hex(id.value), 4)
|
||||
|
||||
|
||||
def amdsmi_get_gpu_subsystem_name(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
|
||||
|
||||
Ссылка в новой задаче
Block a user