diff options
author | rigred | 2019-01-22 10:39:12 +0200 |
---|---|---|
committer | rigred | 2019-01-22 10:43:02 +0200 |
commit | 356de4b4d5d9c3d398cac972e33570e5a88c7eb7 (patch) | |
tree | ea859e8c45f975034dd828eaa689cbc6705a43ad | |
parent | 7105298af8127816b5899f35abfa1cbeda76884f (diff) | |
download | aur-356de4b4d5d9c3d398cac972e33570e5a88c7eb7.tar.gz |
2.0.0-2
1. Temporary patch to fix --setpoweroverdrive feature until next official release
Signed-off-by: Rigo Reddig <rigo.reddig@gmail.com>
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | temporary-fixpoweroverdrive.patch | 56 |
3 files changed, 69 insertions, 4 deletions
@@ -1,13 +1,15 @@ pkgbase = rocm-smi pkgdesc = Utility to manage and monitor AMDGPU / ROCm systems. pkgver = 2.0.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/RadeonOpenCompute/ROC-smi/ arch = any license = MIT depends = python source = rocm-smi-2.0.0.tar.gz::https://github.com/RadeonOpenCompute/ROC-smi/archive/roc-2.0.0.tar.gz + source = temporary-fixpoweroverdrive.patch sha256sums = 47b84798c95724708346ab505662a05a9a16e0fa0129b4371c073939d1c9fd35 + sha256sums = ce8984c6449c24af0eefba3a3afed2666ccc7bd42cafcba17512d514169d97c8 pkgname = rocm-smi @@ -1,15 +1,22 @@ # Maintainer: Rigo Reddig <rigo.reddig@gmail.com> pkgname=rocm-smi pkgver=2.0.0 -pkgrel=1 +pkgrel=2 _filename=roc-${pkgver}.tar.gz pkgdesc="Utility to manage and monitor AMDGPU / ROCm systems." arch=('any') url="https://github.com/RadeonOpenCompute/ROC-smi/" license=('MIT') depends=(python) -source=("$pkgname-$pkgver.tar.gz::https://github.com/RadeonOpenCompute/ROC-smi/archive/${_filename}") -sha256sums=('47b84798c95724708346ab505662a05a9a16e0fa0129b4371c073939d1c9fd35') +source=("$pkgname-$pkgver.tar.gz::https://github.com/RadeonOpenCompute/ROC-smi/archive/${_filename}" + "temporary-fixpoweroverdrive.patch") +sha256sums=('47b84798c95724708346ab505662a05a9a16e0fa0129b4371c073939d1c9fd35' + 'ce8984c6449c24af0eefba3a3afed2666ccc7bd42cafcba17512d514169d97c8') + +prepare() { + cd "ROC-smi-roc-${pkgver}" + patch -Np1 -i "${srcdir}/temporary-fixpoweroverdrive.patch" +} package() { diff --git a/temporary-fixpoweroverdrive.patch b/temporary-fixpoweroverdrive.patch new file mode 100644 index 000000000000..c720c6e317ef --- /dev/null +++ b/temporary-fixpoweroverdrive.patch @@ -0,0 +1,56 @@ +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') + |