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: 7ee9e01587]
这个提交包含在:
Kent Russell 于 2020-04-16 07:59:33 -04:00 提交
1 父节点 08ae75cfca
当前提交 b72f1720ef
1 个文件已更改
+16 -3
@@ -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