diff --git a/projects/rocprofiler/CHANGELOG.md b/projects/rocprofiler/CHANGELOG.md index 1e61a960bd..aa3400c003 100644 --- a/projects/rocprofiler/CHANGELOG.md +++ b/projects/rocprofiler/CHANGELOG.md @@ -302,3 +302,4 @@ Example for file plugin output: - Automatic ISA dumping for ATT. See README. - CSV mode for ATT. See README. - Added option to control kernel name truncation. +- Limit rocprof(v1) srcipt usage to only supported architectures. diff --git a/projects/rocprofiler/bin/rpl_run.sh b/projects/rocprofiler/bin/rpl_run.sh index e114e7a3c4..d4ac9c1086 100755 --- a/projects/rocprofiler/bin/rpl_run.sh +++ b/projects/rocprofiler/bin/rpl_run.sh @@ -36,6 +36,29 @@ TTLIB_PATH=$ROOT_DIR/lib/roctracer ROCM_LIB_PATH=$ROOT_DIR/lib PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler +# check if rocprof is supportd on this gpu arch +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