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
[ROCm/ROCR-Runtime commit: a360c68b0c]
Este cometimento está contido em:
@@ -28,6 +28,16 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
project(KFDTest)
|
||||
|
||||
# For DEB/RPM generation
|
||||
set ( CPACK_PACKAGE_FILE_NAME "kfdtest" )
|
||||
set ( CPACK_PACKAGE_CONTACT "Advanced Micro Devices Inc." )
|
||||
set ( CPACK_PACKAGE_DESCRIPTION "This package includes kfdtest, the list of excluded tests for each ASIC, and a convenience script to run the test suite" )
|
||||
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test suite for ROCK/KFD" )
|
||||
set ( CPACK_PACKAGE_VERSION_MAJOR "1" )
|
||||
set ( CPACK_PACKAGE_VERSION_MINOR "0" )
|
||||
set ( CPACK_PACKAGE_VERSION_PATCH "0" )
|
||||
set ( CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface" )
|
||||
|
||||
#set ( CMAKE_VERBOSE_MAKEFILE on )
|
||||
|
||||
find_package(PkgConfig)
|
||||
@@ -47,6 +57,14 @@ else()
|
||||
include_directories(${DRM_AMDGPU_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
## Define default variable and variables for the optional build target hsakmt-dev
|
||||
set ( SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Location of hsakmt source code." )
|
||||
set ( CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE STRING "Default installation directory." )
|
||||
set ( CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Default packaging prefix." )
|
||||
set ( CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators." )
|
||||
|
||||
# Debian package specific variables
|
||||
set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface" )
|
||||
|
||||
if( DEFINED ENV{LIBHSAKMT_PATH} )
|
||||
set ( LIBHSAKMT_PATH $ENV{LIBHSAKMT_PATH} )
|
||||
@@ -159,3 +177,11 @@ target_link_libraries(kfdtest ${HSAKMT_LIBRARIES} ${DRM_LIBRARIES} ${DRM_AMDGPU_
|
||||
|
||||
configure_file ( scripts/kfdtest.exclude kfdtest.exclude COPYONLY )
|
||||
configure_file ( scripts/run_kfdtest.sh run_kfdtest.sh COPYONLY )
|
||||
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kfdtest ${CMAKE_CURRENT_BINARY_DIR}/run_kfdtest.sh
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_WRITE GROUP_READ WORLD_EXECUTE WORLD_READ
|
||||
DESTINATION bin )
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kfdtest.exclude
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ WORLD_READ
|
||||
DESTINATION share/kfdtest )
|
||||
include ( CPack )
|
||||
|
||||
@@ -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
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador