diff --git a/dev-embedded/dfu-programmer/dfu-programmer-1.1.0.ebuild b/dev-embedded/dfu-programmer/dfu-programmer-1.1.0.ebuild index 2fd092cf8d1cc..5c48b5ef6aaa7 100644 --- a/dev-embedded/dfu-programmer/dfu-programmer-1.1.0.ebuild +++ b/dev-embedded/dfu-programmer/dfu-programmer-1.1.0.ebuild @@ -15,7 +15,7 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}. LICENSE="GPL-2" SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64" +KEYWORDS="~amd64 arm ~arm64" RDEPEND=" acct-group/plugdev diff --git a/dev-util/hip/files/hip-7.0.2-fix-libcxx-noinline.patch b/dev-util/hip/files/hip-7.0.2-fix-libcxx-noinline.patch index 28f8e7e55d112..0f77fbf76971b 100644 --- a/dev-util/hip/files/hip-7.0.2-fix-libcxx-noinline.patch +++ b/dev-util/hip/files/hip-7.0.2-fix-libcxx-noinline.patch @@ -1,4 +1,6 @@ Unsetting __noinline__ before inclusion of libc++ __config breaks libc++ headers. + +Upstream PR: https://github.com/ROCm/rocm-systems/pull/1875 --- a/hipamd/include/hip/amd_detail/host_defines.h +++ b/hipamd/include/hip/amd_detail/host_defines.h @@ -257,6 +257,13 @@ typedef __hip_internal::int64_t __hip_int64_t; diff --git a/dev-util/hip/files/hip-7.0.2-fix-libcxx-ranges.patch b/dev-util/hip/files/hip-7.0.2-fix-libcxx-ranges.patch new file mode 100644 index 0000000000000..cbb6035d5df94 --- /dev/null +++ b/dev-util/hip/files/hip-7.0.2-fix-libcxx-ranges.patch @@ -0,0 +1,19 @@ +Defining __local before inclusion of libc++ causes compilation errors. + +Upstream PR: https://github.com/ROCm/rocm-systems/pull/1875 +--- a/hipamd/include/hip/amd_detail/device_library_decls.h ++++ b/hipamd/include/hip/amd_detail/device_library_decls.h +@@ -120,6 +120,13 @@ extern "C" __device__ __hip_uint64_t __ockl_fprintf_append_string_n(__hip_uint64 + __hip_uint64_t length, + __hip_uint32_t is_last); + ++// libc++ uses __local as function name; include one file, before defining __local macro ++#if defined(__cplusplus) && defined(_LIBCPP_VERSION) && defined(__has_include) ++# if __has_include (<__ranges/join_view.h>) ++# include <__ranges/join_view.h> ++# endif ++#endif ++ + // Introduce local address space + #define __local __attribute__((address_space(3))) + diff --git a/dev-util/hip/hip-7.1.0.ebuild b/dev-util/hip/hip-7.1.0.ebuild index 4e90c13c7a81f..b891484de5a92 100644 --- a/dev-util/hip/hip-7.1.0.ebuild +++ b/dev-util/hip/hip-7.1.0.ebuild @@ -90,6 +90,7 @@ PATCHES=( "${FILESDIR}/${PN}-6.3.0-clr-fix-libcxx.patch" "${FILESDIR}/${PN}-6.4.1-no-glibcxx-assert.patch" "${FILESDIR}/${PN}-7.0.2-fix-libcxx-noinline.patch" + "${FILESDIR}/${PN}-7.0.2-fix-libcxx-ranges.patch" ) QA_FLAGS_IGNORED="usr/lib.*/libhiprtc-builtins.*" diff --git a/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.1.0.ebuild b/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.1.0-r1.ebuild similarity index 60% rename from dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.1.0.ebuild rename to dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.1.0-r1.ebuild index f73d7b0ff195e..c5be88d58c534 100644 --- a/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.1.0.ebuild +++ b/dev-util/rocm_bandwidth_test/rocm_bandwidth_test-7.1.0-r1.ebuild @@ -3,7 +3,8 @@ EAPI=8 -inherit cmake +ROCM_VERSION=${PV} +inherit cmake rocm DESCRIPTION="Bandwidth test for ROCm" HOMEPAGE="https://github.com/ROCm/rocm_bandwidth_test" @@ -14,26 +15,41 @@ 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-libs/boost[stacktrace] - net-misc/curl 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 @@ -43,7 +59,6 @@ src_prepare() { 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 - # https://github.com/ROCm/rocm_bandwidth_test/issues/131 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)/" \ @@ -65,10 +80,22 @@ src_prepare() { 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 @@ -78,15 +105,30 @@ src_configure() { -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() { - cmake_src_compile AMD_TB_LIBRARY + # 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 } diff --git a/sci-libs/aotriton-bin/Manifest b/sci-libs/aotriton-bin/Manifest index cbde7b173593e..88d7ce480f524 100644 --- a/sci-libs/aotriton-bin/Manifest +++ b/sci-libs/aotriton-bin/Manifest @@ -3,5 +3,8 @@ DIST aotriton-0.11b-images-amd-gfx120x.tar.gz 113219528 BLAKE2B 138e88677e967e8e DIST aotriton-0.11b-images-amd-gfx90a.tar.gz 98251729 BLAKE2B b5b62845a17e8e5975698a1d2779ff0b1b7547d2b6fb0258e98d3d110d8995caf8837bfa2051ba2f3e91f1006871658ea0f5f04f8a570f35a02b2daa6642e6b2 SHA512 ef8415216fcc5c4d0d0b8ed44ffd73c5a4710384e04640aad7abfba091fb2150f17570bddab453ef7a0a8c7529dada8651f317b10cc749da3f4bef9cfc76b5eb DIST aotriton-0.11b-images-amd-gfx942.tar.gz 110229134 BLAKE2B 2b3ff118ed511b72722b9b8c86668d3513b3a0e53d7ddbd15a1de1462d63f91e726fd46611a455893d55d28de289772e12e13de4dce1df76f49f88d6a052ad81 SHA512 d968d845522a281fa0210e43a02e787bbef495d2a2e58396ecbb0dae7d96e0bb51fc9d9c9e263eeefb50c064ed5f2c6300e5bab0a101d1eb32f76462852b1168 DIST aotriton-0.11b-images-amd-gfx950.tar.gz 118174108 BLAKE2B 3058d9d45630a21ad7275bd36d98b0f802890ac64b8393a2e86500e088e6f4a41ba1602519e1583f8a9edd0ef62295de20949e5a33df11728c1155f9dc2b0e4f SHA512 6a8f24f94b144a2a5e9f81a4bdec1cdc1a829d18f4240c23d33445af843d9c8d36d115ec0362b4c78b60e43ac014302b1439bc6cff1c48a0981bd7834e37fe9a +DIST aotriton-0.11b-manylinux_2_28_x86_64-rocm6.3-shared.tar.gz 3820239 BLAKE2B c9c98f51999c5b9a4c03496e60d599ad7832e15547cfe53ac6e63613257e2d738cac915be6d279cae99de112442ab2697b416a0e30bc9d2e39f8a04145ef9aa8 SHA512 4b900b6991bbf84961d7a2f25cc56b84f2738472daa26f863123271ce9f1d0af0bcd30c01b1595428a8d93c543d497f46b4ab54326eb37c2300f6ea425e6a1a5 +DIST aotriton-0.11b-manylinux_2_28_x86_64-rocm6.4-shared.tar.gz 3820222 BLAKE2B d7ae6d7aacb72b8e54ed35810214a42cbe29fcb876c338767455180fcde48639f8150a48a6301fd0f1bfb0d250c5272299c3a7839ed62b2f1cf919794190e935 SHA512 9c9f163be9db26aa3221c54eff63f72d6d66bb658b9416ed4ba383194e40579dc0484b78aca93147a165fae1cd09d6f72301e2e5a9ff77f2b56ef763952af98f DIST aotriton-0.11b-manylinux_2_28_x86_64-rocm7.0-shared.tar.gz 3826186 BLAKE2B 7ea9f191f9a7217551f3eca2acee6e04f059e4544d44452c904481f1845e432b6f7de0ca7019344fd6cd348edde18672eb4f2a25d4dd3d1f36c4fe2df97f34b4 SHA512 bbe88a0d65f0dc145db95fc3eb6ee35ec72bec7f194993f93e46bb52331212be18187b5eab3d364863d66e53836ba55e805602e6464fba396a77ab927d45c799 +DIST aotriton-0.11b-manylinux_2_28_x86_64-rocm7.1-shared.tar.gz 3867807 BLAKE2B b0e8e3c6d2b1f09969d50306c4e27cc879f866f8a4012082e0da320a2f6acd34651ecf17d94fc10d6611b11d252095c89b4d3a660923a9842c6817a0255e7cc8 SHA512 1f34156f5c8f396e76a2dff4270a8a953962c602048fa3890cac7887be7d316515995643139396bc5e318dc0ec8802b29a7256082ab870927ee7d663d4a1a8fc DIST aotriton-0.9.2b-manylinux_2_28_x86_64-rocm6.4-shared.tar.gz 444787060 BLAKE2B 26cc079073919266c635e4ee3e7f69fa275fd1351b90cf472c639cd514be09187932868103e4c958f94cfb66e9cf74f6d8f9aac536868ec32272546d80180872 SHA512 b7e14e45e584795470a729a8fcfd6130886bbe772bb201b0afcb1786dc09c58bfae1d8e6e9024919dce93b90d2208271da5716b36a01bfaf1633c177fa1853e5 diff --git a/sci-libs/aotriton-bin/aotriton-bin-0.11b-r1.ebuild b/sci-libs/aotriton-bin/aotriton-bin-0.11b-r1.ebuild new file mode 100644 index 0000000000000..fdd8b10b75f1d --- /dev/null +++ b/sci-libs/aotriton-bin/aotriton-bin-0.11b-r1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN=${PN%*-bin} +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Ahead of Time (AOT) Triton Math Library (binary package)" +HOMEPAGE="https://github.com/ROCm/aotriton" + +URI_PREFIX="https://github.com/ROCm/${MY_PN}/releases/download/${PV}" +SHIM_URI_PREFIX="${URI_PREFIX}/${MY_P}-manylinux_2_28_x86_64" +IMAGES_URI_PREFIX="${URI_PREFIX}/${MY_P}-images-amd" + +# Download libs for all rocm releases (3mb each), but unpack only one. +SRC_URI=" + ${SHIM_URI_PREFIX}-rocm6.3-shared.tar.gz + ${SHIM_URI_PREFIX}-rocm6.4-shared.tar.gz + ${SHIM_URI_PREFIX}-rocm7.0-shared.tar.gz + ${SHIM_URI_PREFIX}-rocm7.1-shared.tar.gz + + amdgpu_targets_gfx90a? ( ${IMAGES_URI_PREFIX}-gfx90a.tar.gz ) + amdgpu_targets_gfx942? ( ${IMAGES_URI_PREFIX}-gfx942.tar.gz ) + amdgpu_targets_gfx950? ( ${IMAGES_URI_PREFIX}-gfx950.tar.gz ) + + amdgpu_targets_gfx1100? ( ${IMAGES_URI_PREFIX}-gfx11xx.tar.gz ) + amdgpu_targets_gfx1101? ( ${IMAGES_URI_PREFIX}-gfx11xx.tar.gz ) + amdgpu_targets_gfx1102? ( ${IMAGES_URI_PREFIX}-gfx11xx.tar.gz ) + amdgpu_targets_gfx1150? ( ${IMAGES_URI_PREFIX}-gfx11xx.tar.gz ) + amdgpu_targets_gfx1151? ( ${IMAGES_URI_PREFIX}-gfx11xx.tar.gz ) + + amdgpu_targets_gfx1200? ( ${IMAGES_URI_PREFIX}-gfx120x.tar.gz ) + amdgpu_targets_gfx1201? ( ${IMAGES_URI_PREFIX}-gfx120x.tar.gz ) +" +S="${WORKDIR}/${MY_PN}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" + +KEYWORDS="-* ~amd64" + +IUSE_TARGETS=( + gfx90a + gfx942 + gfx950 + gfx1100 + gfx1101 + gfx1102 + gfx1150 + gfx1151 + gfx1200 + gfx1201 +) +IUSE_TARGETS=( "${IUSE_TARGETS[@]/#/amdgpu_targets_}" ) +IUSE="${IUSE_TARGETS[*]/#/+}" + +RESTRICT="strip" +QA_PREBUILT="usr/lib*/libaotriton_v2.so.*" + +# glibc & gcc: linked with manylinux version, no rebuild required +# xz-utils: used to decompress lzma blobs with kernels in runtime +# dev-util/hip: must be in sync with SRC_URI +# and trigger reinstall on sub-slot change. +RDEPEND=" + sys-libs/glibc + sys-devel/gcc + app-arch/xz-utils + >=dev-util/hip-6.3:= +