The "gpupow" command takes the same command format as "gpuengine", "gpumem" etc, so a string with 2 parameters "0,20" for GPU0, Powertune 20.
I made this as we have Night/Day power rates so the mining cards run at full overclock over night, then in the morning they are switched via a cronjob to low clock/power usage. Previously I could down the clocks but not set the power tune. Some cards like my R9 290s do not like running at 0 Powertune so they need to be at 3 on stock clocks, where as my R9 270s run great at -10 powertune at stock.
PATCH: https://mega.co.nz/#!FIY0DIaA!QO96qhkQu0VsKaqcHvmA5GXcy8Fs8kFUGy6nnD1ufBs
To Apply:
patch -p1 < cgminer-3.7.2-api.patch
make
sudo make install
EXAMPLE: Using pycgminer (https://github.com/tsileo/pycgminer)
Snippet from my Cron script for the R9 270...
import sys
from pycgminer import CgminerAPI
def main():
cgminer = CgminerAPI()
if sys.argv[1] == "day":
# day settings
cgminer.host='localhost'
cgminer.gpuengine("0,945")
cgminer.gpumem("0,1400")
cgminer.gpupow("0,-10")
elif sys.argv[1] == "night":
# night settings
cgminer.host='localhost'
cgminer.gpuengine("0,1050")
cgminer.gpumem("0,1500")
cgminer.gpupow("0,10")
if __name__ == "__main__":
main()
From my crontab...
0 7 * * * /home/derp/bin/cg-api.py day
End result, I use about 200W less power during the day at a cost of around 200kh/s, and gain those at night where power is half the cost.
Hope this helps someone