Make amdsmi_get_power_info backwards compatible

Change-Id: Ie5b4c35265827e78934caa94c142d31efce597e4
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
This commit is contained in:
Galantsev, Dmitrii
2025-03-18 18:38:36 +00:00
committed by Galantsev, Dmitrii
parent 7c882b2f69
commit 4a3c70136f
12 changed files with 114 additions and 17 deletions
+3 -1
View File
@@ -2378,6 +2378,8 @@ def amdsmi_get_gpu_driver_info(
return driver_info
# NOTE: this uses amdsmi_get_power_info_v2 under the hood because the C api
# needs to be backwards compatible
def amdsmi_get_power_info(
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
sensor_ind: int = 0
@@ -2389,7 +2391,7 @@ def amdsmi_get_power_info(
power_measure = amdsmi_wrapper.amdsmi_power_info_t()
_check_res(
amdsmi_wrapper.amdsmi_get_power_info(
amdsmi_wrapper.amdsmi_get_power_info_v2(
processor_handle, sensor_ind, ctypes.byref(power_measure)
)
)