Skip to content

Instantly share code, notes, and snippets.

@derjohn
Created September 20, 2021 08:59
Show Gist options
  • Save derjohn/7bcd30447c698edca8c68e23b7428a6b to your computer and use it in GitHub Desktop.
Save derjohn/7bcd30447c698edca8c68e23b7428a6b to your computer and use it in GitHub Desktop.
gpu custom settings helper script for ROC-smi-rocm ROCm Radeon on Compute
#!/bin/bash
# usage: ./gpu-tune.sh '1 3 5' # runs GPU Settings in card 1,3 and 5
# Settings must be coded into the script (no external config yet).
# But this still handy, if you work on just one card
GPUS=${1:-'1 2 3 4 5'}
ROCMDIR=./ROC-smi-rocm-3.9.0
function tune() {
DEV=$1
GCKL=${2:-'1150'}
GPWR=${3:-'900'}
MCLK=${4:-'2150'}
MPWR=${5:-'925'}
FAN=${6:-'180'}
$ROCMDIR/rocm-smi -d $DEV --autorespond y --setslevel 7 $GCKL $GPWR
$ROCMDIR/rocm-smi -d $DEV --autorespond y --setmlevel 2 $MCLK $MPWR
$ROCMDIR/rocm-smi -d $DEV --autorespond y --setfan $FAN
sleep 1
$ROCMDIR/rocm-smi -d $DEV
}
GPUCUSTOM[2]='1150 850 2000 925' # This card needs different settings (XFX, not Sapphire as the other ones)
for i in ${GPUS}; do
echo tune ${i} ${GPUCUSTOM[$i]}
tune ${i} ${GPUCUSTOM[$i]}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment