SWDEV-410051 - Updates to board_info struct & CLI

Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I8735d8965140ee5da0c35106b388af1dca87ec71
This commit is contained in:
Maisam Arif
2023-10-25 17:13:03 -05:00
parent 741839d8e4
commit 2b4637ff9f
9 changed files with 55 additions and 44 deletions
+7 -3
View File
@@ -2,7 +2,7 @@
## Requirements
* python 3.6 64-bit
* python 3.7+ 64-bit
* driver must be loaded for amdsmi_init() to pass
## Overview
@@ -998,8 +998,10 @@ Output: Dictionary with fields correctable and uncorrectable
Field | Description
---|---
`serial_number` | Board serial number
`model_number` | Board serial number
`product_serial` | Product serial
`fru_id` | FRU ID
`manufacturer_name` | Manufacturer name
`product_name` | Product name
Exceptions that can be thrown by `amdsmi_get_gpu_board_info` function:
@@ -1014,8 +1016,10 @@ Example:
try:
device = amdsmi_get_processor_handle_from_bdf("0000:23.00.0")
board_info = amdsmi_get_gpu_board_info(device)
print(board_info["serial_number"])
print(board_info["model_number"])
print(board_info["product_serial"])
print(board_info["fru_id"])
print(board_info["manufacturer_name"])
print(board_info["product_name"])
except AmdSmiException as e:
print(e)
+1 -1
View File
@@ -1147,7 +1147,7 @@ def amdsmi_get_gpu_board_info(
return {
"model_number": board_info.model_number.decode("utf-8").strip(),
"product_serial": board_info.serial_number,
"product_serial": board_info.product_serial.decode("utf-8").strip(),
"fru_id": board_info.fru_id.decode("utf-8").strip(),
"manufacturer_name" : board_info.manufacturer_name.decode("utf-8").strip(),
"product_name": board_info.product_name.decode("utf-8").strip()
+11 -13
View File
@@ -840,14 +840,12 @@ class struct_amdsmi_board_info_t(Structure):
struct_amdsmi_board_info_t._pack_ = 1 # source:False
struct_amdsmi_board_info_t._fields_ = [
('serial_number', ctypes.c_uint64),
('is_master', ctypes.c_bool),
('model_number', ctypes.c_char * 32),
('product_serial', ctypes.c_char * 32),
('fru_id', ctypes.c_char * 32),
('product_name', ctypes.c_char * 128),
('manufacturer_name', ctypes.c_char * 32),
('PADDING_0', ctypes.c_ubyte * 7),
('product_name', ctypes.c_char * 128),
]
amdsmi_board_info_t = struct_amdsmi_board_info_t
@@ -894,6 +892,16 @@ amdsmi_process_handle_t = ctypes.c_uint32
class struct_amdsmi_proc_info_t(Structure):
pass
class struct_engine_usage_(Structure):
pass
struct_engine_usage_._pack_ = 1 # source:False
struct_engine_usage_._fields_ = [
('gfx', ctypes.c_uint64),
('enc', ctypes.c_uint64),
('reserved', ctypes.c_uint32 * 12),
]
class struct_memory_usage_(Structure):
pass
@@ -905,16 +913,6 @@ struct_memory_usage_._fields_ = [
('reserved', ctypes.c_uint32 * 10),
]
class struct_engine_usage_(Structure):
pass
struct_engine_usage_._pack_ = 1 # source:False
struct_engine_usage_._fields_ = [
('gfx', ctypes.c_uint64),
('enc', ctypes.c_uint64),
('reserved', ctypes.c_uint32 * 12),
]
struct_amdsmi_proc_info_t._pack_ = 1 # source:False
struct_amdsmi_proc_info_t._fields_ = [
('name', ctypes.c_char * 32),