1 |
commit: a3b31b1d6dec842523387619507a7e910c2f6636 |
2 |
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Jan 27 15:03:46 2023 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 31 14:18:32 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3b31b1d |
7 |
|
8 |
dev-util/rocprofiler: add 5.3.3 |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/29303 |
11 |
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> |
12 |
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> |
13 |
|
14 |
dev-util/rocprofiler/Manifest | 1 + |
15 |
.../files/rocprofiler-5.3.3-gentoo-location.patch | 102 +++++++++++++++++++++ |
16 |
.../rocprofiler-5.3.3-remove-aql-in-cmake.patch | 13 +++ |
17 |
dev-util/rocprofiler/rocprofiler-5.3.3.ebuild | 56 +++++++++++ |
18 |
4 files changed, 172 insertions(+) |
19 |
|
20 |
diff --git a/dev-util/rocprofiler/Manifest b/dev-util/rocprofiler/Manifest |
21 |
index 23a43f49ce08..358e4dfc5cd5 100644 |
22 |
--- a/dev-util/rocprofiler/Manifest |
23 |
+++ b/dev-util/rocprofiler/Manifest |
24 |
@@ -1,2 +1,3 @@ |
25 |
DIST rocprofiler-5.0.2.tar.gz 1401732 BLAKE2B ae870bc50dbd39c11e24f77ccb41773df1107b76cb7a12e1cebc66f8d66ddba6ad3bd6f9fe61657b03b22ef35f88fb608cf6070178f6aab24fe7a1bdcac43a96 SHA512 244e2b827126b7299ec0510daa5e1245a4a5a877394419f8bc9113f443231f67fc935609cbde6eeb26bb138ab4e95e2a88829ffa79ecc8f9881b5a77b5910c02 |
26 |
DIST rocprofiler-5.1.3.tar.gz 1402172 BLAKE2B 16e9b127ede94a3f96056e84a2942b6c9f3aec90579fb12796ab8ba385160aa020e3dc77f7a475dadbc0a813a823ae733ca9560f6a09e55c4c82b13dd792dfa4 SHA512 6e9932a425eaaa2a1e1741280d7525c6360700f85edb3bcf4967fe9be4fed662bae0d2ba609701f0d9733769c340e93e32076024b27bab3303449c1d68d9e1ce |
27 |
+DIST rocprofiler-5.3.3.tar.gz 1412740 BLAKE2B 29a63fc9df589787d18a28664002d35ec1b61e6b36f61cc1f2dc2dc14270d0aee4da594f735fceba71a7e29225bd0739b923a05bd36ec2a09a36e1ba95d8d971 SHA512 92b22272229c2c9a91983ded640a1b20f80538800f8e996dbf4e33e9f1f64a286a933f73b975e61c5b321883a11574c71ce91fd6ed7ddac32cd32da3bbea577c |
28 |
|
29 |
diff --git a/dev-util/rocprofiler/files/rocprofiler-5.3.3-gentoo-location.patch b/dev-util/rocprofiler/files/rocprofiler-5.3.3-gentoo-location.patch |
30 |
new file mode 100644 |
31 |
index 000000000000..48e6f6973ac8 |
32 |
--- /dev/null |
33 |
+++ b/dev-util/rocprofiler/files/rocprofiler-5.3.3-gentoo-location.patch |
34 |
@@ -0,0 +1,102 @@ |
35 |
+Index: rocprofiler-rocm-5.3.3/bin/rpl_run.sh |
36 |
+=================================================================== |
37 |
+--- rocprofiler-rocm-5.3.3.orig/bin/rpl_run.sh |
38 |
++++ rocprofiler-rocm-5.3.3/bin/rpl_run.sh |
39 |
+@@ -29,11 +29,12 @@ RUN_DIR=`pwd` |
40 |
+ TMP_DIR="/tmp" |
41 |
+ DATA_DIR="rpl_data_${time_stamp}_$$" |
42 |
+ |
43 |
+-RPL_PATH=$ROOT_DIR/lib |
44 |
+-TLIB_PATH=$RPL_PATH/rocprofiler |
45 |
+-TTLIB_PATH=$ROOT_DIR/lib/roctracer |
46 |
+-ROCM_LIB_PATH=$ROOT_DIR/lib |
47 |
+-PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler |
48 |
++RPL_PATH=$ROOT_DIR/@LIB_DIR@ |
49 |
++TLIB_PATH=$RPL_PATH |
50 |
++TTLIB_PATH=$ROOT_DIR/@LIB_DIR@ |
51 |
++ROCM_LIB_PATH=$ROOT_DIR/@LIB_DIR@ |
52 |
++PROF_BIN_DIR=$ROOT_DIR/bin |
53 |
++PROF_LIBEXEC_DIR=$ROOT_DIR/libexec/rocprofiler |
54 |
+ |
55 |
+ if [ -z "$ROCP_PYTHON_VERSION" ] ; then |
56 |
+ ROCP_PYTHON_VERSION=python3 |
57 |
+@@ -69,7 +70,7 @@ export ROCP_HSA_INTERCEPT=1 |
58 |
+ # Disabling internal ROC Profiler proxy queue (simple version supported for testing purposes) |
59 |
+ unset ROCP_PROXY_QUEUE |
60 |
+ # ROC Profiler metrics definition |
61 |
+-export ROCP_METRICS=$TLIB_PATH/metrics.xml |
62 |
++export ROCP_METRICS=$ROOT_DIR/share/rocprofiler/metrics.xml |
63 |
+ # Disable AQL-profile read API |
64 |
+ export AQLPROFILE_READ_API=0 |
65 |
+ # ROC Profiler package path |
66 |
+@@ -103,7 +104,7 @@ usage() { |
67 |
+ bin_name=`basename $0` |
68 |
+ echo "ROCm Profiling Library (RPL) run script, a part of ROCprofiler library package." |
69 |
+ echo "Full path: $BIN_DIR/$bin_name" |
70 |
+- echo "Metrics definition: $TLIB_PATH/metrics.xml" |
71 |
++ echo "Metrics definition: $ROOT_DIR/share/rocprofiler/metrics.xml" |
72 |
+ echo "" |
73 |
+ echo "Usage:" |
74 |
+ echo " $bin_name [-h] [--list-basic] [--list-derived] [-i <input .txt/.xml file>] [-o <output CSV file>] <app command line>" |
75 |
+@@ -211,7 +212,7 @@ fi |
76 |
+ # setting ROCM_LIB_PATH |
77 |
+ set_rocm_lib_path() { |
78 |
+ |
79 |
+- for ROCM_LIB_PATH in "$ROOT_DIR/lib" "$ROOT_DIR/lib64" ; do |
80 |
++ for ROCM_LIB_PATH in $TLIB_PATH ; do |
81 |
+ if [ -d "$ROCM_LIB_PATH" ]; then |
82 |
+ return 0 |
83 |
+ fi |
84 |
+@@ -385,11 +386,11 @@ while [ 1 ] ; do |
85 |
+ export ROCP_METRICS="$2" |
86 |
+ elif [ "$1" = "--list-basic" ] ; then |
87 |
+ export ROCP_INFO=b |
88 |
+- HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$TLIB_PATH/rocprof-ctrl" |
89 |
++ HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PROF_BIN_DIR/rocprof-ctrl" |
90 |
+ exit 1 |
91 |
+ elif [ "$1" = "--list-derived" ] ; then |
92 |
+ export ROCP_INFO=d |
93 |
+- HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$TLIB_PATH/rocprof-ctrl" |
94 |
++ HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PROF_BIN_DIR/rocprof-ctrl" |
95 |
+ exit 1 |
96 |
+ elif [ "$1" = "--basenames" ] ; then |
97 |
+ if [ "$2" = "on" ] ; then |
98 |
+@@ -550,7 +551,7 @@ elif [ "$input_type" = "txt" -o "$input_ |
99 |
+ mkdir -p $RES_DIR |
100 |
+ echo "RPL: output dir '$RES_DIR'" |
101 |
+ if [ "$input_type" = "txt" ] ; then |
102 |
+- $PROF_BIN_DIR/txt2xml.sh $INPUT_FILE $RES_DIR |
103 |
++ $PROF_LIBEXEC_DIR/txt2xml.sh $INPUT_FILE $RES_DIR |
104 |
+ else |
105 |
+ echo "<metric></metric>" > $RES_DIR/input.xml |
106 |
+ fi |
107 |
+@@ -582,9 +583,9 @@ if [ -n "$csv_output" ] ; then |
108 |
+ merge_output $OUTPUT_LIST |
109 |
+ if [ "$GEN_STATS" = "1" ] ; then |
110 |
+ db_output=$(echo $csv_output | sed "s/\.csv/.db/") |
111 |
+- $ROCP_PYTHON_VERSION $PROF_BIN_DIR/tblextr.py $db_output $OUTPUT_LIST |
112 |
++ $ROCP_PYTHON_VERSION $PROF_LIBEXEC_DIR/tblextr.py $db_output $OUTPUT_LIST |
113 |
+ else |
114 |
+- $ROCP_PYTHON_VERSION $PROF_BIN_DIR/tblextr.py $csv_output $OUTPUT_LIST |
115 |
++ $ROCP_PYTHON_VERSION $PROF_LIBEXEC_DIR/tblextr.py $csv_output $OUTPUT_LIST |
116 |
+ fi |
117 |
+ if [ "$?" -ne 0 ] ; then |
118 |
+ echo "Profiling data corrupted: '$OUTPUT_LIST'" | tee "$ROCPROFILER_SESS/error" |
119 |
+Index: rocprofiler-rocm-5.3.3/CMakeLists.txt |
120 |
+=================================================================== |
121 |
+--- rocprofiler-rocm-5.3.3.orig/CMakeLists.txt |
122 |
++++ rocprofiler-rocm-5.3.3/CMakeLists.txt |
123 |
+@@ -159,10 +159,10 @@ install ( FILES |
124 |
+ install ( FILES |
125 |
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/tool/metrics.xml |
126 |
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/tool/gfx_metrics.xml |
127 |
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/${DEST_NAME} ) |
128 |
++ DESTINATION ${CMAKE_INSTALL_DATADIR}/${DEST_NAME} ) |
129 |
+ # librocprof-tool.so |
130 |
+-install ( FILES ${PROJECT_BINARY_DIR}/test/librocprof-tool.so DESTINATION ${CMAKE_INSTALL_LIBDIR}/${DEST_NAME} ) |
131 |
+-install ( FILES ${PROJECT_BINARY_DIR}/test/rocprof-ctrl DESTINATION ${CMAKE_INSTALL_LIBDIR}/${DEST_NAME} |
132 |
++install ( FILES ${PROJECT_BINARY_DIR}/test/librocprof-tool.so DESTINATION ${CMAKE_INSTALL_LIBDIR} ) |
133 |
++install ( FILES ${PROJECT_BINARY_DIR}/test/rocprof-ctrl DESTINATION ${CMAKE_INSTALL_BINDIR} |
134 |
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) |
135 |
+ |
136 |
+ # File reorg Backward compatibility |
137 |
|
138 |
diff --git a/dev-util/rocprofiler/files/rocprofiler-5.3.3-remove-aql-in-cmake.patch b/dev-util/rocprofiler/files/rocprofiler-5.3.3-remove-aql-in-cmake.patch |
139 |
new file mode 100644 |
140 |
index 000000000000..19619f9606f5 |
141 |
--- /dev/null |
142 |
+++ b/dev-util/rocprofiler/files/rocprofiler-5.3.3-remove-aql-in-cmake.patch |
143 |
@@ -0,0 +1,13 @@ |
144 |
+Index: rocprofiler-rocm-5.3.3/cmake_modules/env.cmake |
145 |
+=================================================================== |
146 |
+--- rocprofiler-rocm-5.3.3.orig/cmake_modules/env.cmake |
147 |
++++ rocprofiler-rocm-5.3.3/cmake_modules/env.cmake |
148 |
+@@ -119,8 +119,3 @@ message ( "---------GPU_TARGETS: ${GPU_T |
149 |
+ if ( "${ROCM_ROOT_DIR}" STREQUAL "" ) |
150 |
+ message ( FATAL_ERROR "ROCM_ROOT_DIR is not found." ) |
151 |
+ endif () |
152 |
+- |
153 |
+-find_library ( FIND_AQL_PROFILE_LIB "libhsa-amd-aqlprofile64.so" HINTS ${CMAKE_INSTALL_PREFIX} PATHS ${ROCM_ROOT_DIR}) |
154 |
+-if ( NOT FIND_AQL_PROFILE_LIB ) |
155 |
+- message ( FATAL_ERROR "AQL_PROFILE not installed. Please install AQL_PROFILE" ) |
156 |
+-endif() |
157 |
|
158 |
diff --git a/dev-util/rocprofiler/rocprofiler-5.3.3.ebuild b/dev-util/rocprofiler/rocprofiler-5.3.3.ebuild |
159 |
new file mode 100644 |
160 |
index 000000000000..2c18d7475a6f |
161 |
--- /dev/null |
162 |
+++ b/dev-util/rocprofiler/rocprofiler-5.3.3.ebuild |
163 |
@@ -0,0 +1,56 @@ |
164 |
+# Copyright 1999-2023 Gentoo Authors |
165 |
+# Distributed under the terms of the GNU General Public License v2 |
166 |
+ |
167 |
+EAPI=8 |
168 |
+ |
169 |
+PYTHON_COMPAT=( python3_{10..11} ) |
170 |
+ |
171 |
+inherit cmake python-any-r1 |
172 |
+ |
173 |
+DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's" |
174 |
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/rocprofiler.git" |
175 |
+SRC_URI="https://github.com/ROCm-Developer-Tools/${PN}/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" |
176 |
+S="${WORKDIR}/${PN}-rocm-${PV}" |
177 |
+ |
178 |
+LICENSE="MIT" |
179 |
+SLOT="0/$(ver_cut 1-2)" |
180 |
+KEYWORDS="~amd64" |
181 |
+ |
182 |
+RDEPEND="dev-libs/rocr-runtime:${SLOT} |
183 |
+ dev-util/roctracer:${SLOT} |
184 |
+ " |
185 |
+DEPEND="${RDEPEND}" |
186 |
+BDEPEND=" |
187 |
+ $(python_gen_any_dep ' |
188 |
+ dev-python/CppHeaderParser[${PYTHON_USEDEP}] |
189 |
+ ') |
190 |
+" |
191 |
+ |
192 |
+PATCHES=( "${FILESDIR}/${PN}-4.3.0-nostrip.patch" |
193 |
+ "${FILESDIR}/${PN}-4.3.0-no-aqlprofile.patch" |
194 |
+ "${FILESDIR}/${PN}-5.1.3-remove-Werror.patch" |
195 |
+ "${FILESDIR}/${PN}-5.3.3-gentoo-location.patch" |
196 |
+ "${FILESDIR}/${PN}-5.3.3-remove-aql-in-cmake.patch" ) |
197 |
+ |
198 |
+python_check_deps() { |
199 |
+ python_has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]" |
200 |
+} |
201 |
+ |
202 |
+src_prepare() { |
203 |
+ cmake_src_prepare |
204 |
+ |
205 |
+ sed -e "s,@LIB_DIR@,$(get_libdir),g" -i bin/rpl_run.sh || die |
206 |
+} |
207 |
+ |
208 |
+src_configure() { |
209 |
+ local mycmakeargs=( |
210 |
+ -DCMAKE_SKIP_RPATH=On |
211 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" |
212 |
+ -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/include/hsa" |
213 |
+ -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext |
214 |
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF |
215 |
+ -DUSE_PROF_API=1 |
216 |
+ ) |
217 |
+ |
218 |
+ cmake_src_configure |
219 |
+} |