Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
script to set clocks on AMD GPUs
1150,1500 R7 370
820,1500 380
1150,1250 67B1
#!/bin/bash
# public domain software by Nerd Ralph - 2016
# params = clocks & ID string from aticonfig --lsa
setclocks()
{
local clocks=$1; shift # core,mem clocks
cardid="$@"
#echo setting $cardid adapters to $clocks
local adapters=`aticonfig --lsa | grep "$cardid" | cut -c 3`
for card in $adapters
do
#echo set adapter $card
aticonfig --od-enable --adapter=$card --odsc $clocks
done
}
export DISPLAY=:0
xhost +
# clocks.txt must contain lines of core,mem and card ID string
IFS=$'\n'
for config in `cat clocks.txt`
do
unset IFS
echo config: $config
setclocks $config
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment