nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/bin/rocprofv2 b/bin/rocprofv2
2index d0445e7..6079af8 100755
3--- a/bin/rocprofv2
4+++ b/bin/rocprofv2
5@@ -7,7 +7,8 @@ if [ -n "${ROCP_PRELOAD}" ]; then LD_PRELOAD="${ROCP_PRELOAD}"; fi
6
7 CURRENT_DIR="$( dirname -- "$0"; )";
8 ROCPROFV2_DIR=$(dirname -- $(realpath ${BASH_SOURCE[0]}));
9-ROCM_DIR=$( dirname -- "$ROCPROFV2_DIR"; )
10+ROCPROFILER_DIR=$( dirname -- "$ROCPROFV2_DIR"; )
11+ROCM_DIR=@rocmtoolkit_merged@
12 PLUGIN_LIST=("ctf" "perfetto" "file" "att" "cli")
13 RUN_FROM_BUILD=0
14 if [[ $ROCPROFV2_DIR == *"/build"* ]]; then
15@@ -15,7 +16,7 @@ if [[ $ROCPROFV2_DIR == *"/build"* ]]; then
16 ROCM_DIR=$ROCPROFV2_DIR
17 fi
18
19-export ROCPROFILER_METRICS_PATH=$ROCM_DIR/libexec/rocprofiler/counters/derived_counters.xml
20+export ROCPROFILER_METRICS_PATH=$ROCPROFILER_DIR/libexec/rocprofiler/counters/derived_counters.xml
21 export LD_LIBRARY_PATH=$ROCM_DIR/lib:$LD_LIBRARY_PATH
22
23 # Define color code
24@@ -83,7 +84,7 @@ while [ 1 ]; do
25 exit 1
26 fi
27 elif [[ "$1" == "--list-counters" ]]; then
28- export LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so
29+ export LD_PRELOAD=$LD_PRELOAD:$ROC_DIR/lib/rocprofiler/librocprofiler_tool.so
30 eval $ROCM_DIR/libexec/rocprofiler/ctrl
31 exit 1
32 elif [[ "$1" == "-i" || "$1" == "--input" ]]; then
33@@ -221,7 +222,7 @@ while [ 1 ]; do
34 if [ $RUN_FROM_BUILD == 1 ]; then
35 ATT_PATH=$ROCM_DIR/plugin/att/att/att.py
36 else
37- ATT_PATH=$ROCM_DIR/libexec/rocprofiler/att/att.py
38+ ATT_PATH=$ROCPROFILER_DIR/libexec/rocprofiler/att/att.py
39 export ROCPROFV2_ATT_LIB_PATH=$ROCM_DIR/lib/hsa-amd-aqlprofile/librocprofv2_att.so
40 fi
41 ATT_ARGV=$3
42@@ -294,13 +295,13 @@ if [ -n "$PMC_LINES" ] && [ ! -n "$ATT_ARGV" ]; then
43 export OUTPUT_PATH=$FINAL_PATH
44 fi
45 let COUNTER=COUNTER+1
46- LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so $*
47+ LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so $*
48 if [ -n "$OUTPUT_PATH" ]; then
49 echo -e "\nThe output path for the following counters: $OUTPUT_PATH"
50 fi
51 done
52 else
53- LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so $*
54+ LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so $*
55 fi
56
57 get_pmc_results_txt_path() {
58diff --git a/bin/rpl_run.sh b/bin/rpl_run.sh
59index 6b236ed..a9c233c 100755
60--- a/bin/rpl_run.sh
61+++ b/bin/rpl_run.sh
62@@ -25,16 +25,17 @@
63 ROCPROF_ARGS="$*"
64 time_stamp=`date +%y%m%d_%H%M%S`
65 BIN_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
66-ROOT_DIR=$(dirname $BIN_DIR)
67+ROCPROFILER_DIR=$(dirname $BIN_DIR)
68+ROOT_DIR=@rocmtoolkit_merged@
69 RUN_DIR=`pwd`
70 TMP_DIR="/tmp"
71 DATA_DIR="rpl_data_${time_stamp}_$$"
72
73-RPL_PATH=$ROOT_DIR/lib
74+RPL_PATH=$ROCPROFILER_DIR/lib
75 TLIB_PATH=$RPL_PATH/rocprofiler
76 TTLIB_PATH=$ROOT_DIR/lib/roctracer
77 ROCM_LIB_PATH=$ROOT_DIR/lib
78-PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler
79+PROF_BIN_DIR=$ROCPROFILER_DIR/libexec/rocprofiler
80
81 # check if rocprof is supportd on this gpu arch
82 V1_SUPPORTED_GPU_ARCHS=("gfx80x","gfx90x","gfx10xx","gfx94x")
83@@ -80,7 +81,7 @@ unset ROCP_PROXY_QUEUE
84 # Disable AQL-profile read API
85 export AQLPROFILE_READ_API=0
86 # ROC Profiler package path
87-export ROCP_PACKAGE_DIR=$ROOT_DIR
88+export ROCP_PACKAGE_DIR=$ROCPROFILER_DIR
89 # enabled SPM KFD mode
90 export ROCP_SPM_KFD_MODE=1
91
92@@ -400,7 +401,7 @@ unset_v1_envs() {
93
94 ################################################################################################
95 # main
96-echo "RPL: on '$time_stamp' from '$ROOT_DIR' in '$RUN_DIR'"
97+echo "RPL: on '$time_stamp' from '$ROCPROFILER_DIR' in '$RUN_DIR'"
98 # Parsing arguments
99 if [ -z "$1" ] ; then
100 usage
101@@ -633,7 +634,7 @@ elif [ "$input_type" = "txt" -o "$input_type" = "none" ] ; then
102 else
103 echo "<metric></metric>" > $RES_DIR/input.xml
104 fi
105- input_list=`/bin/ls $RES_DIR/input*.xml`
106+ input_list=`ls $RES_DIR/input*.xml`
107 export ROCPROFILER_SESS=$RES_DIR
108 else
109 fatal "Bad input file type '$INPUT_FILE'"