From 4debecbc3cac9c01347bf18c02e7bb7324e56520 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Tue, 26 May 2020 21:56:07 -0500 Subject: [PATCH] removing /opt/rocm hardcoding Change-Id: Ifb041a76a0c6fa943f72a9228197f371ad384bb7 --- bin/build_kernel.sh | 2 +- bin/rpl_run.sh | 13 ++++--------- bin/tblextr.py | 4 +--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/build_kernel.sh b/bin/build_kernel.sh index 9412a68ece..8ed0f1685f 100755 --- a/bin/build_kernel.sh +++ b/bin/build_kernel.sh @@ -22,7 +22,7 @@ if [ -z "$ROCM_DIR" ] ; then fi if [ -z "$TGT_LIST" ] ; then - TGT_LIST=$(/opt/rocm/bin/rocminfo | grep "amdgcn-amd-amdhsa--" | head -n 1 | sed -n "s/^.*amdgcn-amd-amdhsa--\(\w*\).*$/\1/p") + TGT_LIST=`$ROCM_DIR/bin/rocminfo | grep "amdgcn-amd-amdhsa--" | head -n 1 | sed -n "s/^.*amdgcn-amd-amdhsa--\(\w*\).*$/\1/p"` fi if [ -z "$TGT_LIST" ] ; then diff --git a/bin/rpl_run.sh b/bin/rpl_run.sh index ec4a2b0418..2ab65e8cd6 100755 --- a/bin/rpl_run.sh +++ b/bin/rpl_run.sh @@ -39,15 +39,6 @@ if [ -z "$ROCP_PYTHON_VERSION" ] ; then ROCP_PYTHON_VERSION=python3 fi -# Default HIP path -if [ -z "$HIP_PATH" ] ; then - export HIP_PATH=/opt/rocm/hip -fi -# Default HCC path -if [ -z "$HCC_HOME" ] ; then - export HCC_HOME=/opt/rocm/hcc -fi - # runtime API trace ROCTX_TRACE=0 KFD_TRACE=0 @@ -209,6 +200,10 @@ usage() { exit 1 } +# cgecking for availability of rocminfo utility +`rocminfo >/dev/null 2>&1` +if [ $? != 0 ]; then fatal "'rocminfo' utility is not found: please add ROCM bin path to PATH env var."; fi + # profiling run method OUTPUT_LIST="" run() { diff --git a/bin/tblextr.py b/bin/tblextr.py index 291622c849..e02f6cf4ee 100755 --- a/bin/tblextr.py +++ b/bin/tblextr.py @@ -531,7 +531,7 @@ else: ops_statfile = statfile copy_statfile = re.sub(r'\.stats\.csv$', r'.copy_stats.csv', statfile) sysinfo_file = re.sub(r'\.stats\.csv$', r'.sysinfo.txt', statfile) - metadata_gen(sysinfo_file, '/opt/rocm/bin/rocminfo') + metadata_gen(sysinfo_file, 'rocminfo') with open(dbfile, mode='w') as fd: fd.truncate() db = SQLiteDB(dbfile) @@ -602,8 +602,6 @@ else: dform.gen_table_bins(db, 'OPS', ops_statfile, 'Name', 'DurationNs') dform.gen_ops_json_trace(db, 'OPS', GPU_BASE_PID, START_US, jsonfile) - metadata_gen(sysinfo_file, '/opt/rocm/bin/hipcc --version') - if kfd_trace_found: dform.post_process_data(db, 'KFD') dform.gen_table_bins(db, 'KFD', kfd_statfile, 'Name', 'DurationNs')