Placeholders for new ras values
Signed-off-by: Maisam Arif <maisarif@amd.com> Change-Id: I66cea253b19a5029172af0a3f4dd2f993c13b309 Signed-off-by: Maisam Arif <maisarif@amd.com>
Цей коміт міститься в:
@@ -437,11 +437,25 @@ class AMDSMICommands():
|
||||
|
||||
if self.helpers.is_hypervisor() or self.helpers.is_baremetal():
|
||||
if args.ras:
|
||||
ras_dict = {"eeprom_version": "N/A",
|
||||
"parity_schema" : "N/A",
|
||||
"single_bit_schema" : "N/A",
|
||||
"double_bit_schema" : "N/A",
|
||||
"poison_schema" : "N/A",
|
||||
"ecc_block_state": "N/A"}
|
||||
|
||||
try:
|
||||
static_dict['ras'] = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu)
|
||||
ras_info = amdsmi_interface.amdsmi_get_gpu_ras_feature_info(args.gpu)
|
||||
ras_dict.update(ras_info)
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
logging.debug("Failed to get ras info for gpu %s | %s", gpu_id, e.get_error_info())
|
||||
|
||||
try:
|
||||
ras_dict["ecc_block_state"] = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu)
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
static_dict['ras'] = "N/A"
|
||||
logging.debug("Failed to get ras block features for gpu %s | %s", gpu_id, e.get_error_info())
|
||||
|
||||
static_dict["ras"] = ras_dict
|
||||
if self.helpers.is_linux() and self.helpers.is_baremetal():
|
||||
if args.numa:
|
||||
try:
|
||||
@@ -467,11 +481,11 @@ class AMDSMICommands():
|
||||
if self.logger.is_csv_format():
|
||||
# expand if ras blocks are populated
|
||||
if self.helpers.is_linux() and self.helpers.is_baremetal() and args.ras:
|
||||
if isinstance(static_dict['ras'], list):
|
||||
ras_dicts = static_dict.pop('ras')
|
||||
if isinstance(static_dict['ras']['ecc_block_state'], list):
|
||||
ecc_block_dicts = static_dict['ras'].pop('ecc_block_state')
|
||||
multiple_devices_csv_override = True
|
||||
for ras_dict in ras_dicts:
|
||||
for key, value in ras_dict.items():
|
||||
for ecc_block_dict in ecc_block_dicts:
|
||||
for key, value in ecc_block_dict.items():
|
||||
self.logger.store_output(args.gpu, key, value)
|
||||
self.logger.store_output(args.gpu, 'values', static_dict)
|
||||
self.logger.store_multiple_device_output()
|
||||
|
||||
@@ -942,6 +942,46 @@ except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
|
||||
### amdsmi_get_gpu_ras_feature_info
|
||||
|
||||
Description: Returns RAS version and schema information
|
||||
It is not supported on virtual machine guest
|
||||
|
||||
Input parameters:
|
||||
|
||||
* `processor_handle` device which to query
|
||||
|
||||
Output: List containing dictionaries with fields
|
||||
|
||||
Field | Description
|
||||
---|---
|
||||
`eeprom_version` | eeprom version
|
||||
`parity_schema` | parity schema
|
||||
`single_bit_schema` | single bit schema
|
||||
`double_bit_schema` | double bit schema
|
||||
`poison_schema` | poison schema
|
||||
|
||||
Exceptions that can be thrown by `amdsmi_get_gpu_ras_feature_info` function:
|
||||
|
||||
* `AmdSmiLibraryException`
|
||||
* `AmdSmiRetryException`
|
||||
* `AmdSmiParameterException`
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
try:
|
||||
devices = amdsmi_get_processor_handles()
|
||||
if len(devices) == 0:
|
||||
print("No GPUs on machine")
|
||||
else:
|
||||
for device in devices:
|
||||
ras_info = amdsmi_get_gpu_ras_feature_info(device)
|
||||
print(ras_info)
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
|
||||
### amdsmi_get_gpu_ras_block_features_enabled
|
||||
|
||||
Description: Returns status of each RAS block for the given GPU.
|
||||
|
||||
@@ -66,6 +66,7 @@ from .amdsmi_interface import amdsmi_get_gpu_total_ecc_count
|
||||
from .amdsmi_interface import amdsmi_get_gpu_board_info
|
||||
|
||||
# # Ras Information
|
||||
from .amdsmi_interface import amdsmi_get_gpu_ras_feature_info
|
||||
from .amdsmi_interface import amdsmi_get_gpu_ras_block_features_enabled
|
||||
|
||||
# # Unsupported Functions In Virtual Environment
|
||||
|
||||
@@ -832,9 +832,26 @@ def amdsmi_get_gpu_board_info(
|
||||
}
|
||||
|
||||
|
||||
def amdsmi_get_gpu_ras_block_features_enabled(
|
||||
def amdsmi_get_gpu_ras_feature_info(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
|
||||
) -> Dict[str, Any]:
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
raise AmdSmiParameterException(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
)
|
||||
# Dummy data waiting on population
|
||||
ras_info = {"eeprom_version": "N/A",
|
||||
"parity_schema" : "N/A",
|
||||
"single_bit_schema" : "N/A",
|
||||
"double_bit_schema" : "N/A",
|
||||
"poison_schema" : "N/A"}
|
||||
|
||||
return ras_info
|
||||
|
||||
|
||||
def amdsmi_get_gpu_ras_block_features_enabled(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
|
||||
) -> List[Dict[str, Any]]:
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
raise AmdSmiParameterException(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача