[SWDEV-531904] Added test_get_gpu_revision (#533)
* [SWDEV-531904] Added test_get_gpu_revision New: - amdsmi_get_gpu_revision() previously not implemented in amdsmi_interface.py - test_get_gpu_revision() missing integration test. Updated: -changelog.md added new doc fields for ROCm 7.1 -amdsmi-py-api.md added field|description doc fields Signed-off-by: Juan Castillo <juan.castillo@amd.com>
This commit is contained in:
@@ -117,6 +117,7 @@ from .amdsmi_interface import amdsmi_get_gpu_bad_page_info
|
||||
from .amdsmi_interface import amdsmi_get_gpu_bad_page_threshold
|
||||
from .amdsmi_interface import amdsmi_get_violation_status
|
||||
from .amdsmi_interface import amdsmi_get_gpu_xgmi_link_status
|
||||
from .amdsmi_interface import amdsmi_get_gpu_revision
|
||||
|
||||
# # Process Information
|
||||
from .amdsmi_interface import amdsmi_get_gpu_process_list
|
||||
|
||||
@@ -5087,3 +5087,32 @@ def amdsmi_get_rocm_version()-> Tuple[bool, str]:
|
||||
return False, "Could not find librocm-core.so"
|
||||
except Exception as e:
|
||||
return False, f"Unable to detect ROCm installation, Unknown Error: {e}"
|
||||
|
||||
|
||||
def amdsmi_get_gpu_revision(processor_handle: processor_handle) -> str:
|
||||
"""
|
||||
Get the GPU revision for a given processor handle.
|
||||
|
||||
Parameters:
|
||||
processor_handle (amdsmi_processor_handle): The processor handle for the GPU.
|
||||
|
||||
Returns:
|
||||
str: The GPU revision as a string.
|
||||
|
||||
Raises:
|
||||
AmdSmiParameterException: If the processor handle is invalid.
|
||||
AmdSmiLibraryException: If the underlying library call fails.
|
||||
"""
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
raise AmdSmiParameterException(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
)
|
||||
|
||||
revision = ctypes.c_uint16()
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_get_gpu_revision(
|
||||
processor_handle, ctypes.byref(revision)
|
||||
)
|
||||
)
|
||||
|
||||
return _pad_hex_value(hex(revision.value), 2)
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user