From d099aba199f9a1b0b7670bc9765d61b63e0a4cd0 Mon Sep 17 00:00:00 2001 From: Ammar ELWazir Date: Fri, 3 Nov 2023 14:46:39 +0000 Subject: [PATCH] SWDEV-430422: Fixing the Hardware check to happen in the run function Change-Id: I3a9112ea1707bb1a3df2e18cd9cd23f1609a3e01 [ROCm/rocprofiler commit: e9d155c6a303c7bba541b2831f55b3f8aee3610a] --- projects/rocprofiler/bin/rpl_run.sh | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/projects/rocprofiler/bin/rpl_run.sh b/projects/rocprofiler/bin/rpl_run.sh index 98cd9c5ea9..91f1616015 100755 --- a/projects/rocprofiler/bin/rpl_run.sh +++ b/projects/rocprofiler/bin/rpl_run.sh @@ -41,24 +41,6 @@ V1_SUPPORTED_GPU_ARCHS=("gfx80x","gfx90x","gfx10xx") CURRENT_AGENTS_LIST=$($BIN_DIR/rocm_agent_enumerator) IS_SUPPORTED="false" -# split the CURRENT_AGENTS_LIST array into individual elements. -current_gpus=(${CURRENT_AGENTS_LIST[@]}) - -for gpu in "${current_gpus[@]}"; do - - # Check first 5 characters of gpu strings. - if [[ "${V1_SUPPORTED_GPU_ARCHS[@]:0:5}" =~ "${gpu:0:5}" ]]; then - IS_SUPPORTED="true" - fi - -done - -if [[ $IS_SUPPORTED == "false" ]]; then - echo "rocprof(v1) is not supported on this device." - echo "Please refer project's README for a list of supported architecures or use rocprofv2" - exit 1 -fi - if [ -z "$ROCP_PYTHON_VERSION" ] ; then ROCP_PYTHON_VERSION=python3 fi @@ -259,6 +241,25 @@ run() { echo " Fatal could not find ROCm lib directory " fatal fi + + # split the CURRENT_AGENTS_LIST array into individual elements. + current_gpus=(${CURRENT_AGENTS_LIST[@]}) + + for gpu in "${current_gpus[@]}"; do + + # Check first 5 characters of gpu strings. + if [[ "${V1_SUPPORTED_GPU_ARCHS[@]:0:5}" =~ "${gpu:0:5}" ]]; then + IS_SUPPORTED="true" + fi + + done + + if [[ $IS_SUPPORTED == "false" ]]; then + echo "rocprof(v1) is not supported on this device." + echo "Please refer project's README for a list of supported architecures or use rocprofv2" + exit 1 + fi + export ROCP_INPUT="$1" OUTPUT_DIR="$2" shift