diff options
author | Yiyang Wu <xgreenlandforwyy@gmail.com> | 2022-05-10 22:33:21 +0800 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2022-06-13 20:00:45 +0800 |
commit | d4034da0890695292c0c2d24aba60446bcf8a465 (patch) | |
tree | 3363e3f958ff9760b8b1844fa91de6f00c0f37d7 /dev-util/roctracer | |
parent | dev-util/hip-5.0.2: fix HIP_PATH in hipvars.pm (diff) | |
download | gentoo-d4034da0890695292c0c2d24aba60446bcf8a465.tar.gz gentoo-d4034da0890695292c0c2d24aba60446bcf8a465.tar.bz2 gentoo-d4034da0890695292c0c2d24aba60446bcf8a465.zip |
dev-util/roctracer: compile tarcer_tool for rocprofiler
- patch out loading libhsa-amd-aqlprofile64.so
- Use `hipconfig -p` to determine HIP_PATH
Bug: https://github.com/gentoo/gentoo/pull/25536
Bug: https://bugs.gentoo.org/716948
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'dev-util/roctracer')
-rw-r--r-- | dev-util/roctracer/Manifest | 2 | ||||
-rw-r--r-- | dev-util/roctracer/files/roctracer-4.3.0-tracer_tool.patch | 35 | ||||
-rw-r--r-- | dev-util/roctracer/roctracer-4.3.0-r2.ebuild (renamed from dev-util/roctracer/roctracer-4.3.0-r1.ebuild) | 17 | ||||
-rw-r--r-- | dev-util/roctracer/roctracer-5.0.2.ebuild | 17 |
4 files changed, 61 insertions, 10 deletions
diff --git a/dev-util/roctracer/Manifest b/dev-util/roctracer/Manifest index 9c8b51497026..ff14bd213a4e 100644 --- a/dev-util/roctracer/Manifest +++ b/dev-util/roctracer/Manifest @@ -1,3 +1,5 @@ +DIST hsa-class-4.3.0.tar.gz 37431 BLAKE2B 6fa2eb327256c44e0b9af3f0eabc775059d0e37ea976be155d4c6f05c73489abbf3abda20683c3ca4c720c2e6899c690d2a104decb56f80a8f76dde0a1cc08ef SHA512 4d0c554f6ecc66495d9493df39cc7a00c2912c93285146e891efa6b636b2b44ba9b6447fada5e664fce3329abd2670333e61cc2978e9e4f5973e99d165a93131 +DIST hsa-class-f8b3870.tar.gz 37432 BLAKE2B c2a09e4a4c3708e8db432378874c63b9cefefb567ad19a9c17181ed2b60f38d0591a618f72b11f606eb44efc5e170adaf72f0ec1b93cde628ca2230a62e2d6de SHA512 f371a955bf59b7e0af07261981a6e68562fad0753d3f39d1e220034c17501abf839ed2fd88fbf376d659970395c8795a82c0560c7ed8d3b87c11c79864f5f612 DIST rocm-tracer-4.0.0.tar.gz 462166 BLAKE2B 1294b5639a743a9d32737c72dc0f082b5a33ee1b3365f48221ad6392cdde7637926c42ea344fa96e9fc8410ea04e9ce3f535e188a25130f4be764c4d4a59b69c SHA512 312cd6c4c98a83e28a9f8b9e6123862af2e80a0d0852acff11be65d198f277c6ea194e72f6dbaccab1dd5d4af318bef28ca546e49440f22d024a546a4e5e9e15 DIST rocm-tracer-4.2.0.tar.gz 476974 BLAKE2B 3a7be9c269fec5dcca98d7de514d97a2e1de7bbfaa54a1aca2df70453d05326564c8ee7bf793c7d176069ecd3f7f91409c6a20dd0773aa157f7abc1dac41448e SHA512 002d9fccee4761af4853e589b116bc5844b98abb84517c260aedcb5f31f5c92b862a233062ec280a6f878343c4f751d55f47fd38483e1882feb8c970f9836120 DIST rocm-tracer-4.3.0.tar.gz 477647 BLAKE2B d597df2efef0c750637c8f509b89ad62927cb839ba7c9a42fa71882ee13d4a0bba295af19b02eda5310421e53187e9a98a76777f0d3a587e7e652ecf4c10cb6a SHA512 47ea2705a361cb863f33a9f4c1a7d5005bb679221fa95f14dd5404ef5af32377bad5c7d9807e2fff8030a9c26ac4230f2bab833344ef49ecebbd5653f0edfc2c diff --git a/dev-util/roctracer/files/roctracer-4.3.0-tracer_tool.patch b/dev-util/roctracer/files/roctracer-4.3.0-tracer_tool.patch new file mode 100644 index 000000000000..f59c83a96110 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-4.3.0-tracer_tool.patch @@ -0,0 +1,35 @@ +Index: roctracer-rocm-4.3.0/test/CMakeLists.txt +=================================================================== +--- roctracer-rocm-4.3.0.orig/test/CMakeLists.txt ++++ roctracer-rocm-4.3.0/test/CMakeLists.txt +@@ -75,7 +75,7 @@ set ( TEST_DIR ${HSA_TEST_DIR} ) + set ( TEST_DIR ${TMP} ) + + ## Util sources +-file( GLOB UTIL_SRC "${HSA_TEST_DIR}/util/*.cpp" ) ++file( GLOB UTIL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../src/util/*.cpp" ) + + if ( DEFINED ROCTRACER_TARGET ) + ## Build test library +Index: roctracer-rocm-4.3.0/test/tool/tracer_tool.cpp +=================================================================== +--- roctracer-rocm-4.3.0.orig/test/tool/tracer_tool.cpp ++++ roctracer-rocm-4.3.0/test/tool/tracer_tool.cpp +@@ -285,7 +285,7 @@ void stop_callback() { roctracer::RocTxL + void roctx_flush_cb(roctx_trace_entry_t* entry) { + #if ROCTX_CLOCK_TIME + timestamp_t timestamp = 0; +- HsaRsrcFactory::Instance().GetTimestamp(HsaTimer::TIME_ID_CLOCK_MONOTONIC, entry->time, ×tamp); ++ util::HsaRsrcFactory::Instance().GetTimestamp(HsaTimer::TIME_ID_CLOCK_MONOTONIC, entry->time, ×tamp); + #else + const timestamp_t timestamp = entry->time; + #endif +@@ -1148,7 +1148,7 @@ extern "C" PUBLIC_API bool OnLoad(HsaApi + + // Dumping HSA handles for agents and pools + FILE* handles_file_handle = open_output_file(output_prefix, "hsa_handles.txt"); +- HsaRsrcFactory::Instance().DumpHandles(handles_file_handle); ++ util::HsaRsrcFactory::Instance().DumpHandles(handles_file_handle); + close_output_file(handles_file_handle); + + ONLOAD_TRACE_END(); diff --git a/dev-util/roctracer/roctracer-4.3.0-r1.ebuild b/dev-util/roctracer/roctracer-4.3.0-r2.ebuild index 5b0d3c3f5b5d..1daabb2c9bc6 100644 --- a/dev-util/roctracer/roctracer-4.3.0-r1.ebuild +++ b/dev-util/roctracer/roctracer-4.3.0-r2.ebuild @@ -1,16 +1,17 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -PYTHON_COMPAT=( python3_{8,9} ) +PYTHON_COMPAT=( python3_{8,10} ) inherit cmake prefix python-any-r1 DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's" HOMEPAGE="https://github.com/ROCm-Developer-Tools/roctracer.git" SRC_URI="https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz - https://github.com/ROCm-Developer-Tools/rocprofiler/archive/rocm-${PV}.tar.gz -> rocprofiler-${PV}.tar.gz" + https://github.com/ROCm-Developer-Tools/rocprofiler/archive/rocm-${PV}.tar.gz -> rocprofiler-${PV}.tar.gz + https://github.com/ROCmSoftwarePlatform/hsa-class/archive/master.tar.gz -> hsa-class-${PV}.tar.gz" S="${WORKDIR}/roctracer-rocm-${PV}" LICENSE="MIT" @@ -30,6 +31,7 @@ BDEPEND=" PATCHES=( # https://github.com/ROCm-Developer-Tools/roctracer/pull/63 "${FILESDIR}"/${PN}-4.3.0-glibc-2.34.patch + "${FILESDIR}"/${PN}-4.3.0-tracer_tool.patch ) python_check_deps() { @@ -39,21 +41,24 @@ python_check_deps() { src_prepare() { mv "${WORKDIR}"/rocprofiler-rocm-${PV} "${WORKDIR}"/rocprofiler || die + mv "${WORKDIR}"/ROCmSoftwarePlatform-hsa-class*/test/util "${S}"/inc/ || die + rm "${S}"/inc/util/hsa* || die + cp -a "${S}"/src/util/hsa* "${S}"/inc/util/ || die # do not build the tool and it´s library; # change destination for headers to include/roctracer; # do not install a second set of header files; sed -e "/LIBRARY DESTINATION/s,lib,$(get_libdir)," \ - -e "/add_subdirectory ( \${TEST_DIR} \${PROJECT_BINARY_DIR}/d" \ -e "/DESTINATION/s,\${DEST_NAME}/include,include/roctracer," \ -e "/install ( FILES \${PROJECT_BINARY_DIR}\/so/d" \ - -e "/DESTINATION/s,\${DEST_NAME}/lib64,$(get_libdir)/roctracer,g" \ + -e "/DESTINATION/s,\${DEST_NAME}/lib64,$(get_libdir),g" \ -i CMakeLists.txt || die # do not download additional sources via git sed -e "/execute_process ( COMMAND sh -xc \"if/d" \ -e "/add_subdirectory ( \${HSA_TEST_DIR} \${PROJECT_BINARY_DIR}/d" \ + -e "/DESTINATION/s,\${DEST_NAME}/tool,$(get_libdir),g" \ -i test/CMakeLists.txt || die hprefixify script/*.py @@ -62,7 +67,7 @@ src_prepare() { } src_configure() { - export HIP_PATH="${EPREFIX}/usr/lib/hip" + export HIP_PATH="$(hipconfig -p)" local mycmakeargs=( -DHIP_VDI=1 diff --git a/dev-util/roctracer/roctracer-5.0.2.ebuild b/dev-util/roctracer/roctracer-5.0.2.ebuild index 7c53e956e347..755100264624 100644 --- a/dev-util/roctracer/roctracer-5.0.2.ebuild +++ b/dev-util/roctracer/roctracer-5.0.2.ebuild @@ -3,14 +3,15 @@ EAPI=7 -PYTHON_COMPAT=( python3_{8,9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit cmake prefix python-any-r1 DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's" HOMEPAGE="https://github.com/ROCm-Developer-Tools/roctracer.git" SRC_URI="https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz - https://github.com/ROCm-Developer-Tools/rocprofiler/archive/rocm-${PV}.tar.gz -> rocprofiler-${PV}.tar.gz" + https://github.com/ROCm-Developer-Tools/rocprofiler/archive/rocm-${PV}.tar.gz -> rocprofiler-${PV}.tar.gz + https://github.com/ROCmSoftwarePlatform/hsa-class/archive/f8b387043b9f510afdf2e72e38a011900360d6ab.tar.gz -> hsa-class-f8b3870.tar.gz" S="${WORKDIR}/roctracer-rocm-${PV}" LICENSE="MIT" @@ -30,6 +31,7 @@ BDEPEND=" PATCHES=( # https://github.com/ROCm-Developer-Tools/roctracer/pull/63 "${FILESDIR}"/${PN}-4.3.0-glibc-2.34.patch + "${FILESDIR}"/${PN}-4.3.0-tracer_tool.patch "${FILESDIR}"/${PN}-5.0.2-Werror.patch "${FILESDIR}"/${PN}-5.0.2-headers.patch "${FILESDIR}"/${PN}-5.0.2-strip-license.patch @@ -44,22 +46,29 @@ src_prepare() { cmake_src_prepare mv "${WORKDIR}"/rocprofiler-rocm-${PV} "${WORKDIR}"/rocprofiler || die + mv "${WORKDIR}"/hsa-class-*/test/util "${S}"/inc/ || die + rm "${S}"/inc/util/hsa* || die + cp -a "${S}"/src/util/hsa* "${S}"/inc/util/ || die + + # change destination for headers to include/roctracer; sed -e "/LIBRARY DESTINATION/s,lib,$(get_libdir)," \ - -e "/add_subdirectory ( \${TEST_DIR} \${PROJECT_BINARY_DIR}/d" \ + -e "/DESTINATION/s,\${DEST_NAME}/include,include/roctracer," \ -e "/install ( FILES \${PROJECT_BINARY_DIR}\/so/d" \ + -e "/DESTINATION/s,\${DEST_NAME}/lib64,$(get_libdir),g" \ -i CMakeLists.txt || die # do not download additional sources via git sed -e "/execute_process ( COMMAND sh -xc \"if/d" \ -e "/add_subdirectory ( \${HSA_TEST_DIR} \${PROJECT_BINARY_DIR}/d" \ + -e "/DESTINATION/s,\${DEST_NAME}/tool,$(get_libdir),g" \ -i test/CMakeLists.txt || die hprefixify script/*.py } src_configure() { - export HIP_PATH="${EPREFIX}/usr" + export HIP_PATH="$(hipconfig -p)" local mycmakeargs=( -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/include/hsa" |