From e39dab44e3e1685d8a5243d9827942deaf5cda83 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Mon, 23 Nov 2020 08:38:02 -0500 Subject: [PATCH] Look in /opt/rocm* for SMI for setting clocks to high Now that symlinks aren't necessarily guaranteed, use "find" to try to find the rocm-smi, and clarify the error message if it is not found Also tie in a fix for parsing the output now that the output has changed Change-Id: I2081442a71731c186c3ad00585a2ba6e8a8e5a28 [ROCm/ROCR-Runtime commit: 2651ce37d8388b302bd19da96e7ed2481d008304] --- .../rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh index 12ef8af51d..5aadce3dfd 100755 --- a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh +++ b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh @@ -244,16 +244,17 @@ while [ "$1" != "" ]; do done # If the SMI is missing, just report and continue +SMI="$(find /opt/rocm* -type l -name rocm-smi | tail -1)" if [ "$FORCE_HIGH" == "true" ]; then - if [ -e "/opt/rocm/bin/rocm-smi" ]; then - OLDPERF=$(/opt/rocm/bin/rocm-smi -p | awk '/Performance Level/ {print $NF; exit}') - $(/opt/rocm/bin/rocm-smi --setperflevel high &> /dev/null) + if [ -e "$SMI" ]; then + OLDPERF=$($SMI -p | awk '/Performance Level:/ {print $NF; exit}') + $($SMI --setperflevel high &> /dev/null) if [ $? != 0 ]; then echo "SMI failed to set perf level" OLDPERF="" fi else - echo "Unable to set clocks to high" + echo "Unable to set clocks to high, cannot find rocm-smi" fi fi @@ -263,5 +264,5 @@ runKfdTest # OLDPERF is only set if FORCE_HIGH and SMI both exist if [ -n "$OLDPERF" ]; then - /opt/rocm/bin/rocm-smi --setperflevel $OLDPERF &> /dev/null + $SMI --setperflevel $OLDPERF &> /dev/null fi