commit: d12b36240b5032fcfebf3eded8021ffd8ce3f1d4 Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com> AuthorDate: Sun Feb 15 16:32:40 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Mar 6 00:44:06 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d12b3624
dev-util/rocm_bandwidth_test: add 7.2.0 Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/45826 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-util/rocm_bandwidth_test/Manifest | 1 + .../rocm_bandwidth_test-7.2.0.ebuild | 134 +++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/dev-util/rocm_bandwidth_test/Manifest b/dev-util/rocm_bandwidth_test/Manifest index 8b1288501b20..4942404893c4 100644 --- a/dev-util/rocm_bandwidth_test/Manifest +++ b/dev-util/rocm_bandwidth_test/Manifest @@ -2,3 +2,4 @@ DIST rocm_bandwidth_test-6.3.3.tar.gz 45541 BLAKE2B c00ecafdc7bea482047362da741e DIST rocm_bandwidth_test-6.4.3.tar.gz 44901 BLAKE2B 6d5c1c716b93727094df991dafd590af14459d2350fe7b31ba5ca190f71cc15e2c26f5fe12738fbb53513d02c33b3075e99fa135eab2411dcc2811a6fd60993b SHA512 31fe4988145e9756f64c7e8d0731a1e1cbf4140e13d3da51fabfdf10e9803a8c32a65d78776ffb13bf9ad718c65a8b91bb30c3d66c069c00446ff51d6bfd040a DIST rocm_bandwidth_test-7.0.2.tar.gz 352716 BLAKE2B a9d0d432a97f84d18bea0ecdfd7088c89c6515e442f369ef7574a92045d73414c0ee5e4cb5dd569280c5f648953f1b7d657d28a839a44c1f6f868de58ac440a0 SHA512 b4a895fecc6260049e2504ac823a370a2688e232b9a6afb0c391e95aabe4c336d6a01e8654aaf8d2d30a030ed66055f0643d6c1ae7ce7cb55626a736fadf87c9 DIST rocm_bandwidth_test-7.1.0.tar.gz 350898 BLAKE2B c3e58ccb76b08f86283558d3e4079e34180161b5634bbe631127f6a2a6c298edb9a532aceb2af3242a501570649efade1351a3355ba5a747f400143d8eb1d69e SHA512 d7037e655c5e1296a860a9615eed9bdbcda33cd872cc90499b9650a0c417512af7c255975ab7ac9012edd7824b6d36de13e5adaf90002914e1417d3849a391ee +DIST rocm_bandwidth_test-7.2.0.tar.gz 350348 BLAKE2B f99e90d1f8d4c652fe6e7b81526e0bdcdc1c7b4048d67f3b54952ac425d1d30a012062ac5dc783e24017bb3f19af87c700cf5c0c096dd2d114c83526f7a1d4e5 SHA512 5726aab9ca9f90dea59eb5e8d7f6f7f742793dcf27df50458e1717548aac160f2428c6e46955726d6b88eb699eb3550ad7d8273acf33470ab057d91ce05a33b2 diff --git a/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.2.0.ebuild b/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.2.0.ebuild new file mode 100644 index 000000000000..7c15a65cabcb --- /dev/null +++ b/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.2.0.ebuild @@ -0,0 +1,134 @@ +# Copyright 2022-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} +inherit cmake rocm + +DESCRIPTION="Bandwidth test for ROCm" +HOMEPAGE="https://github.com/ROCm/rocm_bandwidth_test" +SRC_URI="https://github.com/ROCm/${PN}/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + +S="${WORKDIR}/${PN}-rocm-${PV}" +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +RDEPEND=" + dev-libs/rocr-runtime:${SLOT} + dev-util/hip:${SLOT} + dev-libs/boost:=[stacktrace] + dev-libs/libfmt:= + dev-libs/spdlog:= + net-misc/curl + sys-process/numactl +" +DEPEND=" + ${RDEPEND} + dev-cpp/nlohmann_json + dev-util/hipcc + dev-cpp/cli11 + dev-cpp/catch +" + +PATCHES=( "${FILESDIR}"/rocm_bandwidth_test-7.1.0-nogit.patch ) + +tb_plugin_wrapper() { + local PATCHES=() + local CMAKE_USE_DIR="${S}/plugins/tb/transferbench" + local BUILD_DIR="${CMAKE_USE_DIR}/build" + "$@" +} + +src_prepare() { + # rocm_bandwidth_test cmake files reinvents variables for everything: + # installation paths, flags, generator, compiler, linker selection, etc. + # Then cmake calls bash, which calls another cmake, which ignores niceness, verbose logs, CXX, etc. + # That code is objectively bad, a lot of patches go below. + # See also: https://github.com/ROCm/rocm_bandwidth_test/issues/131 + + # Relax version checks + sed -e "s/ \${FMT_PKG_MINIMUM_REQUIRED_VERSION}//" -i cmake/build_utils.cmake || die + sed -e "s/ \${SPDLOG_PKG_MINIMUM_REQUIRED_VERSION}//" -i cmake/build_utils.cmake || die + sed -e "s/ \${CATCH2_PKG_MINIMUM_REQUIRED_VERSION}//" -i cmake/build_utils.cmake || die + + sed -e "/set(BOOST_PACKAGE_NAME/ s/boost/Boost/" -i cmake/build_utils.cmake || die + sed -e "/set(CATCH2_PACKAGE_NAME/ s/catch2/Catch2/" -i cmake/build_utils.cmake || die + sed -e "s/ QUIT)/)/" -i main/cmdline/CMakeLists.txt || die + + sed -e "/set(AMD_ROCM_STAGING_INSTALL_PATH/ s:/usr/local:${EPREFIX}/usr:" \ + -e "/set(AMD_STANDALONE_STAGING_INSTALL_LIBDIR/ s/lib/$(get_libdir)/" \ + -e "/set(AMD_STANDALONE_STAGING_INSTALL_EXPORTDIR/ s/lib/$(get_libdir)/" \ + -i CMakeLists.txt || die + + sed -e "/set(AMD_ROCM_STAGING_INSTALL_LIBDIR/ s/lib/$(get_libdir)/" \ + -e "/set(AMD_ROCM_STAGING_INSTALL_EXPORTDIR/ s/lib/$(get_libdir)/" \ + -e "s:DOCDIR}/\${CPACK_PACKAGE_NAME}:DOCDIR}/${PF}:" \ + -i CMakeLists.txt || die + + sed -e "s:/usr/local/lib:${EPREFIX}/usr/$(get_libdir):" \ + -e "s:lib/\${AMD_TARGET_NAME}:$(get_libdir)/\${AMD_TARGET_NAME}:g" \ + -i cmake/build_utils.cmake || die + + sed -e "/set(AMD_STANDALONE_TARGET_INSTALL_PATH/ s:/usr/local:${EPREFIX}/usr:" \ + -e "/set(AMD_STANDALONE_TARGET_INSTALL_LIBDIR/ s/lib/$(get_libdir)/" \ + -e "/set(AMD_STANDALONE_TARGET_INSTALL_EXPORTDIR/ s/lib/$(get_libdir)/" \ + -i cmake/modules/post_build_utils.cmake.in || die + + sed -e "s:./rocm_bandwidth_test:rocm_bandwidth_test:" -i bin/rbt_run_tb || die + + # Let the user decide, which programs to use (definitely not `gcc -fuse-ld=lld`) + # Bug: https://bugs.gentoo.org/965916 + sed -e '/find_program(CCACHE_PATH/d' -e '/find_program(LD_LLD_PATH/d' \ + -e '/find_program(LD_MOLD_PATH/d' -i cmake/build_utils.cmake || die + + # Cleanup build script as we build in src_compile. + # This shell script basically calls "cmake ... && cmake install", + # we replace it with normal cmake.eclass functions with tb_plugin_wrapper. + echo "" > plugins/tb/transferbench/build_libamd_tb.sh || die + + cmake_src_prepare + tb_plugin_wrapper cmake_src_prepare +} + +src_configure() { + # Configure plugin launcher (can be compiled with any compiler) + local mycmakeargs=( + -DROCM_PATH="${EPREFIX}/usr" + -DUSE_LOCAL_FMT_LIB=ON + -DUSE_LOCAL_NLOHMANN_JSON=ON + -DUSE_LOCAL_SPDLOG=ON + -DUSE_LOCAL_BOOST=ON + -DUSE_LOCAL_CLI11=ON + -DUSE_LOCAL_CATCH2=ON + + -DAMD_APP_BUILD_DOCS=OFF + -DAMD_APP_BUILD_EXAMPLES=OFF + -DAMD_APP_COMPILER_TRY_CLANG=OFF + -DAMD_APP_STANDALONE_BUILD_PACKAGE=ON + -DAMD_APP_TREAT_WARNINGS_AS_ERRORS=OFF + -Wno-dev + ) + cmake_src_configure + + # Configure tb plugin (HIP code) + rocm_use_clang + mycmakeargs=( + -DBUILD_INTERNAL_BINARY_VERSION=$(< VERSION) + -DGPU_TARGETS="$(get_amdgpu_flags)" + -DHSA_INCLUDE_DIR="${EPREFIX}/usr/include/hsa" + -DROCM_PATH="${EPREFIX}/usr" + ) + tb_plugin_wrapper cmake_src_configure +} + +src_compile() { + # tb plugin must be compiled before transferbench + tb_plugin_wrapper cmake_src_compile + cp "${S}"/plugins/tb/transferbench/build/libamd_tb.* "${S}/plugins/tb/lib" || die + + cmake_src_compile +}
