Merge amd-staging into amd-master 20231121

Change-Id: I400dfcdbf7fd1afcb020805342a4389038ce3917
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Este commit está contenido en:
Galantsev, Dmitrii
2023-11-21 17:28:23 -06:00
Se han modificado 17 ficheros con 5882 adiciones y 976 borrados
+1 -3
Ver fichero
@@ -1,6 +1,4 @@
## Synopsis
Radeon Open Compute Platform - System Management Interface - Command Line tool.
## Radeon Open Compute (ROCm) - System Management Interface - Command Line Tool
This tool acts as a command line interface for manipulating
and monitoring the amdgpu kernel, and is intended to replace
+16 -17
Ver fichero
@@ -29,10 +29,12 @@ from rsmiBindings import *
# Major version - Increment when backwards-compatibility breaks
# Minor version - Increment when adding a new feature, set to 0 when major is incremented
# Patch version - Increment when adding a fix, set to 0 when minor is incremented
SMI_MAJ = 1
SMI_MIN = 5
# Hash version - Shortened commit hash. Print here and not with lib for consistency with amd-smi
SMI_MAJ = 2
SMI_MIN = 0
SMI_PAT = 0
__version__ = '%s.%s.%s' % (SMI_MAJ, SMI_MIN, SMI_PAT)
# SMI_HASH is provided by rsmiBindings
__version__ = '%s.%s.%s+%s' % (SMI_MAJ, SMI_MIN, SMI_PAT, SMI_HASH)
# Set to 1 if an error occurs
RETCODE = 0
@@ -828,23 +830,20 @@ def printTableRow(space, displayString, v_delim=" "):
def checkIfSecondaryDie(device):
""" Checks if GCD(die) is the secondary die in a MCM.
MI200 device specific feature check.
The secondary dies lacks power management features.
Secondary dies lack power management features.
TODO: switch to more robust way to check for primary/secondary die, when implemented in Kernel and rocm_smi_lib.
@param device: The device to check
"""
power_cap = c_uint64()
# secondary die can currently be determined by checking if all power1_* (power cap) values are equal to zero.
ret = rocmsmi.rsmi_dev_power_cap_get(device, 0, byref(power_cap))
if not (rsmi_ret_ok(ret, None, 'get_power_cap', False) and power_cap.value == 0):
return False
ret = rocmsmi.rsmi_dev_power_cap_default_get(device, byref(power_cap))
if not (rsmi_ret_ok(ret, None, 'get_power_cap_default', False) and power_cap.value == 0):
return False
ret = rocmsmi.rsmi_dev_power_ave_get(device, 0, byref(power_cap))
if not (rsmi_ret_ok(ret, None, 'get_power_avg', False) and power_cap.value == 0):
return False
return True
energy_count = c_uint64()
counter_resoution = c_float()
timestamp = c_uint64()
# secondary die can be determined by checking if energy counter == 0
ret = rocmsmi.rsmi_dev_energy_count_get(device, byref(energy_count), byref(counter_resoution), byref(timestamp))
if (rsmi_ret_ok(ret, None, 'energy_count_secondary_die_check', silent=False)) and (energy_count.value == 0):
return True
return False
def resetClocks(deviceList):
""" Reset clocks to default
+2
Ver fichero
@@ -55,6 +55,8 @@ dv_id = c_uint64()
# GPU ID
gpu_id = c_uint32(0)
SMI_HASH = '@PKG_VERSION_HASH@'
# Policy enums
RSMI_MAX_NUM_FREQUENCIES = 33