Add DEB/RPM packaging for KFDTest

This will allow it to be installed with the ROCm suite,
and centralize things a little bit more
Also update run_kfdtest.sh to reflect the changes
Lastly, remove "die" reference as compute_utils.sh
may not be packaged with KFDTest

Change-Id: I4c30cd29979192496419e71e3685937d7417f739
This commit is contained in:
Kent Russell
2020-01-20 10:06:27 -05:00
parent 31530da7c6
commit a360c68b0c
2 changed files with 77 additions and 6 deletions
+51 -6
View File
@@ -22,9 +22,57 @@
#
#
# See if we can find the SHARE/BIN dirs in their expected locations
CWD="${0%/*}"
while read candidate; do
if [ -e "$candidate/kfdtest.exclude" ]; then
source "$candidate/kfdtest.exclude"
break
fi
done <<EOF
$KFDTEST_SHARE_DIR
$CWD
$CWD/../share/kfdtest
/opt/rocm/share/kfdtest
EOF
if [ "$BIN_DIR" == "" ]; then
BIN_DIR="$(pwd)/$(dirname $0)"
# Keep these checks until automation starts using the package install
if [ -z "${FILTER[core]}" ]; then
if [ -e "$CWD/../bin/kfdtest/kfdtest.exclude" ]; then
source "$CWD/../bin/kfdtest/kfdtest.exclude"
elif [ -e "$CWD/../../share/kfdtest.exclude" ]; then
source "$CWD/../../share/kfdtest.exclude"
fi
fi
# This filter will always exist if we sourced a valid kfdtest.exclude
if [ -z "${FILTER[core]}" ]; then
echo "Unable to locate kfdtest.exclude."
echo "Please set KFDTEST_SHARE_DIR or ensure that kfdtest.exclude is present inside $CWD, $CWD/../share/kfdtest or /opt/rocm/share/kfdtest"
exit 1
fi
# Using "which" produces different results in different
# OSes so use command -v instead. It returns "" if the
# command isn't in the PATH
if [ -z "$(command -v kfdtest)" ]; then
if [ -z "$BIN_DIR" ]; then
if [ -e "${0%/*}/kfdtest" ]; then
BIN_DIR="${0%/*}"
else
# The default location
BIN_DIR="/opt/rocm/bin"
fi
fi
if [ -e "$BIN_DIR/kfdtest" ]; then
KFDTEST="$BIN_DIR/kfdtest"
else
echo "Unable to locate kfdtest."
echo "Please set BIN_DIR, ensure that kfdtest is in $PATH, or ensure that kfdtest is present inside ${0%/*} or /opt/rocm/bin"
exit 1
fi
else
KFDTEST="kfdtest"
fi
PLATFORM=""
@@ -122,8 +170,6 @@ runKfdTest() {
hsaNodes=$NODE
fi
source $BIN_DIR/kfdtest.exclude
for hsaNode in $hsaNodes; do
nodeName=$(getNodeName $hsaNode)
if [ "$PLATFORM" != "" ] && [ "$PLATFORM" != "$nodeName" ]; then
@@ -205,8 +251,7 @@ while [ "$1" != "" ]; do
shift 1
done
KFDTEST="$BIN_DIR/kfdtest"
# If compute_utils.sh doesn't exist, this will just silently do nothing
if [ "$FORCE_HIGH" == "true" ]; then
pushGpuDpmState high
pushTrap "popGpuDpmState" EXIT