diff options
Diffstat (limited to 'temporary-fixpoweroverdrive.patch')
-rw-r--r-- | temporary-fixpoweroverdrive.patch | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/temporary-fixpoweroverdrive.patch b/temporary-fixpoweroverdrive.patch deleted file mode 100644 index c720c6e317ef..000000000000 --- a/temporary-fixpoweroverdrive.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/rocm_smi.py b/rocm_smi.py -index 3903b5b..b138855 100755 ---- a/rocm_smi.py -+++ b/rocm_smi.py -@@ -1081,6 +1081,11 @@ def setPowerOverDrive(deviceList, value, autoRespond): - return - - confirmOutOfSpecWarning(autoRespond) -+ -+ # Value in Watt - stored early this way to avoid pythons float -> int -> str conversion after dividing a number -+ strValue = value -+ # Our Watt value converted for sysfs as microWatt -+ value = int(value) * 1000000 - - for device in deviceList: - if not isDPMAvailable(device): -@@ -1092,27 +1097,28 @@ def setPowerOverDrive(deviceList, value, autoRespond): - continue - power_cap_path = os.path.join(hwmon, 'power1_cap') - -- max_power_cap = str(int(getSysfsValue(device, 'power_cap_max')) / 1000000) -- min_power_cap = str(int(getSysfsValue(device, 'power_cap_min')) / 1000000) -+ # Avoid early unnecessary conversions -+ max_power_cap = int(getSysfsValue(device, 'power_cap_max')) -+ min_power_cap = int(getSysfsValue(device, 'power_cap_min')) - -- if int(value) < int(min_power_cap): -- printLog(device, 'Unable to set Power OverDrive to less than ' + min_power_cap + 'W') -+ if value < min_power_cap: -+ printLog(device, 'Unable to set Power OverDrive to less than ' + str(min_power_cap / 1000000) + 'W') - RETCODE = 1 - return - -- if int(value) > int(max_power_cap): -- printLog(device, 'Unable to set Power OverDrive to more than ' + max_power_cap + 'W') -+ if value > max_power_cap: -+ printLog(device, 'Unable to set Power OverDrive to more than ' + str(max_power_cap / 1000000) + 'W') - RETCODE = 1 - return; - -- if writeToSysfs(power_cap_path, str(int(value) * 1000000)): -- if int(value) != 0: -- printLog(device, 'Successfully set Power OverDrive to ' + value + 'W') -+ if writeToSysfs(power_cap_path, str(value)): -+ if value != 0: -+ printLog(device, 'Successfully set Power OverDrive to ' + strValue + 'W') - else: - printLog(device, 'Successfully reset Power OverDrive') - else: -- if int(value) != 0: -- printLog(device, 'Unable to set Power OverDrive to ' + value + 'W') -+ if value != 0: -+ printLog(device, 'Unable to set Power OverDrive to ' + strValue + 'W') - else: - printLog(device, 'Unable to reset Power OverDrive to default') - |