From b72f1720ef9a62e264a39e42bfa75629680f6178 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Tue, 14 Apr 2020 11:29:45 -0400 Subject: [PATCH] KFDTest: Use SMI for HIGH clocks, if possible Some systems don't support coarse-grained DPM, so performance level will fail. Remove the compute_utils.sh references, and just use the SMI if we request clocks be high, without throwing errors if it fails. Change-Id: Ic5beda9921128be36ac2d58cae3f0608618a8e21 [ROCm/ROCR-Runtime commit: 7ee9e01587016ad2f5a6e6cd5842149b5a5c3d39] --- .../tests/kfdtest/scripts/run_kfdtest.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh index fbeee08ece..de4c6783ec 100755 --- a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh +++ b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh @@ -243,12 +243,25 @@ while [ "$1" != "" ]; do shift 1 done -# If compute_utils.sh doesn't exist, this will just silently do nothing +# If the SMI is missing, just report and continue if [ "$FORCE_HIGH" == "true" ]; then - pushGpuDpmState high - pushTrap "popGpuDpmState" EXIT + 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 [ $? != 0 ]; then + echo "SMI failed to set perf level" + OLDPERF="" + fi + else + echo "Unable to set clocks to high" + fi fi # Set HSA_DEBUG env to run KFDMemoryTest.PtraceAccessInvisibleVram export HSA_DEBUG=1 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 +fi