From ea85e29f99f857d0d37b61bc4bdcb7c3323c67a3 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Thu, 21 Mar 2024 14:22:21 +0000 Subject: [PATCH 01/45] dev-libs/half: move half.hpp from /usr/include to /usr/include/half Previous idea to install header to /usr/include was unfortunetely not very good. As Gentoo ships version from ROCm/half, correct place should be /usr/include/half per https://github.com/ROCm/half/blob/rocm-6.0.2/CMakeLists.txt#L27 When half.hpp is installed directly into /usr/include, it causes issues with every ROCm component, including MIOpen, MIVisionX, AMDMIGraphX, rpp, MIFin, rocAL. These projects as well as some other non-ROCm projects include . This change is added with ebuild revbump, with few followup commits: * sci-libs/composable-kernel-5.7.1-r1 will drop dev-libs/half from dependencies (because it was never needed) * sci-libs/miopen 5.1.3 and 5.7.1 should use -DHALF_INCLUDE_DIR Other changes: * Add myself to maintainers * Change HOMEPAGE to https://github.com/ROCm/composable_kernel (because sourceforge code is not used) * Rename ROCmSoftwarePlatform -> ROCm Signed-off-by: Sv. Lockal --- dev-libs/half/half-1.12.0-r1.ebuild | 17 +++++++++++++++++ dev-libs/half/half-1.12.0.ebuild | 17 ----------------- dev-libs/half/metadata.xml | 4 ++++ 3 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 dev-libs/half/half-1.12.0-r1.ebuild delete mode 100644 dev-libs/half/half-1.12.0.ebuild diff --git a/dev-libs/half/half-1.12.0-r1.ebuild b/dev-libs/half/half-1.12.0-r1.ebuild new file mode 100644 index 0000000000000..ca1f81430b3dd --- /dev/null +++ b/dev-libs/half/half-1.12.0-r1.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Half-precision floating-point library" +HOMEPAGE="https://github.com/ROCm/half" +SRC_URI="https://github.com/ROCm/half/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +KEYWORDS="~amd64" +SLOT="0/$(ver_cut 1)" + +src_install() { + insinto /usr/include/half + doins include/half.hpp +} diff --git a/dev-libs/half/half-1.12.0.ebuild b/dev-libs/half/half-1.12.0.ebuild deleted file mode 100644 index ac2051bdc10bf..0000000000000 --- a/dev-libs/half/half-1.12.0.ebuild +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DESCRIPTION="Half-precision floating-point library" -HOMEPAGE="http://half.sourceforge.net/" -SRC_URI="https://github.com/ROCmSoftwarePlatform/half/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="MIT" -KEYWORDS="~amd64" -SLOT="0/$(ver_cut 1)" - -src_install() { - cd include || die - doheader half.hpp -} diff --git a/dev-libs/half/metadata.xml b/dev-libs/half/metadata.xml index b71bc2af0234f..64e8126aa4069 100644 --- a/dev-libs/half/metadata.xml +++ b/dev-libs/half/metadata.xml @@ -12,6 +12,10 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + ROCm/half From 41c72fd6daace929d26e40390a8e3296730b2642 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Tue, 19 Mar 2024 18:39:17 +0000 Subject: [PATCH 02/45] dev-util/hip: fix manifest and add extend-isa-compatibility-check patch for 6.0.0 Other changes: * update patch for gfx1012, repeating https://salsa.debian.org/rocm-team/rocm-hipamd/-/commit/76b378eb687133267874c045396b8cb671bb50f1 * update llvm eclass to r1 * add myself as a maintainer Signed-off-by: Sv. Lockal --- dev-util/hip/Manifest | 1 + ...5.7.1-extend-isa-compatibility-check.patch | 6 +-- .../{hip-6.0.0.ebuild => hip-6.0.0-r1.ebuild} | 47 ++++++++++++------- dev-util/hip/metadata.xml | 6 ++- 4 files changed, 38 insertions(+), 22 deletions(-) rename dev-util/hip/{hip-6.0.0.ebuild => hip-6.0.0-r1.ebuild} (72%) diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest index 98d00a1edc403..1604606203c86 100644 --- a/dev-util/hip/Manifest +++ b/dev-util/hip/Manifest @@ -6,6 +6,7 @@ DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827e DIST rocclr-5.4.3.tar.gz 640557 BLAKE2B 9ab91bab7ffb06c9c0d1c2ae79533fccc597071dda289ac375e32eb2965c638a7029951d2a49d46eeead9d7d242fe3a0cedb3e444d877af1bbf0e2d801c91e11 SHA512 c1d1a2ca08c2d762a221c04d394469aa7aff46086151333b145e0db9a7c7eb3dbbf8b9693e50d816aa9a13c16b4ebacf5ff3d5d8ff3393a8a764728ef5172d3a DIST rocclr-5.5.1.tar.gz 634330 BLAKE2B e6383a6b6b09f274a944d66effd345e38a191ec73ee5c5240f8ec8bb62a4df97b80835ce57f8f78c3834602b9da425b49289b5c7cd7e4c7071147ff409c6a6c9 SHA512 4c12011d22a4f14d9e93250b2a38716eb973139afa1adbbbd51c0e0ed13c0b7c1f45a37c71ef937c5fdabf09e928d7913ca3332fc61b7a2c10d21421306a228f DIST rocm-5.7.0.tar.gz 845881 BLAKE2B 08255edc1407e5ef85895336b11496319695318fce265565728ad75175b5e1dfab98f696fee2d27e60c48e862f721fad4c53118cc70b807353fff5f97ed72ac2 SHA512 72420e16c7cfe9687e030331838666dabaa43d686bdad1d109431e44db99070a2cf6dd64b59e3275019abedd6612f6008c798a79275e7225b6b122fb9f644660 +DIST rocm-6.0.0.tar.gz 959401 BLAKE2B e437abe4ecb8863a363358912e20ec9c5d6f04e74e120d7bbe1782e640dfe2902f7f7818765bb5760d85f7a7454b4d6be4970ed2e5e4ddbf3bfa4e5894d9da55 SHA512 02bcfd5e2b6460b6ce5ca0cb3e5197bae1ea8a58a4e389845399806cf30f437bb757f2ba21b37b62d9cb543a04d357983dc204739234a53a7861a4c839c35651 DIST rocm-clr-5.7.1.tar.gz 2008647 BLAKE2B 3db0760d6f83504e60caf88a2dd5e0bc02c7db9d6f263ad0eb2cfc79aa0f88a3699c412844a0158a796d9d02e79660287e791edad787d814eefffea4fd2298b4 SHA512 d79323481d82fc02c12a32cdcc0d14437d512af023e7737db0387b7eecb27fe6e4ae7c71d6adce57932a04bb24c880440d9dc10aeb5af11a4f2ca64d44330965 DIST rocm-clr-6.0.0.tar.gz 1983453 BLAKE2B 2cf6ec7c3b0ec5dedeea94ff54af30662b781fc2eee22e3315094af61dc9d331eba33c1d9d463295848c5724e515a3137f9b189c1261273afad1a5f9d32226c2 SHA512 12e77a121150d8c25121b98bd7c6233c2568f9f4130bdbe6bc3ab225f14b8bea6a6bdc4ed497c0f999d3d3daabdca0de8caaa1b69911c11974b5d6f951734433 DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24 diff --git a/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch b/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch index 7853de693cdea..25bdfba07fd2e 100644 --- a/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch +++ b/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch @@ -42,7 +42,7 @@ https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026 +} + +static bool isGfx1010EquivalentProcessor(const std::string& processor) { -+ return matches(GfxPattern{"gfx101", "02"}, processor); ++ return matches(GfxPattern{"gfx101", "0"}, processor); +} + +static bool isGfx1010SupersetProcessor(const std::string& processor) { @@ -181,7 +181,7 @@ https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026 } --- a/rocclr/device/device.cpp +++ b/rocclr/device/device.cpp -@@ -232,10 +232,49 @@ std::string Isa::isaName() const { +@@ -234,10 +234,49 @@ std::string Isa::isaName() const { return std::string(hsaIsaNamePrefix) + targetId(); } @@ -211,7 +211,7 @@ https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026 + } + } else if (codeObjectIsa.versionMajor() == 10) { + if (codeObjectIsa.versionMinor() == 1) { -+ const std::array gfx1010_equivalent = { 0, 2 }; ++ const std::array gfx1010_equivalent = { 0 }; + const std::array gfx1010_superset = { 0, 1, 2, 3 }; + if (Contains(gfx1010_equivalent, codeObjectIsa.versionStepping()) && + Contains(gfx1010_superset, agentIsa.versionStepping())) { diff --git a/dev-util/hip/hip-6.0.0.ebuild b/dev-util/hip/hip-6.0.0-r1.ebuild similarity index 72% rename from dev-util/hip/hip-6.0.0.ebuild rename to dev-util/hip/hip-6.0.0-r1.ebuild index ff53e07dc49a7..cc9d5aafa87f5 100644 --- a/dev-util/hip/hip-6.0.0.ebuild +++ b/dev-util/hip/hip-6.0.0-r1.ebuild @@ -7,17 +7,15 @@ DOCS_BUILDER="doxygen" DOCS_DEPEND="media-gfx/graphviz" ROCM_SKIP_GLOBALS=1 -inherit cmake docs flag-o-matic llvm rocm +LLVM_COMPAT=( 17 ) -LLVM_MAX_SLOT=17 - -TEST_PV=5.7.0 # No hip-test-5.7.1 release +inherit cmake docs flag-o-matic llvm-r1 rocm DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability" -HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd" -SRC_URI="https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz - https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz - test? ( https://github.com/ROCm-Developer-Tools/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz )" +HOMEPAGE="https://github.com/ROCm/clr" +SRC_URI="https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz + https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz + test? ( https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${PV}.tar.gz )" KEYWORDS="~amd64" LICENSE="MIT" @@ -29,9 +27,11 @@ IUSE="debug test" DEPEND=" dev-util/hipcc >=dev-util/rocminfo-5 - sys-devel/clang:${LLVM_MAX_SLOT} + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT} + ') dev-libs/rocm-comgr:${SLOT} - >=dev-libs/rocr-runtime-5.6 + dev-libs/rocr-runtime:${SLOT} x11-base/xorg-proto virtual/opengl " @@ -60,12 +60,13 @@ hip_test_wrapper() { } src_prepare() { - # hipamd is itself built by cmake, and should never provide a - # FindHIP.cmake module. - rm -r "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP* || die + # Set HIP and HIP Clang paths directly, don't search using heuristics + sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \ + -e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \ + -i "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP.cmake || die - # https://github.com/ROCm-Developer-Tools/HIP/commit/405d029422ba8bb6be5a233d5eebedd2ad2e8bd3 - # https://github.com/ROCm-Developer-Tools/clr/commit/ab6d34ae773f4d151e04170c0f4e46c1135ddf3e + # https://github.com/ROCm/HIP/commit/405d029422ba8bb6be5a233d5eebedd2ad2e8bd3 + # https://github.com/ROCm/clr/commit/ab6d34ae773f4d151e04170c0f4e46c1135ddf3e # Migrated to hip-test, but somehow the change is not applied to the tarball. rm -rf "${WORKDIR}"/HIP-rocm-${PV}/tests || die sed -e '/tests.*cmake/d' -i hipamd/CMakeLists.txt || die @@ -91,13 +92,12 @@ src_configure() { # Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382 # See also: https://github.com/gentoo/gentoo/pull/29097 - append-ldflags $(tc-flags-CCLD -Wl,--undefined-version) + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) local mycmakeargs=( - -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")" + -DCMAKE_PREFIX_PATH="$(get_llvm_prefix)" -DCMAKE_BUILD_TYPE=${buildtype} -DCMAKE_SKIP_RPATH=ON - -DBUILD_HIPIFY_CLANG=OFF -DHIP_PLATFORM=amd -DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}" -DROCM_PATH="${EPREFIX}/usr" @@ -153,6 +153,17 @@ src_test() { src_install() { cmake_src_install + # add version file that is required by some libraries + mkdir "${ED}"/usr/include/rocm-core || die + cat < "${ED}"/usr/include/rocm-core/rocm_version.h || die +#pragma once +#define ROCM_VERSION_MAJOR $(ver_cut 1) +#define ROCM_VERSION_MINOR $(ver_cut 2) +#define ROCM_VERSION_PATCH $(ver_cut 3) +#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown" +EOF + dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h + # files already installed by hipcc, which is a build dep rm "${ED}/usr/bin/hipconfig.pl" || die rm "${ED}/usr/bin/hipcc.pl" || die diff --git a/dev-util/hip/metadata.xml b/dev-util/hip/metadata.xml index 21b0e03f6a411..0d035a1395605 100644 --- a/dev-util/hip/metadata.xml +++ b/dev-util/hip/metadata.xml @@ -17,7 +17,11 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCm-Developer-Tools/HIP + ROCm/HIP From 14cffc176b75232d1f208a06ce79913f5d036d9d Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:17:50 +0000 Subject: [PATCH 03/45] dev-util/hip: add 6.1.0, drop 6.0.0-r1 Signed-off-by: Sv. Lockal --- dev-util/hip/Manifest | 6 +- ...6.1.0-extend-isa-compatibility-check.patch | 236 ++++++++++++++++++ .../files/hip-6.1.0-no-hipcc-install.patch | 20 ++ ...-test-5.7.1-remove-incompatible-flag.patch | 28 +++ .../hip-test-6.0.2-hipcc-system-install.patch | 43 ++++ ...-6.1.0-disable-hipKerArgOptimization.patch | 23 ++ .../{hip-6.0.0-r1.ebuild => hip-6.1.0.ebuild} | 63 ++--- 7 files changed, 378 insertions(+), 41 deletions(-) create mode 100644 dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check.patch create mode 100644 dev-util/hip/files/hip-6.1.0-no-hipcc-install.patch create mode 100644 dev-util/hip/files/hip-test-5.7.1-remove-incompatible-flag.patch create mode 100644 dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch create mode 100644 dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch rename dev-util/hip/{hip-6.0.0-r1.ebuild => hip-6.1.0.ebuild} (70%) diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest index 1604606203c86..bae991fddda3f 100644 --- a/dev-util/hip/Manifest +++ b/dev-util/hip/Manifest @@ -1,14 +1,14 @@ DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a DIST hip-5.7.1.tar.gz 553774 BLAKE2B f88c235f688d3a662ec6cb4ad7fe3f82c0015015997871609cc30ab5b2f7fcb9709a08683d77194e45a6dbbe1d24c6355b128d2ecf655f1dea3468711c64e0a3 SHA512 68fa8753725b53c999d102d254c6b1dba53af4e00d6a48db93d10213cc02eec30b4a39c66e773d4f625dd9636cf8b0c5faa05b69fac27cf5a6b19dd3ddd2b905 -DIST hip-6.0.0.tar.gz 243451 BLAKE2B c404d23f7ee46a6c5601077d598edf4d6b2ca48da5e6cabf45c926ee1224eedc3d9eb6715948bc44cf3da2431a2feb879b1b8cd35bac69319c9dc066ab2e12f7 SHA512 2beb100812f9f515d6bc29fd4930913c2ff64c4f824727c9fc38d2e249841c840bd35357f652ab2b5022d166331de8f7409e72c49a5f69042f54f16a6a290339 +DIST hip-6.1.0.tar.gz 247180 BLAKE2B 14cbce1ab73b793debf625df609c13c2d408ce93ea4d1f2cd12ab0b2659985286f3a1d923a310ec6cdcf293b3a05cb35a9827ab574fa31a9a75d81defd4e84ac SHA512 554e95352e8c0cc7b4c891b3fcb5059dc507bd38df75c09046d005868befb18cff0997af8b52716b944d5b421ed6f9b6fdc8a4335819a49b5dfc009323dae597 +DIST hip-test-6.1.0.tar.gz 1080598 BLAKE2B b934502536186b8fdd73637965b9c6991f3200767de17418a43262c7ff282ff47cc3e1f6ffb29e22dd8026ee793f95f515540ce7603a31d78d73e08b76115d72 SHA512 3c1663aee8f40cdf072d7cdab69d64f5251ce00d79ef1d59cf4c85bed17144491723baf5af338e4dd5294f3a1e24092fcf1fb82d69d740ffef34d38e8924f160 DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924 DIST rocclr-5.4.3.tar.gz 640557 BLAKE2B 9ab91bab7ffb06c9c0d1c2ae79533fccc597071dda289ac375e32eb2965c638a7029951d2a49d46eeead9d7d242fe3a0cedb3e444d877af1bbf0e2d801c91e11 SHA512 c1d1a2ca08c2d762a221c04d394469aa7aff46086151333b145e0db9a7c7eb3dbbf8b9693e50d816aa9a13c16b4ebacf5ff3d5d8ff3393a8a764728ef5172d3a DIST rocclr-5.5.1.tar.gz 634330 BLAKE2B e6383a6b6b09f274a944d66effd345e38a191ec73ee5c5240f8ec8bb62a4df97b80835ce57f8f78c3834602b9da425b49289b5c7cd7e4c7071147ff409c6a6c9 SHA512 4c12011d22a4f14d9e93250b2a38716eb973139afa1adbbbd51c0e0ed13c0b7c1f45a37c71ef937c5fdabf09e928d7913ca3332fc61b7a2c10d21421306a228f DIST rocm-5.7.0.tar.gz 845881 BLAKE2B 08255edc1407e5ef85895336b11496319695318fce265565728ad75175b5e1dfab98f696fee2d27e60c48e862f721fad4c53118cc70b807353fff5f97ed72ac2 SHA512 72420e16c7cfe9687e030331838666dabaa43d686bdad1d109431e44db99070a2cf6dd64b59e3275019abedd6612f6008c798a79275e7225b6b122fb9f644660 -DIST rocm-6.0.0.tar.gz 959401 BLAKE2B e437abe4ecb8863a363358912e20ec9c5d6f04e74e120d7bbe1782e640dfe2902f7f7818765bb5760d85f7a7454b4d6be4970ed2e5e4ddbf3bfa4e5894d9da55 SHA512 02bcfd5e2b6460b6ce5ca0cb3e5197bae1ea8a58a4e389845399806cf30f437bb757f2ba21b37b62d9cb543a04d357983dc204739234a53a7861a4c839c35651 DIST rocm-clr-5.7.1.tar.gz 2008647 BLAKE2B 3db0760d6f83504e60caf88a2dd5e0bc02c7db9d6f263ad0eb2cfc79aa0f88a3699c412844a0158a796d9d02e79660287e791edad787d814eefffea4fd2298b4 SHA512 d79323481d82fc02c12a32cdcc0d14437d512af023e7737db0387b7eecb27fe6e4ae7c71d6adce57932a04bb24c880440d9dc10aeb5af11a4f2ca64d44330965 -DIST rocm-clr-6.0.0.tar.gz 1983453 BLAKE2B 2cf6ec7c3b0ec5dedeea94ff54af30662b781fc2eee22e3315094af61dc9d331eba33c1d9d463295848c5724e515a3137f9b189c1261273afad1a5f9d32226c2 SHA512 12e77a121150d8c25121b98bd7c6233c2568f9f4130bdbe6bc3ab225f14b8bea6a6bdc4ed497c0f999d3d3daabdca0de8caaa1b69911c11974b5d6f951734433 +DIST rocm-clr-6.1.0.tar.gz 2026123 BLAKE2B 06ca596ab38b4345101fe8edbbe568bb2c0fa1ec6b23231a0e8b12f2042849396968ba63f0a6a5e6ef2ba876f6cd34e469de5b1eacc41326dd3a3bb07d604a1f SHA512 2b75ca5dbff2862f43229bbcc418cc8294454b1b7787c630350560bf4cb4555d1533ec57c75f9e62ac3280cbf08ed7e712c904e2917ccb8c9afdfbc4ad62be04 DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24 DIST rocm-hip-5.3.3.tar.gz 1151858 BLAKE2B 5f460b2078c850b3eb4414fcec4a6f951a3b282aa9828f77ba5d5adfdc0ee8d2e62c856e112a154c340daaf7dad49f4871412edd7b38f7fae2e6b17840ee144b SHA512 e747cc10e78cd09009cac762f0e060be13f3447af7ec2a4a2889cbdc09cd76ecb1b5b58c89f09a3b45a8296c2c71e1c55baf113e58a5a12434af3de7168b8d87 DIST rocm-hip-5.4.3.tar.gz 1195173 BLAKE2B 7452ee7a874bc4703b0d3aaaf9fa2a51e223d5650c65c34982a9981dbe14e8ec70c93d7e70c5ad36a8d02c3d2214fa6a393e20502a01418fb3320d8cfe363feb SHA512 1f4100e114576dcbad83aae453e21ab85cf25bd8a6ada380bb11cfc30e5f92ba903055b7257a099321a84b65adb444dd52b8258e82567f4bc882e65d89369b43 diff --git a/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check.patch b/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check.patch new file mode 100644 index 0000000000000..28b78a779ef86 --- /dev/null +++ b/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check.patch @@ -0,0 +1,236 @@ +Combined with matching changes within rocr-runtime ebuild, this patch allows +to load compatible kernels whenever possible. +For example if AMDGPU_TARGETS is set to gfx1030 and some application +was started on gfx1036, it loads gfx1030 kernel. + +Author: Cordell Bloor +https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0025-improve-rocclr-isa-compatibility-check.patch +https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026-extend-hip-isa-compatibility-check.patch +--- a/hipamd/src/hip_code_object.cpp ++++ b/hipamd/src/hip_code_object.cpp +@@ -390,47 +390,123 @@ static bool getTripleTargetID(std::string bundled_co_entry_id, const void* code_ + return true; + } + +-static bool isCodeObjectCompatibleWithDevice(std::string co_triple_target_id, +- std::string agent_triple_target_id) { ++struct GfxPattern { ++ std::string root; ++ std::string suffixes; ++}; ++ ++static bool matches(const GfxPattern& p, const std::string& s) { ++ if (p.root.size() + 1 != s.size()) { ++ return false; ++ } ++ if (0 != std::memcmp(p.root.data(), s.data(), p.root.size())) { ++ return false; ++ } ++ return p.suffixes.find(s[p.root.size()]) != std::string::npos; ++} ++ ++static bool isGfx900EquivalentProcessor(const std::string& processor) { ++ return matches(GfxPattern{"gfx90", "029c"}, processor); ++} ++ ++static bool isGfx900SupersetProcessor(const std::string& processor) { ++ return matches(GfxPattern{"gfx90", "0269c"}, processor); ++} ++ ++static bool isGfx1030EquivalentProcessor(const std::string& processor) { ++ return matches(GfxPattern{"gfx103", "0123456"}, processor); ++} ++ ++static bool isGfx1010EquivalentProcessor(const std::string& processor) { ++ return matches(GfxPattern{"gfx101", "0"}, processor); ++} ++ ++static bool isGfx1010SupersetProcessor(const std::string& processor) { ++ return matches(GfxPattern{"gfx101", "0123"}, processor); ++} ++ ++enum CompatibilityScore { ++ CS_EXACT_MATCH = 1 << 4, ++ CS_PROCESSOR_MATCH = 1 << 3, ++ CS_PROCESSOR_COMPATIBLE = 1 << 2, ++ CS_XNACK_SPECIALIZED = 1 << 1, ++ CS_SRAM_ECC_SPECIALIZED = 1 << 0, ++ CS_INCOMPATIBLE = 0, ++}; ++ ++static int getProcessorCompatibilityScore(const std::string& co_processor, ++ const std::string& agent_processor) { ++ if (co_processor == agent_processor) ++ return CS_PROCESSOR_MATCH; ++ ++ if (isGfx900SupersetProcessor(agent_processor)) ++ return isGfx900EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE; ++ ++ if (isGfx1010SupersetProcessor(agent_processor)) ++ return isGfx1010EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE; ++ ++ if (isGfx1030EquivalentProcessor(agent_processor)) ++ return isGfx1030EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE; ++ ++ return CS_INCOMPATIBLE; ++} ++ ++static int getCompatiblityScore(std::string co_triple_target_id, ++ std::string agent_triple_target_id) { + // Primitive Check +- if (co_triple_target_id == agent_triple_target_id) return true; ++ if (co_triple_target_id == agent_triple_target_id) return CS_EXACT_MATCH; + + // Parse code object triple target id + if (!consume(co_triple_target_id, std::string(kAmdgcnTargetTriple) + '-')) { +- return false; ++ return CS_INCOMPATIBLE; + } + + std::string co_processor; + char co_sram_ecc, co_xnack; + if (!getTargetIDValue(co_triple_target_id, co_processor, co_sram_ecc, co_xnack)) { +- return false; ++ return CS_INCOMPATIBLE; + } + +- if (!co_triple_target_id.empty()) return false; ++ if (!co_triple_target_id.empty()) return CS_INCOMPATIBLE; + + // Parse agent isa triple target id + if (!consume(agent_triple_target_id, std::string(kAmdgcnTargetTriple) + '-')) { +- return false; ++ return CS_INCOMPATIBLE; + } + + std::string agent_isa_processor; + char isa_sram_ecc, isa_xnack; + if (!getTargetIDValue(agent_triple_target_id, agent_isa_processor, isa_sram_ecc, isa_xnack)) { +- return false; ++ return CS_INCOMPATIBLE; + } + +- if (!agent_triple_target_id.empty()) return false; ++ if (!agent_triple_target_id.empty()) return CS_INCOMPATIBLE; + + // Check for compatibility +- if (agent_isa_processor != co_processor) return false; +- if (co_sram_ecc != ' ') { +- if (co_sram_ecc != isa_sram_ecc) return false; ++ int processor_score = getProcessorCompatibilityScore(co_processor, agent_isa_processor); ++ if (processor_score == CS_INCOMPATIBLE) { ++ return CS_INCOMPATIBLE; + } +- if (co_xnack != ' ') { +- if (co_xnack != isa_xnack) return false; ++ ++ int xnack_bonus; ++ if (co_xnack == ' ') { ++ xnack_bonus = 0; ++ } else if (co_xnack == isa_xnack) { ++ xnack_bonus = CS_XNACK_SPECIALIZED; ++ } else { ++ return CS_INCOMPATIBLE; + } + +- return true; ++ int sram_ecc_bonus; ++ if (co_sram_ecc == ' ') { ++ sram_ecc_bonus = 0; ++ } else if (co_sram_ecc == isa_sram_ecc) { ++ sram_ecc_bonus = CS_SRAM_ECC_SPECIALIZED; ++ } else { ++ return CS_INCOMPATIBLE; ++ } ++ ++ return processor_score + xnack_bonus + sram_ecc_bonus; + } + + // This will be moved to COMGR eventually +@@ -483,6 +559,7 @@ hipError_t CodeObject::extractCodeObjectFromFatBinary( + for (size_t i = 0; i < agent_triple_target_ids.size(); i++) { + code_objs.push_back(std::make_pair(nullptr, 0)); + } ++ std::vector compatibility_score(agent_triple_target_ids.size()); + + const auto obheader = reinterpret_cast(data); + const auto* desc = &obheader->desc[0]; +@@ -495,17 +572,19 @@ hipError_t CodeObject::extractCodeObjectFromFatBinary( + reinterpret_cast(reinterpret_cast(obheader) + desc->offset); + const size_t image_size = desc->size; + +- if (num_code_objs == 0) break; + std::string bundleEntryId{desc->bundleEntryId, desc->bundleEntryIdSize}; + + std::string co_triple_target_id; + if (!getTripleTargetID(bundleEntryId, image, co_triple_target_id)) continue; + + for (size_t dev = 0; dev < agent_triple_target_ids.size(); ++dev) { +- if (code_objs[dev].first) continue; +- if (isCodeObjectCompatibleWithDevice(co_triple_target_id, agent_triple_target_ids[dev])) { ++ if (compatibility_score[dev] >= CS_PROCESSOR_MATCH) continue; ++ int score = getCompatiblityScore(co_triple_target_id, agent_triple_target_ids[dev]); ++ if (score > compatibility_score[dev]) { ++ compatibility_score[dev] = score; ++ if (!code_objs[dev].first) ++ --num_code_objs; + code_objs[dev] = std::make_pair(image, image_size); +- --num_code_objs; + } + } + } +--- a/rocclr/device/device.cpp ++++ b/rocclr/device/device.cpp +@@ -232,10 +232,49 @@ std::string Isa::isaName() const { + return std::string(hsaIsaNamePrefix) + targetId(); + } + ++template ++static bool Contains(const std::array& arr, const T& value) { ++ return std::find(std::begin(arr), std::end(arr), value) != std::end(arr); ++} ++ ++static bool IsVersionCompatible(const Isa &codeObjectIsa, ++ const Isa &agentIsa) { ++ if (codeObjectIsa.versionMajor() == agentIsa.versionMajor() && ++ codeObjectIsa.versionMinor() == agentIsa.versionMinor()) { ++ ++ if (codeObjectIsa.versionStepping() == agentIsa.versionStepping()) { ++ return true; // exact match ++ } ++ ++ // The code object and the agent may sometimes be compatible if ++ // they differ only by stepping version. ++ if (codeObjectIsa.versionMajor() == 9 && ++ codeObjectIsa.versionMinor() == 0) { ++ const std::array gfx900_equivalent = { 0, 2, 9, 12 }; ++ const std::array gfx900_superset = { 0, 2, 6, 9, 12 }; ++ if (Contains(gfx900_equivalent, codeObjectIsa.versionStepping()) && ++ Contains(gfx900_superset, agentIsa.versionStepping())) { ++ return true; // gfx900 compatible object and agent ++ } ++ } else if (codeObjectIsa.versionMajor() == 10) { ++ if (codeObjectIsa.versionMinor() == 1) { ++ const std::array gfx1010_equivalent = { 0 }; ++ const std::array gfx1010_superset = { 0, 1, 2, 3 }; ++ if (Contains(gfx1010_equivalent, codeObjectIsa.versionStepping()) && ++ Contains(gfx1010_superset, agentIsa.versionStepping())) { ++ return true; // gfx1010 compatible object and agent ++ } ++ } else if (codeObjectIsa.versionMinor() == 3) { ++ return true; // gfx1030 compatible object and agent ++ } ++ } ++ } ++ ++ return false; ++} ++ + bool Isa::isCompatible(const Isa &codeObjectIsa, const Isa &agentIsa) { +- if (codeObjectIsa.versionMajor() != agentIsa.versionMajor() || +- codeObjectIsa.versionMinor() != agentIsa.versionMinor() || +- codeObjectIsa.versionStepping() != agentIsa.versionStepping()) ++ if (!IsVersionCompatible(codeObjectIsa, agentIsa)) + return false; + + assert(codeObjectIsa.isSrameccSupported() == agentIsa.isSrameccSupported() && \ No newline at end of file diff --git a/dev-util/hip/files/hip-6.1.0-no-hipcc-install.patch b/dev-util/hip/files/hip-6.1.0-no-hipcc-install.patch new file mode 100644 index 0000000000000..13770fdcdd77f --- /dev/null +++ b/dev-util/hip/files/hip-6.1.0-no-hipcc-install.patch @@ -0,0 +1,20 @@ +These files already installed by hipcc, which is a runtime dep +--- a/hipamd/CMakeLists.txt ++++ b/hipamd/CMakeLists.txt +@@ -401,16 +401,7 @@ if (NOT ${HIPCC_BIN_DIR} STREQUAL "") + set(hipcc_bin ${hipcc_bin}.exe) + set(hipconfig_bin ${hipconfig_bin}.exe) + endif() +- if(EXISTS ${hipcc_bin} AND EXISTS ${hipconfig_bin}) +- install(PROGRAMS ${hipcc_bin} DESTINATION bin) +- install(PROGRAMS ${hipconfig_bin} DESTINATION bin) +- endif() + endif() +- install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc DESTINATION bin) +- install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig DESTINATION bin) +- install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin) +- install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin) +- install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin) + if(WIN32) + install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin) + install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin) diff --git a/dev-util/hip/files/hip-test-5.7.1-remove-incompatible-flag.patch b/dev-util/hip/files/hip-test-5.7.1-remove-incompatible-flag.patch new file mode 100644 index 0000000000000..aa67fcfcfa14c --- /dev/null +++ b/dev-util/hip/files/hip-test-5.7.1-remove-incompatible-flag.patch @@ -0,0 +1,28 @@ +https://github.com/ROCm/hip-tests/pull/443 + +From cb0140843a162f69c454e91cd994524423b39b8c Mon Sep 17 00:00:00 2001 +From: Yiyang Wu +Date: Sun, 10 Dec 2023 21:57:14 +0800 +Subject: [PATCH] -fallow-half-arguments-and-returns is not recognized by clang + +Reference: https://reviews.llvm.org/D145345 +Issue: https://github.com/ROCm/HIP/issues/3178 +Signed-off-by: Yiyang Wu +--- + catch/unit/deviceLib/CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/catch/unit/deviceLib/CMakeLists.txt b/catch/unit/deviceLib/CMakeLists.txt +index 0645def..3662cbd 100644 +--- catch/unit/deviceLib/CMakeLists.txt ++++ catch/unit/deviceLib/CMakeLists.txt +@@ -171,7 +171,6 @@ if(${ARCH_CHECK} GREATER_EQUAL 0) + set_source_files_properties(unsafeAtomicAdd_NonCoherent_withunsafeflag.cc PROPERTIES COMPILE_OPTIONS "-munsafe-fp-atomics") + set_source_files_properties(unsafeAtomicAdd_Coherent_withnounsafeflag.cc PROPERTIES COMPILE_OPTIONS "-mno-unsafe-fp-atomics") + set_source_files_properties(unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc PROPERTIES COMPILE_OPTIONS "-mno-unsafe-fp-atomics") +- set_source_files_properties(hipMathFunctions.cc PROPERTIES COMPILE_FLAGS "-Xclang -fallow-half-arguments-and-returns") + file(GLOB AtomicAdd_files *AtomicAdd_*_*.cc) + set_property(SOURCE ${AtomicAdd_files} PROPERTY COMPILE_FLAGS --save-temps) + file(GLOB unsafeAtomicAdd_files *unsafeAtomicAdd_*_*.cc) +-- +2.42.0 \ No newline at end of file diff --git a/dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch b/dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch new file mode 100644 index 0000000000000..a92e93280af45 --- /dev/null +++ b/dev-util/hip/files/hip-test-6.0.2-hipcc-system-install.patch @@ -0,0 +1,43 @@ +In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH. + +Index: catch/CMakeLists.txt +=================================================================== +--- catch.orig/CMakeLists.txt ++++ catch/CMakeLists.txt +@@ -55,9 +55,9 @@ endif() + message(STATUS "HIP_PATH: ${HIP_PATH}") + message(STATUS "ROCM_PATH: ${ROCM_PATH}") + +-set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc${EXT}") +-set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc${EXT}") +-set(HIPCONFIG_EXECUTABLE "${HIP_PATH}/bin/hipconfig${EXT}") ++set(CMAKE_CXX_COMPILER "hipcc${EXT}") ++set(CMAKE_C_COMPILER "hipcc${EXT}") ++set(HIPCONFIG_EXECUTABLE "hipconfig${EXT}") + execute_process(COMMAND ${HIPCONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE HIP_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) +@@ -183,9 +183,8 @@ message(STATUS "CMAKE HIP ARCHITECTURES: + # OFFLOAD_ARCH_STR + # rocm_agent_enumerator + if(NOT DEFINED OFFLOAD_ARCH_STR +- AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerator" + AND HIP_PLATFORM STREQUAL "amd" AND UNIX) +- execute_process(COMMAND "${ROCM_PATH}/bin/rocm_agent_enumerator" ++ execute_process(COMMAND "rocm_agent_enumerator" + OUTPUT_VARIABLE HIP_GPU_ARCH + RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE) +Index: catch/hipTestMain/hip_test_context.cc +=================================================================== +--- catch.orig/hipTestMain/hip_test_context.cc ++++ catch/hipTestMain/hip_test_context.cc +@@ -37,7 +37,7 @@ std::string TestContext::substringFound( + + std::string TestContext::getCurrentArch() { + #if HT_LINUX +- const char* cmd = "/opt/rocm/bin/rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'"; ++ const char* cmd = "rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'"; + std::array buffer; + std::string result; + std::unique_ptr pipe(popen(cmd, "r"), pclose); \ No newline at end of file diff --git a/dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch b/dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch new file mode 100644 index 0000000000000..fd73393bef220 --- /dev/null +++ b/dev-util/hip/files/hip-test-6.1.0-disable-hipKerArgOptimization.patch @@ -0,0 +1,23 @@ +Those tests requires >=clang-18 to support -amdgpu-kernarg-preload-count +--- a/unit/module/CMakeLists.txt ++++ b/unit/module/CMakeLists.txt +@@ -41,9 +41,6 @@ add_custom_target(copyKernel.s + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --rocm-path=${ROCM_PATH}) + + if(UNIX) +-set(TEST_SRC +- ${TEST_SRC} +- hipKerArgOptimization.cc) + + add_custom_target(copiousArgKernel.code + COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} +@@ -106,8 +103,4 @@ hip_add_exe_to_target(NAME ModuleTest + TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC}) + + add_dependencies(build_tests copyKernel.code copyKernel.s) +-if(UNIX) +-add_dependencies(build_tests copiousArgKernel.code copiousArgKernel0.code copiousArgKernel1.code copiousArgKernel2.code +-copiousArgKernel3.code copiousArgKernel16.code copiousArgKernel17.code) + endif() +-endif() +\ No newline at end of file \ No newline at end of file diff --git a/dev-util/hip/hip-6.0.0-r1.ebuild b/dev-util/hip/hip-6.1.0.ebuild similarity index 70% rename from dev-util/hip/hip-6.0.0-r1.ebuild rename to dev-util/hip/hip-6.1.0.ebuild index cc9d5aafa87f5..10a30e672d938 100644 --- a/dev-util/hip/hip-6.0.0-r1.ebuild +++ b/dev-util/hip/hip-6.1.0.ebuild @@ -11,21 +11,24 @@ LLVM_COMPAT=( 17 ) inherit cmake docs flag-o-matic llvm-r1 rocm +TEST_PV=${PV} + DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability" HOMEPAGE="https://github.com/ROCm/clr" SRC_URI="https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz - test? ( https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${PV}.tar.gz )" + https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz -> hip-test-${TEST_PV}.tar.gz" +S="${WORKDIR}/clr-rocm-${PV}/" +TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch" -KEYWORDS="~amd64" LICENSE="MIT" SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" -RESTRICT="!test? ( test )" IUSE="debug test" +RESTRICT="!test? ( test )" DEPEND=" - dev-util/hipcc >=dev-util/rocminfo-5 $(llvm_gen_dep ' sys-devel/clang:${LLVM_SLOT} @@ -35,48 +38,40 @@ DEPEND=" x11-base/xorg-proto virtual/opengl " +BDEPEND="test? ( dev-util/hipcc )" RDEPEND="${DEPEND} + dev-util/hipcc dev-perl/URI-Encode sys-devel/clang-runtime:= >=dev-libs/roct-thunk-interface-5" PATCHES=( - "${FILESDIR}/${PN}-5.7.0-install.patch" - "${FILESDIR}/${PN}-5.7.1-fix-unaligned-access.patch" - "${FILESDIR}/${PN}-5.7.1-exec-stack.patch" "${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch" "${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch" - "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch" + "${FILESDIR}/${PN}-6.1.0-extend-isa-compatibility-check.patch" + "${FILESDIR}/${PN}-6.1.0-no-hipcc-install.patch" ) -S="${WORKDIR}/clr-rocm-${PV}/" - hip_test_wrapper() { - local S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch" - local CMAKE_USE_DIR="${S}" - local BUILD_DIR="${S}_build" - cd "${S}" || die + local CMAKE_USE_DIR="${TEST_S}" + local BUILD_DIR="${TEST_S}_build" + cd "${TEST_S}" || die $@ } src_prepare() { - # Set HIP and HIP Clang paths directly, don't search using heuristics - sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \ - -e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \ - -i "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP.cmake || die - - # https://github.com/ROCm/HIP/commit/405d029422ba8bb6be5a233d5eebedd2ad2e8bd3 - # https://github.com/ROCm/clr/commit/ab6d34ae773f4d151e04170c0f4e46c1135ddf3e - # Migrated to hip-test, but somehow the change is not applied to the tarball. - rm -rf "${WORKDIR}"/HIP-rocm-${PV}/tests || die - sed -e '/tests.*cmake/d' -i hipamd/CMakeLists.txt || die + # hipamd is itself built by cmake, and should never provide a + # FindHIP.cmake module. + rm -r "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP* || die cmake_src_prepare - if use test; then - PATCHES=${FILESDIR}/hip-test-5.7.0-rocm_agent_enumerator-location.patch \ - hip_test_wrapper cmake_src_prepare - fi + local PATCHES=( + "${FILESDIR}"/hip-test-6.0.2-hipcc-system-install.patch + "${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch + "${FILESDIR}"/hip-test-6.1.0-disable-hipKerArgOptimization.patch + ) + hip_test_wrapper cmake_src_prepare } src_configure() { @@ -114,8 +109,9 @@ src_configure() { local mycmakeargs=( -DROCM_PATH="${BUILD_DIR}"/hipamd -DHIP_PLATFORM=amd + -DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2" ) - hip_test_wrapper cmake_src_configure + HIP_PATH="${EPREFIX}/usr" hip_test_wrapper cmake_src_configure fi } @@ -163,13 +159,4 @@ src_install() { #define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown" EOF dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h - - # files already installed by hipcc, which is a build dep - rm "${ED}/usr/bin/hipconfig.pl" || die - rm "${ED}/usr/bin/hipcc.pl" || die - rm "${ED}/usr/bin/hipcc" || die - rm "${ED}/usr/bin/hipcc.bin" || die - rm "${ED}/usr/bin/hipconfig" || die - rm "${ED}/usr/bin/hipconfig.bin" || die - rm "${ED}/usr/bin/hipvars.pm" || die } From 630620ae0bec735e2c61e7ab383d9e7a19c067f4 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 19 May 2024 16:01:09 +0000 Subject: [PATCH 04/45] dev-util/hip: add LLVM_COMPAT 18 Signed-off-by: Sv. Lockal --- dev-util/hip/hip-6.1.0.ebuild | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev-util/hip/hip-6.1.0.ebuild b/dev-util/hip/hip-6.1.0.ebuild index 10a30e672d938..db34e404f42d9 100644 --- a/dev-util/hip/hip-6.1.0.ebuild +++ b/dev-util/hip/hip-6.1.0.ebuild @@ -7,7 +7,7 @@ DOCS_BUILDER="doxygen" DOCS_DEPEND="media-gfx/graphviz" ROCM_SKIP_GLOBALS=1 -LLVM_COMPAT=( 17 ) +LLVM_COMPAT=( 17 18 ) inherit cmake docs flag-o-matic llvm-r1 rocm @@ -66,6 +66,13 @@ src_prepare() { cmake_src_prepare + # With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies + # https://github.com/llvm/llvm-project/issues/86332 + if [ "$LLVM_SLOT" != "17" ]; then + sed -e "s/-mllvm=-amdgpu-early-inline-all=true //" -i hipamd/hip-config-amd.cmake || die + sed -e "s/-mllvm=-amdgpu-early-inline-all=true;//" -i "${WORKDIR}"/HIP-rocm-${PV}/hip-lang-config.cmake.in + fi + local PATCHES=( "${FILESDIR}"/hip-test-6.0.2-hipcc-system-install.patch "${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch From e06b3c699a61774b58f91ca2a6c615eff4b6c6d7 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sat, 23 Mar 2024 17:15:16 +0000 Subject: [PATCH 05/45] dev-util/hipcc: use more precise dependencies * update llvm eclass to r1, allowing to specify LLVM version more precisely * add compiler-rt to RDEPEND, as hipcc automatically links to libclang_rt.builtins-x86_64.a Signed-off-by: Sv. Lockal dev-util/hipcc: add myself as a maintainer Signed-off-by: Sv. Lockal --- dev-util/hipcc/hipcc-6.0.0.ebuild | 16 ++++++++++------ dev-util/hipcc/metadata.xml | 6 +++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dev-util/hipcc/hipcc-6.0.0.ebuild b/dev-util/hipcc/hipcc-6.0.0.ebuild index 0882975987825..39ed6dbc2196f 100644 --- a/dev-util/hipcc/hipcc-6.0.0.ebuild +++ b/dev-util/hipcc/hipcc-6.0.0.ebuild @@ -3,9 +3,9 @@ EAPI=8 -inherit cmake llvm +LLVM_COMPAT=( 17 ) -LLVM_MAX_SLOT=17 +inherit cmake llvm-r1 DESCRIPTION="Radeon Open Compute hipcc" HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipcc" @@ -20,9 +20,13 @@ RESTRICT="!test? ( test )" S=${WORKDIR}/HIPCC-rocm-${PV} -DEPEND="gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCm-Developer-Tools/hipcc + ROCm/hipcc From 6fca6294b0c987a74d72cbf990c64628f97123a0 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:23:25 +0000 Subject: [PATCH 06/45] dev-util/hipcc: add 6.1.0, drop 6.0.0 Changes: * add support for LLVM 18 Signed-off-by: Sv. Lockal --- dev-util/hipcc/Manifest | 2 +- dev-util/hipcc/hipcc-6.0.0.ebuild | 55 -------------------- dev-util/hipcc/hipcc-6.1.0.ebuild | 84 +++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 56 deletions(-) delete mode 100644 dev-util/hipcc/hipcc-6.0.0.ebuild create mode 100644 dev-util/hipcc/hipcc-6.1.0.ebuild diff --git a/dev-util/hipcc/Manifest b/dev-util/hipcc/Manifest index c923482a6346e..7077fb560a355 100644 --- a/dev-util/hipcc/Manifest +++ b/dev-util/hipcc/Manifest @@ -1,2 +1,2 @@ DIST hipcc-5.7.1.tar.gz 36589 BLAKE2B a8ae6bd9f0f985d78119223b67b5b35b8d1ee38edb7e43c1e77752d203fe2c8b669b3bcff0cec661054d8cb24f799e7784a49eb0664bdd1dc2bf024ce026c175 SHA512 2d232c8dd4a47de6e0cff9d37b4e63a26cb1809ef2ff3a119c15e992cae96ffc2f4d8c1ddffd8732dea3a3d589a93e177f424a6174f982908aa50904e265432a -DIST hipcc-6.0.0.tar.gz 36648 BLAKE2B d4b67a962e61da5e96423191dad13e90c6aaec890a2b0dccb83ec4b3a9551ed9e2050bdc747fe7c79627d51b62408918157114f954aa579097163af2fc0b06e8 SHA512 e5307c880c96906d216b44b7bb269756e713cf45f5c72fc5dfc31f1e69d8e5e2cc8022bca289dc2b0a1bd72f86ddbdbb29dfda45010d4e4a4fb77096c9c93621 +DIST llvm-project-rocm-6.1.0.tar.gz 196002642 BLAKE2B 99783f7b0f9e9546b0363a45d69f534fe4558d580663506ec9fda94acc4c9170fe7a7dbd321f9b7ccc5245301793380fa0143da6e4186e2ab60ff20c3736093b SHA512 4e68f359ee306c431314df9cb64cb6f3f61b636a206166e3c3db597db47e86cc25ae6f06b0bc8bd18eab6cd475aa4395081dfcf8b07ef71970247553fab9e0de diff --git a/dev-util/hipcc/hipcc-6.0.0.ebuild b/dev-util/hipcc/hipcc-6.0.0.ebuild deleted file mode 100644 index 39ed6dbc2196f..0000000000000 --- a/dev-util/hipcc/hipcc-6.0.0.ebuild +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -LLVM_COMPAT=( 17 ) - -inherit cmake llvm-r1 - -DESCRIPTION="Radeon Open Compute hipcc" -HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipcc" - -KEYWORDS="~amd64" -SRC_URI="https://github.com/ROCm-Developer-Tools/hipcc/archive/refs/tags/rocm-${PV}.tar.gz -> hipcc-${PV}.tar.gz" - -LICENSE="Apache-2.0 MIT" -SLOT="0/$(ver_cut 1-2)" -IUSE="debug test" -RESTRICT="!test? ( test )" - -S=${WORKDIR}/HIPCC-rocm-${PV} - -DEPEND=" - $(llvm_gen_dep ' - sys-libs/compiler-rt:${LLVM_SLOT}= - sys-devel/llvm:${LLVM_SLOT}= - sys-devel/clang:${LLVM_SLOT}= - ') -" -RDEPEND="${DEPEND} - !17 -amdgpu-early-inline-all=true causes OOMs in dependencies + # https://github.com/llvm/llvm-project/issues/86332 + if [ "$LLVM_SLOT" != "17" ]; then + sed -e "s/-mllvm -amdgpu-early-inline-all=true //g" -i bin/hipcc.pl || die + fi +} + +src_install() { + cmake_src_install + # rm unwanted copy + rm -rf "${ED}/usr/hip" || die + # Handle hipvars.pm + rm "${ED}/usr/bin/hipvars.pm" || die + perl_domodule "${S}"/bin/hipvars.pm +} From 06dfc9fddf155fce1ce24f04039c1d84b5d49209 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sat, 16 Mar 2024 14:00:22 +0000 Subject: [PATCH 07/45] dev-build/rocm-cmake: add 6.1.1 Changes comparing to 5.7.1: * rename RadeonOpenCompute -> ROCm in url * patch annoying warnings * add myself to maintainers * fix installation of license file Signed-off-by: Sv. Lockal --- dev-build/rocm-cmake/Manifest | 1 + .../files/rocm-cmake-6.1.1-license.patch | 12 +++++++ ...m-cmake-6.1.1-no-rocmchecks-warnings.patch | 25 +++++++++++++ dev-build/rocm-cmake/metadata.xml | 6 +++- dev-build/rocm-cmake/rocm-cmake-6.1.1.ebuild | 35 +++++++++++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 dev-build/rocm-cmake/files/rocm-cmake-6.1.1-license.patch create mode 100644 dev-build/rocm-cmake/files/rocm-cmake-6.1.1-no-rocmchecks-warnings.patch create mode 100644 dev-build/rocm-cmake/rocm-cmake-6.1.1.ebuild diff --git a/dev-build/rocm-cmake/Manifest b/dev-build/rocm-cmake/Manifest index ab5d28a36b320..4071eb7b05305 100644 --- a/dev-build/rocm-cmake/Manifest +++ b/dev-build/rocm-cmake/Manifest @@ -1 +1,2 @@ DIST rocm-cmake-5.7.1.tar.gz 50940 BLAKE2B f3a36cedfc15af69819b576bf8f8bdfe7b49e5dd1d4db57f707295f14a8d64904745f454fc211b28adfde369c82cb42a061c05b6675679e11a3946f6ebfea6d5 SHA512 1265ed8e23a04f9cff57b43f815e8fbbb1a3f200bc040e01ceaa92c322088c9ef04da795b09d732c6466dc9a3fefc505b8b474d3f18f55cff491758aa53a6e6b +DIST rocm-cmake-6.1.1.tar.gz 86888 BLAKE2B 91064e82199ac317c273005b9b6c07e33ab5199b456467e84ac0937036d26d1d5c1286e1e38932b2da11700fb2a7a90795e34d4a7c03ed3bf58959402060091e SHA512 af6d4e124a3ec4d1e810867db69d738ebe7cfea672065bb5279b72a4d4efce8c14305e76173f760044977082c6aa069453d8eef488368a88ac57eb9df20f8b0c diff --git a/dev-build/rocm-cmake/files/rocm-cmake-6.1.1-license.patch b/dev-build/rocm-cmake/files/rocm-cmake-6.1.1-license.patch new file mode 100644 index 0000000000000..f8770b345f859 --- /dev/null +++ b/dev-build/rocm-cmake/files/rocm-cmake-6.1.1-license.patch @@ -0,0 +1,12 @@ +This is not needed. Gentoo will collect license files into +the documentation directory in ebuild. +--- a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake ++++ b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake +@@ -409,7 +409,6 @@ macro(rocm_create_package) + if(PARSE_PTH) + rocm_parse_python_syspath(${LIB_DIR} ${PARSE_NAME}) + endif() +- rocm_setup_license(${PARSE_HEADER_ONLY}) + if(PARSE_COMPONENTS) + rocm_set_comp_cpackvar(PARSE_HEADER_ONLY "${PARSE_COMPONENTS}") + endif() diff --git a/dev-build/rocm-cmake/files/rocm-cmake-6.1.1-no-rocmchecks-warnings.patch b/dev-build/rocm-cmake/files/rocm-cmake-6.1.1-no-rocmchecks-warnings.patch new file mode 100644 index 0000000000000..73030e7b9b203 --- /dev/null +++ b/dev-build/rocm-cmake/files/rocm-cmake-6.1.1-no-rocmchecks-warnings.patch @@ -0,0 +1,25 @@ +Gentoo uses cmake -C <...>/gentoo_common_config.cmake approach to set toolchain variables. +There is nothing wrong there, so there is no need to print huge ROCMChecks warnings. +--- a/share/rocmcmakebuildtools/cmake/ROCMChecks.cmake ++++ b/share/rocmcmakebuildtools/cmake/ROCMChecks.cmake +@@ -34,20 +34,6 @@ function(rocm_check_toolchain_var var access value list_file) + elseif("${base}" MATCHES ".*/CMakeFiles/${CMAKE_VERSION}$") + set(cmake_module On) + endif() +- if(NOT cmake_module) +- message( " +-******************************************************************************* +-*------------------------------- ${message_title} --------------------------* +- Options and properties should be set on a cmake target where possible. The +- variable '${var}' may be set by the cmake toolchain, either by +- calling 'cmake -D${var}=\"${value}\"' +- or set in a toolchain file and added with +- 'cmake -DCMAKE_TOOLCHAIN_FILE='. ROCMChecks now calling:") +- message(${message_type} "'${var}' is set at ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt: shown below:") +- message( "*-----------------------------------------------------------------------------* +-******************************************************************************* +-") +- endif() + endif() + endfunction() + if(UNIX AND (ROCM_WARN_TOOLCHAIN_VAR OR ROCM_ERROR_TOOLCHAIN_VAR)) diff --git a/dev-build/rocm-cmake/metadata.xml b/dev-build/rocm-cmake/metadata.xml index e13f2f7b57289..9b05010ce8601 100644 --- a/dev-build/rocm-cmake/metadata.xml +++ b/dev-build/rocm-cmake/metadata.xml @@ -9,7 +9,11 @@ candrews@gentoo.org Craig Andrews + + lockalsash@gmail.com + Sv. Lockal + - RadeonOpenCompute/rocm-cmake + ROCm/rocm-cmake diff --git a/dev-build/rocm-cmake/rocm-cmake-6.1.1.ebuild b/dev-build/rocm-cmake/rocm-cmake-6.1.1.ebuild new file mode 100644 index 0000000000000..1263ddfd3800d --- /dev/null +++ b/dev-build/rocm-cmake/rocm-cmake-6.1.1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/ROCm/rocm-cmake.git" + inherit git-r3 +else + SRC_URI="https://github.com/ROCm/rocm-cmake/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" + S="${WORKDIR}/rocm-cmake-rocm-${PV}" +fi + +DESCRIPTION="Radeon Open Compute CMake Modules" +HOMEPAGE="https://github.com/ROCm/rocm-cmake" +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +RESTRICT="test" + +DOCS=( CHANGELOG.md LICENSE README.md ) + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-license.patch + "${FILESDIR}"/${PN}-6.1.1-no-rocmchecks-warnings.patch +) + +src_prepare() { + sed -e "/CMAKE_INSTALL_LIBDIR/s:lib:$(get_libdir):" \ + -i "share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake" \ + -i "share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake" || die + cmake_src_prepare +} From 08e910c3aca6f5d14d128f7c4d7701025aeef4b6 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 12:37:20 +0000 Subject: [PATCH 08/45] dev-libs/rocm-comgr: add extend-isa-compatibility-check patch for 6.0.0 This patch together with dev-util/hip and dev-libs/rocr-runtime patches allows to load code object from fat binaries based on compatibility score for given ISA instead of full match. Other changes: * Rename RadeonOpenCompute -> ROCm * Add myself to maintainers * migrate llvm eclass to r1 Signed-off-by: Sv. Lockal --- ...6.0.0-extend-isa-compatibility-check.patch | 204 ++++++++++++++++++ .../rocm-comgr-6.0.0-llvm-18-compat.patch | 22 ++ dev-libs/rocm-comgr/metadata.xml | 6 +- ....0.0.ebuild => rocm-comgr-6.0.0-r1.ebuild} | 25 ++- 4 files changed, 246 insertions(+), 11 deletions(-) create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-extend-isa-compatibility-check.patch create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch rename dev-libs/rocm-comgr/{rocm-comgr-6.0.0.ebuild => rocm-comgr-6.0.0-r1.ebuild} (71%) diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-extend-isa-compatibility-check.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-extend-isa-compatibility-check.patch new file mode 100644 index 0000000000000..e65400c792e4e --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-extend-isa-compatibility-check.patch @@ -0,0 +1,204 @@ +Load kernels when compatible by ISA, e. g. if AMDGPU_TARGETS is set +to gfx1030 and some application was started on gfx1036, it loads gfx1030 kernel. + +Based on Debian patch by Cordell Bloor +https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026-extend-hip-isa-compatibility-check.patch +--- comgr.orig/src/comgr-metadata.cpp ++++ comgr/src/comgr-metadata.cpp +@@ -923,23 +923,86 @@ static constexpr const char *CLANG_OFFLOAD_BUNDLER_MAGIC = + static constexpr size_t OffloadBundleMagicLen = + strLiteralLength(CLANG_OFFLOAD_BUNDLER_MAGIC); + +-bool isCompatibleIsaName(StringRef IsaName, StringRef CodeObjectIsaName) { ++struct GfxPattern { ++ std::string root; ++ std::string suffixes; ++}; ++ ++static bool matches(const GfxPattern& p, StringRef s) { ++ if (p.root.size() + 1 != s.size()) { ++ return false; ++ } ++ if (0 != std::memcmp(p.root.data(), s.data(), p.root.size())) { ++ return false; ++ } ++ return p.suffixes.find(s[p.root.size()]) != std::string::npos; ++} ++ ++static bool isGfx900EquivalentProcessor(StringRef processor) { ++ return matches(GfxPattern{"gfx90", "029c"}, processor); ++} ++ ++static bool isGfx900SupersetProcessor(StringRef processor) { ++ return matches(GfxPattern{"gfx90", "0269c"}, processor); ++} ++ ++static bool isGfx1030EquivalentProcessor(StringRef processor) { ++ return matches(GfxPattern{"gfx103", "0123456"}, processor); ++} ++ ++static bool isGfx1010EquivalentProcessor(StringRef processor) { ++ return matches(GfxPattern{"gfx101", "0"}, processor); ++} ++ ++static bool isGfx1010SupersetProcessor(StringRef processor) { ++ return matches(GfxPattern{"gfx101", "0123"}, processor); ++} ++ ++enum CompatibilityScore { ++ CS_EXACT_MATCH = 1 << 4, ++ CS_PROCESSOR_MATCH = 1 << 3, ++ CS_PROCESSOR_COMPATIBLE = 1 << 2, ++ CS_XNACK_SPECIALIZED = 1 << 1, ++ CS_SRAM_ECC_SPECIALIZED = 1 << 0, ++ CS_INCOMPATIBLE = 0, ++}; ++ ++static int getProcessorCompatibilityScore(StringRef CodeObjectProcessor, ++ StringRef AgentProcessor) { ++ if (CodeObjectProcessor == AgentProcessor) { ++ return CS_PROCESSOR_MATCH; ++ } ++ ++ bool compatible = false; ++ if (isGfx900SupersetProcessor(AgentProcessor)) { ++ compatible = isGfx900EquivalentProcessor(CodeObjectProcessor); ++ } else if (isGfx1010SupersetProcessor(AgentProcessor)) { ++ compatible = isGfx1010EquivalentProcessor(CodeObjectProcessor); ++ } else if (isGfx1030EquivalentProcessor(AgentProcessor)) { ++ compatible = isGfx1030EquivalentProcessor(CodeObjectProcessor); ++ } ++ ++ return compatible ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE; ++} ++ ++static int getCompatiblityScore(StringRef IsaName, StringRef CodeObjectIsaName) { + if (IsaName == CodeObjectIsaName) { +- return true; ++ return CS_EXACT_MATCH; + } + + TargetIdentifier CodeObjectIdent; + if (parseTargetIdentifier(CodeObjectIsaName, CodeObjectIdent)) { +- return false; ++ return CS_INCOMPATIBLE; + } + + TargetIdentifier IsaIdent; + if (parseTargetIdentifier(IsaName, IsaIdent)) { +- return false; ++ return CS_INCOMPATIBLE; + } + +- if (CodeObjectIdent.Processor != IsaIdent.Processor) { +- return false; ++ int ProcessorScore = getProcessorCompatibilityScore(CodeObjectIdent.Processor, IsaIdent.Processor); ++ if (ProcessorScore == CS_INCOMPATIBLE) { ++ return CS_INCOMPATIBLE; + } + + char CodeObjectXnack = ' ', CodeObjectSramecc = ' '; +@@ -963,18 +1026,23 @@ bool isCompatibleIsaName(StringRef IsaName, StringRef CodeObjectIsaName) { + } + } + ++ int XnackBonus = 0; + if (CodeObjectXnack != ' ') { + if (CodeObjectXnack != IsaXnack) { +- return false; ++ return CS_INCOMPATIBLE; + } ++ XnackBonus = CS_XNACK_SPECIALIZED; + } + ++ int SrameccBonus = 0; + if (CodeObjectSramecc != ' ') { + if (CodeObjectSramecc != IsaSramecc) { +- return false; ++ return CS_INCOMPATIBLE; + } ++ SrameccBonus = CS_SRAM_ECC_SPECIALIZED; + } +- return true; ++ ++ return ProcessorScore + XnackBonus + SrameccBonus; + } + + amd_comgr_status_t +@@ -992,14 +1060,21 @@ lookUpCodeObjectInSharedObject(DataObject *DataP, + return Status; + } + ++ int MaxScore = 0; ++ unsigned MaxScoreItem; + for (unsigned J = 0; J < QueryListSize; J++) { +- if (isCompatibleIsaName(QueryList[J].isa, IsaName)) { +- QueryList[J].offset = 0; +- QueryList[J].size = DataP->Size; +- break; ++ int Score = getCompatiblityScore(QueryList[J].isa, IsaName); ++ if (Score > MaxScore) { ++ MaxScore = Score; ++ MaxScoreItem = J; + } + } + ++ if (MaxScore) { ++ QueryList[MaxScoreItem].offset = 0; ++ QueryList[MaxScoreItem].size = DataP->Size; ++ } ++ + return AMD_COMGR_STATUS_SUCCESS; + } + +@@ -1011,7 +1086,6 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, + return lookUpCodeObjectInSharedObject(DataP, QueryList, QueryListSize); + } + +- int Seen = 0; + BinaryStreamReader Reader(StringRef(DataP->Data, DataP->Size), + support::little); + +@@ -1037,6 +1111,8 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, + QueryList[I].size = 0; + } + ++ std::vector QueryListScores(QueryListSize); ++ + // For each code object, extract BundleEntryID information, and check that + // against each ISA in the QueryList + for (uint64_t I = 0; I < NumOfCodeObjects; I++) { +@@ -1069,28 +1145,22 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, + } + + for (unsigned J = 0; J < QueryListSize; J++) { +- // If this QueryList item has already been found to be compatible with ++ // If this QueryList item has exact match with + // another BundleEntryID, no need to check against the current + // BundleEntryID +- if (QueryList[J].size != 0) { ++ if (QueryListScores[J] == CS_EXACT_MATCH) { + continue; + } + + // If the QueryList Isa is compatible with the BundleEntryID, set the + // QueryList offset/size to this BundleEntryID +- if (isCompatibleIsaName(QueryList[J].isa, OffloadAndTargetId.second)) { ++ int Score = getCompatiblityScore(QueryList[J].isa, OffloadAndTargetId.second); ++ if (Score > QueryListScores[J]) { ++ QueryListScores[J] = Score; + QueryList[J].offset = BundleEntryCodeObjectOffset; + QueryList[J].size = BundleEntryCodeObjectSize; +- Seen++; +- break; + } + } +- +- // Stop iterating over BundleEntryIDs once we have populated the entire +- // QueryList +- if (Seen == (int) QueryListSize) { +- break; +- } + } + + return AMD_COMGR_STATUS_SUCCESS; diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch new file mode 100644 index 0000000000000..a5a0edb92f6b6 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch @@ -0,0 +1,22 @@ +ROCm 6.0.0 and 6.0.2 releases use mix between LLVM 17 and 18 +forked as https://github.com/RadeonOpenCompute/llvm-project +which makes some libraries compatible with only one version, +while other require another... + +Backports https://github.com/ROCm/llvm-project/commit/6cbc4dc91dfeb1cf2295cb350866e0b3a07dfee4 +--- a/src/comgr-metadata.cpp ++++ b/src/comgr-metadata.cpp +@@ -1087,7 +1087,12 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, + } + + BinaryStreamReader Reader(StringRef(DataP->Data, DataP->Size), +- support::little); ++#if LLVM_VERSION_MAJOR > 17 ++ llvm::endianness::little ++#else ++ support::little ++#endif ++ ); + + StringRef Magic; + if (auto EC = Reader.readFixedString(Magic, OffloadBundleMagicLen)) { diff --git a/dev-libs/rocm-comgr/metadata.xml b/dev-libs/rocm-comgr/metadata.xml index c0566e4b512ed..0fea85b33c9cd 100644 --- a/dev-libs/rocm-comgr/metadata.xml +++ b/dev-libs/rocm-comgr/metadata.xml @@ -9,7 +9,11 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + - RadeonOpenCompute/ROCm-CompilerSupport + ROCm/ROCm-CompilerSupport diff --git a/dev-libs/rocm-comgr/rocm-comgr-6.0.0.ebuild b/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild similarity index 71% rename from dev-libs/rocm-comgr/rocm-comgr-6.0.0.ebuild rename to dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild index ff181f1b46159..14bc03e325f63 100644 --- a/dev-libs/rocm-comgr/rocm-comgr-6.0.0.ebuild +++ b/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild @@ -1,18 +1,18 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit cmake llvm prefix +LLVM_COMPAT=( 17 ) -LLVM_MAX_SLOT=17 +inherit cmake llvm-r1 prefix if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/" + EGIT_REPO_URI="https://github.com/ROCm/ROCm-CompilerSupport.git" inherit git-r3 S="${WORKDIR}/${P}/lib/comgr" else - SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI="https://github.com/ROCm/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/ROCm-CompilerSupport-rocm-${PV}/lib/comgr" KEYWORDS="~amd64" fi @@ -31,31 +31,36 @@ PATCHES=( "${FILESDIR}/${PN}-5.7.0-symbolizer.patch" "${FILESDIR}/${PN}-5.7.1-fix-tests.patch" "${FILESDIR}/${PN}-5.7.1-correct-license-install-dir.patch" + "${FILESDIR}/${PN}-6.0.0-extend-isa-compatibility-check.patch" + "${FILESDIR}/${PN}-6.0.0-llvm-18-compat.patch" ) DESCRIPTION="Radeon Open Compute Code Object Manager" -HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport" +HOMEPAGE="https://github.com/ROCm/ROCm-CompilerSupport" LICENSE="MIT" SLOT="0/$(ver_cut 1-2)" RDEPEND=">=dev-libs/rocm-device-libs-${PV} - sys-devel/clang:${LLVM_MAX_SLOT}= sys-devel/clang-runtime:= - sys-devel/lld:${LLVM_MAX_SLOT}=" + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT}= + sys-devel/lld:${LLVM_SLOT}= + ') +" DEPEND="${RDEPEND}" CMAKE_BUILD_TYPE=Release src_prepare() { sed '/sys::path::append(HIPPath/s,"hip","",' -i src/comgr-env.cpp || die - sed "/return LLVMPath;/s,LLVMPath,llvm::SmallString<128>(\"$(get_llvm_prefix ${LLVM_MAX_SLOT})\")," -i src/comgr-env.cpp || die + sed "/return LLVMPath;/s,LLVMPath,llvm::SmallString<128>(\"$(get_llvm_prefix)\")," -i src/comgr-env.cpp || die eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0-rocm_path.patch) cmake_src_prepare } src_configure() { local mycmakeargs=( - -DLLVM_DIR="$(get_llvm_prefix ${LLVM_MAX_SLOT})" + -DLLVM_DIR="$(get_llvm_prefix)" -DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58 -DBUILD_TESTING=$(usex test ON OFF) ) From b0b25d0e339ba1878ff9e0afc75d13f4cd41bb27 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 12:55:33 +0000 Subject: [PATCH 09/45] dev-libs/rocr-runtime: update extend-isa-compatibility-check patch for gfx1012 This repeats change in https://salsa.debian.org/rocm-team/rocr-runtime/-/commit/da5ad99a9819f42c7c090f95bedf92529637afdc by Cordell Bloor Other changes: * rename RadeonOpenCompute -> ROCm * update llvm eclass to r1 * add myself to maintainers list Signed-off-by: Sv. Lockal --- ...-5.7.1-extend-isa-compatibility-check.patch | 2 +- dev-libs/rocr-runtime/metadata.xml | 6 +++++- ...-r2.ebuild => rocr-runtime-5.7.1-r3.ebuild} | 0 ...-r1.ebuild => rocr-runtime-6.0.0-r2.ebuild} | 18 +++++++++++------- 4 files changed, 17 insertions(+), 9 deletions(-) rename dev-libs/rocr-runtime/{rocr-runtime-5.7.1-r2.ebuild => rocr-runtime-5.7.1-r3.ebuild} (100%) rename dev-libs/rocr-runtime/{rocr-runtime-6.0.0-r1.ebuild => rocr-runtime-6.0.0-r2.ebuild} (74%) diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch index b12352e40c927..f0106abd6652b 100644 --- a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch +++ b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-extend-isa-compatibility-check.patch @@ -45,7 +45,7 @@ https://salsa.debian.org/rocm-team/rocr-runtime/-/blob/master/debian/patches/000 + } + } else if (code_object_isa.GetMajorVersion() == 10) { + if (code_object_isa.GetMinorVersion() == 1) { -+ const std::array gfx1010_equivalent = { 0, 2 }; ++ const std::array gfx1010_equivalent = { 0 }; + const std::array gfx1010_superset = { 0, 1, 2, 3 }; + if (Contains(gfx1010_equivalent, code_object_isa.GetStepping()) && + Contains(gfx1010_superset, agent_isa.GetStepping())) { diff --git a/dev-libs/rocr-runtime/metadata.xml b/dev-libs/rocr-runtime/metadata.xml index 0e418bcc98379..5f0e6d6b486ee 100644 --- a/dev-libs/rocr-runtime/metadata.xml +++ b/dev-libs/rocr-runtime/metadata.xml @@ -9,7 +9,11 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - RadeonOpenCompute/ROCR-Runtime + ROCm/ROCR-Runtime diff --git a/dev-libs/rocr-runtime/rocr-runtime-5.7.1-r2.ebuild b/dev-libs/rocr-runtime/rocr-runtime-5.7.1-r3.ebuild similarity index 100% rename from dev-libs/rocr-runtime/rocr-runtime-5.7.1-r2.ebuild rename to dev-libs/rocr-runtime/rocr-runtime-5.7.1-r3.ebuild diff --git a/dev-libs/rocr-runtime/rocr-runtime-6.0.0-r1.ebuild b/dev-libs/rocr-runtime/rocr-runtime-6.0.0-r2.ebuild similarity index 74% rename from dev-libs/rocr-runtime/rocr-runtime-6.0.0-r1.ebuild rename to dev-libs/rocr-runtime/rocr-runtime-6.0.0-r2.ebuild index 374dcec975549..e7b4a865bb706 100644 --- a/dev-libs/rocr-runtime/rocr-runtime-6.0.0-r1.ebuild +++ b/dev-libs/rocr-runtime/rocr-runtime-6.0.0-r2.ebuild @@ -3,24 +3,25 @@ EAPI=8 -inherit cmake flag-o-matic llvm +LLVM_COMPAT=( 17 ) -LLVM_MAX_SLOT=17 +inherit cmake flag-o-matic llvm-r1 if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCR-Runtime/" + EGIT_REPO_URI="https://github.com/ROCm/ROCR-Runtime.git" inherit git-r3 S="${WORKDIR}/${P}/src" else - SRC_URI="https://github.com/RadeonOpenCompute/ROCR-Runtime/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI="https://github.com/ROCm/ROCR-Runtime/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/ROCR-Runtime-rocm-${PV}/src" KEYWORDS="~amd64" fi DESCRIPTION="Radeon Open Compute Runtime" -HOMEPAGE="https://github.com/RadeonOpenCompute/ROCR-Runtime" +HOMEPAGE="https://github.com/ROCm/ROCR-Runtime" PATCHES=( "${FILESDIR}/${PN}-4.3.0_no-aqlprofiler.patch" + "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch" "${FILESDIR}/${PN}-5.7.1-musl.patch" ) @@ -33,8 +34,11 @@ COMMON_DEPEND="dev-libs/elfutils DEPEND="${COMMON_DEPEND} >=dev-libs/roct-thunk-interface-${PV} >=dev-libs/rocm-device-libs-${PV} - sys-devel/clang:${LLVM_MAX_SLOT}= - sys-devel/lld:${LLVM_MAX_SLOT}=" + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT}= + sys-devel/lld:${LLVM_SLOT}= + ') +" RDEPEND="${DEPEND}" BDEPEND="app-editors/vim-core" # vim-core is needed for "xxd" From 7c66a1d4cdd59460bfd8cda3befa905329d4e6f1 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 24 Mar 2024 17:47:17 +0000 Subject: [PATCH 10/45] dev-libs/rocr-runtime: update rocr-runtime-5.7.1-musl patch to fix build failure Closes: https://bugs.gentoo.org/927274 Signed-off-by: Sv. Lockal --- .../rocr-runtime/files/rocr-runtime-5.7.1-musl.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch index 0e8e532097389..13d731adb3a23 100644 --- a/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch +++ b/dev-libs/rocr-runtime/files/rocr-runtime-5.7.1-musl.patch @@ -23,6 +23,17 @@ Bug: https://github.com/ROCm/ROCR-Runtime/issues/181 } hsa_signal_value_t BusyWaitSignal::LoadRelaxed() { +--- a/core/runtime/hsa.cpp ++++ b/core/runtime/hsa.cpp +@@ -155,7 +155,7 @@ template struct ValidityError { + + template + static __forceinline bool IsValid(T* ptr) { +- return (ptr == NULL) ? NULL : ptr->IsValid(); ++ return (ptr == NULL) ? false : ptr->IsValid(); + } + + namespace AMD { --- a/core/util/lnx/os_linux.cpp +++ b/core/util/lnx/os_linux.cpp @@ -111,9 +111,12 @@ class os_thread { From 51b1ee72e1fa595c0acdda75dc262245448ec3e2 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 13:04:07 +0000 Subject: [PATCH 11/45] dev-libs/rocm-device-libs: add llvm-18 compatibility patch Changes: * add llvm-18 compatibility patch (bug: https://github.com/ROCm/ROCm-Device-Libs/issues/96) * remove RESTRICT variable, it was shadowed and non-functional * rename RadeonOpenCompute -> ROCm * update llvm eclass to r1 * add comment about llvm 18 compatibility issue * add myself to maintainers Signed-off-by: Sv. Lockal --- ...-device-libs-6.0.0-add-gws-attribute.patch | 22 ++++++++++++++++ dev-libs/rocm-device-libs/metadata.xml | 6 ++++- .../rocm-device-libs-6.0.0.ebuild | 26 ++++++++++--------- 3 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch new file mode 100644 index 0000000000000..1aaecbb0c1e68 --- /dev/null +++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch @@ -0,0 +1,22 @@ +Fix compatilibity with Clang-18 +https://github.com/ROCm/ROCm-Device-Libs/issues/96 + +Backports https://github.com/ROCm/llvm-project/commit/688c78d85caf499957db175811f8b00c7c818f83 +--- a/ockl/src/cg.cl ++++ b/ockl/src/cg.cl +@@ -84,13 +84,13 @@ multi_grid_sync(__global struct mg_sync *s, uint members) + } + } + +-void ++__attribute__((target("gws"))) void + __ockl_gws_init(uint nwm1, uint rid) + { + __builtin_amdgcn_ds_gws_init(nwm1, rid); + } + +-void ++__attribute__((target("gws"))) void + __ockl_gws_barrier(uint nwm1, uint rid) + { + __builtin_amdgcn_ds_gws_barrier(nwm1, rid); \ No newline at end of file diff --git a/dev-libs/rocm-device-libs/metadata.xml b/dev-libs/rocm-device-libs/metadata.xml index c47f589544e48..cbbf3a273306e 100644 --- a/dev-libs/rocm-device-libs/metadata.xml +++ b/dev-libs/rocm-device-libs/metadata.xml @@ -5,7 +5,11 @@ candrews@gentoo.org Craig Andrews + + lockalsash@gmail.com + Sv. Lockal + - RadeonOpenCompute/ROCm-Device-Libs + ROCm/ROCm-Device-Libs diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild index 09ca777faf523..8a86fc6f4b0f6 100644 --- a/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild +++ b/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild @@ -1,40 +1,43 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -RESTRICT="strip" +LLVM_COMPAT=( 17 ) -inherit cmake llvm - -LLVM_MAX_SLOT=17 +inherit cmake llvm-r1 if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-Device-Libs/" + EGIT_REPO_URI="https://github.com/ROCm/ROCm-Device-Libs.git" inherit git-r3 S="${WORKDIR}/${P}/src" else - SRC_URI="https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI="https://github.com/ROCm/ROCm-Device-Libs/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/ROCm-Device-Libs-rocm-${PV}" KEYWORDS="~amd64" fi DESCRIPTION="Radeon Open Compute Device Libraries" -HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-Device-Libs" +HOMEPAGE="https://github.com/ROCm/ROCm-Device-Libs" LICENSE="MIT" SLOT="0/$(ver_cut 1-2)" IUSE="test" RESTRICT="!test? ( test )" -RDEPEND="sys-devel/clang:${LLVM_MAX_SLOT}" +RDEPEND=" + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT} + ') +" DEPEND="${RDEPEND}" CMAKE_BUILD_TYPE=Release PATCHES=( "${FILESDIR}/${PN}-5.5.1-fix-llvm-link.patch" - ) + "${FILESDIR}/${PN}-6.0.0-add-gws-attribute.patch" +) src_prepare() { sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/OCL.cmake" || die @@ -44,8 +47,7 @@ src_prepare() { src_configure() { local mycmakeargs=( - # -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/llvm" - -DLLVM_DIR="$(get_llvm_prefix "${LLVM_MAX_SLOT}")" + -DLLVM_DIR="$(get_llvm_prefix)" ) cmake_src_configure } From aaccc8128b89a25a23301da6650d8930eff405fa Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Tue, 26 Mar 2024 17:17:47 +0000 Subject: [PATCH 12/45] dev-libs/rocm-device-libs: fix tests Signed-off-by: Sv. Lockal --- ...m-device-libs-5.7.1-test-bitcode-dir.patch | 32 +++++++++++++++++++ .../rocm-device-libs-5.7.1.ebuild | 21 +++++++++--- .../rocm-device-libs-6.0.0.ebuild | 20 ++++++++++-- 3 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 dev-libs/rocm-device-libs/files/rocm-device-libs-5.7.1-test-bitcode-dir.patch diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-5.7.1-test-bitcode-dir.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.7.1-test-bitcode-dir.patch new file mode 100644 index 0000000000000..8de0628037c68 --- /dev/null +++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.7.1-test-bitcode-dir.patch @@ -0,0 +1,32 @@ +lib/amdgcn/bitcode is not among the default bitcode dirs of clang +Add --rocm-device-lib-path to the clang argument +--- a/test/compile/CMakeLists.txt ++++ b/test/compile/CMakeLists.txt +@@ -30,6 +30,7 @@ function(add_compile_test test_name func_name script test_cpu extra_check_prefix + -DFILECHECK_BIN=${FILECHECK_BIN} + -DOUTPUT_FILE=output.${name}.${test_cpu}.s + -DINPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${func_name}.cl ++ -DAMDGCN_BITCODES=${PROJECT_BINARY_DIR}/lib/amdgcn/bitcode + -DTEST_CPU=${test_cpu} + -DEXTRA_CHECK_PREFIX=${extra_check_prefixes} + -P ${script}) +--- a/test/compile/RunCompileTest.cmake ++++ b/test/compile/RunCompileTest.cmake +@@ -16,6 +16,7 @@ execute_process(COMMAND + -target amdgcn-amd-amdhsa -mcpu=${TEST_CPU} + -Xclang -finclude-default-header + --rocm-path=${BINARY_DIR} ++ --rocm-device-lib-path=${AMDGCN_BITCODES} + -mllvm -amdgpu-simplify-libcall=0 + -o ${OUTPUT_FILE} ${INPUT_FILE} + RESULT_VARIABLE CLANG_RESULT +--- a/test/compile/RunConstantFoldTest.cmake ++++ b/test/compile/RunConstantFoldTest.cmake +@@ -16,6 +16,7 @@ execute_process(COMMAND + -target amdgcn-amd-amdhsa -mcpu=${TEST_CPU} + -Xclang -finclude-default-header + --rocm-path=${BINARY_DIR} ++ --rocm-device-lib-path=${AMDGCN_BITCODES} + -mllvm -amdgpu-simplify-libcall=0 + -o ${OUTPUT_FILE} ${INPUT_FILE} + RESULT_VARIABLE CLANG_RESULT diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild index 56af5a5be6b3a..a037f838452f8 100644 --- a/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild +++ b/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -32,7 +32,8 @@ CMAKE_BUILD_TYPE=Release PATCHES=( "${FILESDIR}/${PN}-5.5.1-fix-llvm-link.patch" - ) + "${FILESDIR}/${PN}-5.7.1-test-bitcode-dir.patch" +) src_prepare() { sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/OCL.cmake" || die @@ -42,8 +43,20 @@ src_prepare() { src_configure() { local mycmakeargs=( - # -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/llvm" -DLLVM_DIR="$(get_llvm_prefix "${LLVM_MAX_SLOT}")" ) - cmake_src_configure + # do not trust CMake with autoselecting Clang, as it autoselects the latest one + # producing too modern LLVM bitcode and causing linker errors in other packages + CC="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/clang" \ + CXX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/clang++" cmake_src_configure +} + +src_test() { + local CMAKE_SKIP_TESTS=( + # LLVM in Gentoo generates different assembly + compile_atan2__gfx700 + compile_atan2pi__gfx700 + compile_frexp__gfx600 + ) + cmake_src_test } diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild index 8a86fc6f4b0f6..8172776cb784d 100644 --- a/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild +++ b/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild @@ -25,17 +25,19 @@ SLOT="0/$(ver_cut 1-2)" IUSE="test" RESTRICT="!test? ( test )" -RDEPEND=" +BDEPEND=" + dev-build/rocm-cmake $(llvm_gen_dep ' sys-devel/clang:${LLVM_SLOT} + sys-devel/lld:${LLVM_SLOT} ') " -DEPEND="${RDEPEND}" CMAKE_BUILD_TYPE=Release PATCHES=( "${FILESDIR}/${PN}-5.5.1-fix-llvm-link.patch" + "${FILESDIR}/${PN}-5.7.1-test-bitcode-dir.patch" "${FILESDIR}/${PN}-6.0.0-add-gws-attribute.patch" ) @@ -49,5 +51,17 @@ src_configure() { local mycmakeargs=( -DLLVM_DIR="$(get_llvm_prefix)" ) - cmake_src_configure + # do not trust CMake with autoselecting Clang, as it autoselects the latest one + # producing too modern LLVM bitcode and causing linker errors in other packages + CC="$(get_llvm_prefix)/bin/clang" CXX="$(get_llvm_prefix)/bin/clang++" cmake_src_configure +} + +src_test() { + local CMAKE_SKIP_TESTS=( + # LLVM in Gentoo generates different assembly + compile_atan2__gfx700 + compile_atan2pi__gfx700 + compile_frexp__gfx600 + ) + cmake_src_test } From 6a062bc3a431974c22ffc8e591352947cc9c5ea7 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:11:28 +0000 Subject: [PATCH 13/45] dev-libs/rocm-device-libs: add 6.1.0 Changes: * add support for LLVM_COMPAT 18 Signed-off-by: Sv. Lockal --- dev-libs/rocm-device-libs/Manifest | 1 + ...m-device-libs-5.5.0-test-bitcode-dir.patch | 37 +++++++++ ...evice-libs-5.5.1-remove-gfx700-tests.patch | 34 +++++++++ ...rocm-device-libs-6.1.0-fix-llvm-link.patch | 28 +++++++ ...-device-libs-6.1.0-fix-test-failures.patch | 64 ++++++++++++++++ .../rocm-device-libs-6.1.0.ebuild | 75 +++++++++++++++++++ 6 files changed, 239 insertions(+) create mode 100644 dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch create mode 100644 dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch create mode 100644 dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch create mode 100644 dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch create mode 100644 dev-libs/rocm-device-libs/rocm-device-libs-6.1.0.ebuild diff --git a/dev-libs/rocm-device-libs/Manifest b/dev-libs/rocm-device-libs/Manifest index 8002ba47f4ad1..a89c6c33ad6eb 100644 --- a/dev-libs/rocm-device-libs/Manifest +++ b/dev-libs/rocm-device-libs/Manifest @@ -1,3 +1,4 @@ +DIST llvm-project-rocm-6.1.0.tar.gz 196002642 BLAKE2B 99783f7b0f9e9546b0363a45d69f534fe4558d580663506ec9fda94acc4c9170fe7a7dbd321f9b7ccc5245301793380fa0143da6e4186e2ab60ff20c3736093b SHA512 4e68f359ee306c431314df9cb64cb6f3f61b636a206166e3c3db597db47e86cc25ae6f06b0bc8bd18eab6cd475aa4395081dfcf8b07ef71970247553fab9e0de DIST rocm-device-libs-5.1.3.tar.gz 242862 BLAKE2B 68d66de897f461e9f876de5fe2214803d4c00665651dea6af0952f0ce579c6704a5ec41b08971fa613ade309a0a85cb611b56b592dc2a25e247183e634ea3378 SHA512 cc3dfb8d4b4841ba777355c537175259d0019159ff462358320674b85082cccd99f6462f60fee66228ddfb88fade043445c1bac62504aa1462ba61b7e2751de7 DIST rocm-device-libs-5.3.3.tar.gz 245690 BLAKE2B 475c0d818b8b0f090a8daeca2910cd4002e4cdf505d020327f46eb5f864a26937a6a3dfe4ff7b188ebda0f936b1c396f2163bb27b9e2a62c5976e60fa60856ac SHA512 8f6f2fc1534e348e02ba30a25cfc6017f8eab768968b5d0344a5ea7d65c4f0a874072f9e53919c74545814330602ef7c190753c7ff019137230e02f58a5d3a5d DIST rocm-device-libs-5.4.3.tar.gz 246095 BLAKE2B eb749346c96d465a5f22831968ccbd71f02749e6aa0d9c2becc0f378641ca0f65c1a131bfd3ed226f838b4208091fcc920b1e31b427adbd69a42881898668e6a SHA512 67b904363a3cff6c15bbd032cbc72cb5cd5f82acaa68c74391dbcf415266e8f35486a496b69b69e1fc0721e0e4e21fb6a6b9c180a46cb59cdcf53916be846ca4 diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch new file mode 100644 index 0000000000000..2a307786edd52 --- /dev/null +++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch @@ -0,0 +1,37 @@ +`--rocm-device-lib-path` is needed to execute the tests because they are not +installed to system yet +=================================================================== +--- ROCm-Device-Libs-rocm-6.0.0.orig/test/compile/CMakeLists.txt ++++ ROCm-Device-Libs-rocm-6.0.0/test/compile/CMakeLists.txt +@@ -30,6 +30,7 @@ function(add_compile_test test_name func + -DFILECHECK_BIN=${FILECHECK_BIN} + -DOUTPUT_FILE=output.${name}.${test_cpu}.s + -DINPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${func_name}.cl ++ -DAMDGCN_BITCODES=${PROJECT_BINARY_DIR}/lib/amdgcn/bitcode + -DTEST_CPU=${test_cpu} + -DEXTRA_CHECK_PREFIX=${extra_check_prefixes} + -P ${script}) +Index: ROCm-Device-Libs-rocm-6.0.0/test/compile/RunConstantFoldTest.cmake +=================================================================== +--- ROCm-Device-Libs-rocm-6.0.0.orig/test/compile/RunConstantFoldTest.cmake ++++ ROCm-Device-Libs-rocm-6.0.0/test/compile/RunConstantFoldTest.cmake +@@ -16,6 +16,7 @@ execute_process(COMMAND + -target amdgcn-amd-amdhsa -mcpu=${TEST_CPU} + -Xclang -finclude-default-header + --rocm-path=${BINARY_DIR} ++ --rocm-device-lib-path=${AMDGCN_BITCODES} + -mllvm -amdgpu-simplify-libcall=0 + -o ${OUTPUT_FILE} ${INPUT_FILE} + RESULT_VARIABLE CLANG_RESULT +Index: ROCm-Device-Libs-rocm-6.0.0/test/compile/RunCompileTest.cmake +=================================================================== +--- ROCm-Device-Libs-rocm-6.0.0.orig/test/compile/RunCompileTest.cmake ++++ ROCm-Device-Libs-rocm-6.0.0/test/compile/RunCompileTest.cmake +@@ -16,6 +16,7 @@ execute_process(COMMAND + -target amdgcn-amd-amdhsa -mcpu=${TEST_CPU} + -Xclang -finclude-default-header + --rocm-path=${BINARY_DIR} ++ --rocm-device-lib-path=${AMDGCN_BITCODES} + -mllvm -amdgpu-simplify-libcall=0 + -o ${OUTPUT_FILE} ${INPUT_FILE} + RESULT_VARIABLE CLANG_RESULT diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch new file mode 100644 index 0000000000000..0fb5e44e218c6 --- /dev/null +++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch @@ -0,0 +1,34 @@ +https://github.com/ROCm/ROCm-Device-Libs/issues/86 +https://github.com/ROCm/ROCm-Device-Libs/pull/89 +From 936a78464491c95c7cfffde08491bfe1a48c7177 Mon Sep 17 00:00:00 2001 +From: Brian Sumner +Date: Tue, 9 May 2023 07:55:03 -0700 +Subject: [PATCH] Remove gfx700 from tests + +Change-Id: I23d6639cb7c04246cc5be86d6e172e32546b3b90 +--- + test/compile/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/compile/CMakeLists.txt b/test/compile/CMakeLists.txt +index 9af0b1a..a789222 100644 +--- a/test/compile/CMakeLists.txt ++++ b/test/compile/CMakeLists.txt +@@ -54,12 +54,12 @@ foreach(gpu gfx900 gfx1030) + add_constant_fold_test(lgamma_r ${gpu}) + endforeach() + +-foreach(gpu gfx700 gfx803) ++foreach(gpu gfx803) + add_isa_test(asin ${gpu}) + add_isa_test(atan2 ${gpu}) + add_isa_test(atan2pi ${gpu}) + endforeach() + +-foreach(gpu gfx600 gfx700) ++foreach(gpu gfx600) + add_isa_test(frexp ${gpu}) + endforeach() +-- +2.41.0 + diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch new file mode 100644 index 0000000000000..7a08dc4a1d0d5 --- /dev/null +++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch @@ -0,0 +1,28 @@ +https://github.com/ROCm/llvm-project/pull/68 +From 1c7e7f872980a5b15fb3d85f8780e78ce3b715b1 Mon Sep 17 00:00:00 2001 +From: Selene +Date: Wed, 1 May 2024 17:38:33 +0800 +Subject: [PATCH] Allow link to llvm shared library for current distros + +--- + amd/device-libs/utils/prepare-builtins/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/amd/device-libs/utils/prepare-builtins/CMakeLists.txt b/amd/device-libs/utils/prepare-builtins/CMakeLists.txt +index 63661962860a..079dc08e3419 100644 +--- a/utils/prepare-builtins/CMakeLists.txt ++++ b/utils/prepare-builtins/CMakeLists.txt +@@ -26,5 +26,9 @@ set_target_properties(prepare-builtins PROPERTIES + CXX_STANDARD_REQUIRED Yes + CXX_EXTENSIONS No) + llvm_update_compile_flags(prepare-builtins) +-llvm_map_components_to_libnames(llvm_libs support core bitreader bitwriter) ++if (LLVM_LINK_LLVM_DYLIB) ++ set(llvm_libs LLVM) ++else() ++ llvm_map_components_to_libnames(llvm_libs support core bitreader bitwriter) ++endif() + target_link_libraries(prepare-builtins ${llvm_libs}) +-- +2.44.0 + diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch new file mode 100644 index 0000000000000..856b5cf7e3927 --- /dev/null +++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch @@ -0,0 +1,64 @@ +Modified from https://github.com/ROCm/llvm-project/commit/7c2188cbc193f2b4dd5394f17404b44340001f30.patch +From 7c2188cbc193f2b4dd5394f17404b44340001f30 Mon Sep 17 00:00:00 2001 +From: Matt Arsenault +Date: Thu, 4 Jan 2024 19:34:47 +0700 +Subject: [PATCH] device-libs: Fix input file path test failures + +The test file input paths broke with the move to the mono-repo. Some of +the constant folding values are host dependent, so update the values to +what works for me now. Not really sure what else I can do about these. + +Change-Id: Ic764f637bb9532fcede9bfb9ce3886a2b7d467d8 +--- + amd/device-libs/test/compile/frexp.cl | 10 ++++++---- + amd/device-libs/test/compile/lgamma_r.cl | 2 +- + 3 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/test/compile/frexp.cl b/test/compile/frexp.cl +index 780c541500021b..b3181ce87db711 100644 +--- a/test/compile/frexp.cl ++++ b/test/compile/frexp.cl +@@ -5,11 +5,11 @@ + // later. + + // GCN-LABEL: {{^}}test_frexp_f32: +-// GFX600-DAG: s_movk_i32 [[CLASS_MASK:s[0-9]+]], 0x1f8 ++// GFX600-DAG: s_mov_b32 [[INF:s[0-9]+]], 0x7f80000 + // GFX600-DAG: v_frexp_mant_f32{{(_e32)?}} [[MANT:v[0-9]+]], [[SRC:v[0-9]+]] + // GFX600-DAG: v_frexp_exp_i32_f32{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v[0-9]+]] + +-// GFX600-DAG: v_cmp_class_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[CLASS_MASK]] ++// GFX600-DAG: v_cmp_lt_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, [[INF]] + + // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, [[SRC]], [[MANT]], [[CMP]] + // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, 0, [[EXP]], [[CMP]] +@@ -30,12 +30,14 @@ kernel void test_frexp_f32(global float* restrict out0, + } + + // GCN-LABEL: {{^}}test_frexp_f64: ++// GFX600: s_mov_b32 s{{[0-9]+}}, 0{{$}} + +-// GFX600-DAG: s_movk_i32 [[CLASS_MASK:s[0-9]+]], 0x1f8 ++// GFX600-DAG: s_mov_b32 s[[INF_LO:[0-9]+]], 0{{$}} ++// GFX600-DAG: s_mov_b32 s[[INF_HI:[0-9]+]], 0x7ff00000{{$}} + // GFX600-DAG: v_frexp_mant_f64{{(_e32)?}} v{{\[}}[[MANT_LO:[0-9]+]]:[[MANT_HI:[0-9]+]]{{\]}}, [[SRC:v\[[0-9]+:[0-9]+\]]] + // GFX600-DAG: v_frexp_exp_i32_f64{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v\[[0-9]+:[0-9]+\]]] + +-// GFX600-DAG: v_cmp_class_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[CLASS_MASK]] ++// GFX600-DAG: v_cmp_lt_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, s{{\[}}[[INF_LO]]:[[INF_HI]]{{\]}} + + // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_LO]], [[CMP]] + // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_HI]], [[CMP]] +diff --git a/test/compile/lgamma_r.cl b/test/compile/lgamma_r.cl +index 1e1984226cd55c..56d1ba15f761f2 100644 +--- a/test/compile/lgamma_r.cl ++++ b/test/compile/lgamma_r.cl +@@ -66,7 +66,7 @@ kernel void constant_fold_lgamma_r_f32(volatile global float* out, + out[0] = test_lgamma_r(0x1.0p-127f, sign_out); + + // CONSTANTFOLD-NEXT: store volatile i32 1, +- // CONSTANTFOLD-NEXT: store volatile float 0x419DE28040000000, ++ // CONSTANTFOLD-NEXT: store volatile float 0x419DE28060000000, + out[0] = test_lgamma_r(nextafter(0x1.0p+23f, __builtin_inff()), sign_out); + + // CONSTANTFOLD-NEXT: store volatile i32 1, diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.1.0.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.0.ebuild new file mode 100644 index 0000000000000..5a5642341a06f --- /dev/null +++ b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.0.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( 17 18 ) + +inherit cmake llvm-r1 + +MY_P=llvm-project-rocm-${PV} +components=( "amd/device-libs" ) + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/ROCm/llvm-project" + inherit git-r3 + S="${WORKDIR}/${P}/${components[0]}" +else + SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz" + S="${WORKDIR}/${MY_P}/${components[0]}" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Radeon Open Compute Device Libraries" +HOMEPAGE="https://github.com/ROCm/ROCm-Device-Libs" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +IUSE="test" +RESTRICT="strip !test? ( test )" + +BDEPEND=" + dev-build/rocm-cmake + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT} + sys-devel/lld:${LLVM_SLOT} + ') +" + +CMAKE_BUILD_TYPE=Release + +PATCHES=( + "${FILESDIR}"/${PN}-5.5.0-test-bitcode-dir.patch + "${FILESDIR}"/${PN}-6.0.0-add-gws-attribute.patch + "${FILESDIR}"/${PN}-6.1.0-fix-llvm-link.patch + "${FILESDIR}"/${PN}-6.1.0-fix-test-failures.patch +) + +src_unpack() { + if [[ ${PV} == *9999 ]] ; then + git-r3_fetch + git-r3_checkout '' . '' "${components[@]}" + else + archive="${MY_P}.tar.gz" + ebegin "Unpacking from ${archive}" + tar -x -z -o \ + -f "${DISTDIR}/${archive}" \ + "${components[@]/#/${MY_P}/}" || die + eend ${?} + fi +} + +src_prepare() { + sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/OCL.cmake" || die + sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/Packages.cmake" || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DLLVM_DIR="$(get_llvm_prefix)" + ) + # do not trust CMake with autoselecting Clang, as it autoselects the latest one + # producing too modern LLVM bitcode and causing linker errors in other packages + CC="$(get_llvm_prefix)/bin/clang" CXX="$(get_llvm_prefix)/bin/clang++" cmake_src_configure +} From 16298efc1ddfefc6277da56607487234c752ca13 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:16:52 +0000 Subject: [PATCH 14/45] dev-libs/rocm-comgr: add 6.1.0 Changes: * fix tests * make 6.1.0 compatible with LLVM 18 Signed-off-by: Sv. Lockal --- dev-libs/rocm-comgr/Manifest | 1 + .../rocm-comgr-6.0.0-llvm-18-compat.patch | 22 ----- ...ocm-comgr-6.1.0-enforce-oop-compiler.patch | 26 ++++++ ...-comgr-6.1.0-fix-comgr-default-flags.patch | 42 +++++++++ ...rocm-comgr-6.1.0-fix-tests-rocm-path.patch | 20 +++++ .../rocm-comgr-6.1.0-llvm-18-compat.patch | 79 ++++++++++++++++ ...6.1.0-remove-incompatible-clang-args.patch | 27 ++++++ .../rocm-comgr/rocm-comgr-6.0.0-r1.ebuild | 1 - dev-libs/rocm-comgr/rocm-comgr-6.1.0.ebuild | 89 +++++++++++++++++++ 9 files changed, 284 insertions(+), 23 deletions(-) delete mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-enforce-oop-compiler.patch create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-tests-rocm-path.patch create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-remove-incompatible-clang-args.patch create mode 100644 dev-libs/rocm-comgr/rocm-comgr-6.1.0.ebuild diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest index 25427ae596a2b..9aef1702006c5 100644 --- a/dev-libs/rocm-comgr/Manifest +++ b/dev-libs/rocm-comgr/Manifest @@ -1,3 +1,4 @@ +DIST llvm-project-rocm-6.1.0.tar.gz 196002642 BLAKE2B 99783f7b0f9e9546b0363a45d69f534fe4558d580663506ec9fda94acc4c9170fe7a7dbd321f9b7ccc5245301793380fa0143da6e4186e2ab60ff20c3736093b SHA512 4e68f359ee306c431314df9cb64cb6f3f61b636a206166e3c3db597db47e86cc25ae6f06b0bc8bd18eab6cd475aa4395081dfcf8b07ef71970247553fab9e0de DIST rocm-comgr-5.1.3.tar.gz 117155 BLAKE2B 40e415c4c7ae3e709dd50981299291f0fc1133f35310b4c86a86847d3bce5fd7685a3f4480f8f156873ca922921c1d4e1cb620fd33bd5cdc87f155af839f2bbe SHA512 5927250f5e03c32b7f270a1dbfe5221d349dfe32aba34143040da53d4e7eb83faa3073a43edabcff13e1fc977bc17088404523f2ab2ea95e207d2c00beb4249b DIST rocm-comgr-5.3.3.tar.gz 120414 BLAKE2B 29b9d466d74ef94165a2b9bea35eac4616f6b2fc529cdac3c830ee7dc08f219cb9e5d4f081658881c76633f12eaebb74d1a2ea30a76652231b8ee516f9988db1 SHA512 ba7b1ef214e3624168e438ed7fd94291a07508fe89d178c0b158bf22e0998d5a8e4d8f0a7f08f05ac108ef65f725db5764fd66353a85bc25000e572a4fdcb61f DIST rocm-comgr-5.4.3.tar.gz 120461 BLAKE2B c4eb79dd5a72a2b18e16841fc8cb9a3a33efb0c7b04a7585df9672d682bba6fa826ab8b37dba5febca3b8c5ee5aca30d8546e1fa69e77671e5c750e2a8c1f12f SHA512 1a25af99a0166d70ca6dc5df5a667068eaf583dccd74bbb18a2a5de3c1b769e0c1eb9a0c539e0cd88bc50bbbe53214a1d1b23fbdfd6fc5b6507c44da259815c4 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch deleted file mode 100644 index a5a0edb92f6b6..0000000000000 --- a/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch +++ /dev/null @@ -1,22 +0,0 @@ -ROCm 6.0.0 and 6.0.2 releases use mix between LLVM 17 and 18 -forked as https://github.com/RadeonOpenCompute/llvm-project -which makes some libraries compatible with only one version, -while other require another... - -Backports https://github.com/ROCm/llvm-project/commit/6cbc4dc91dfeb1cf2295cb350866e0b3a07dfee4 ---- a/src/comgr-metadata.cpp -+++ b/src/comgr-metadata.cpp -@@ -1087,7 +1087,12 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, - } - - BinaryStreamReader Reader(StringRef(DataP->Data, DataP->Size), -- support::little); -+#if LLVM_VERSION_MAJOR > 17 -+ llvm::endianness::little -+#else -+ support::little -+#endif -+ ); - - StringRef Magic; - if (auto EC = Reader.readFixedString(Magic, OffloadBundleMagicLen)) { diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-enforce-oop-compiler.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-enforce-oop-compiler.patch new file mode 100644 index 0000000000000..99cbf2f22ce6f --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-enforce-oop-compiler.patch @@ -0,0 +1,26 @@ +In-process compilation breaks compile_source_to_executable test, as it attempts to +build .so as fatbin, and some options does not work with unpatched LLVM. +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -1226,10 +1226,7 @@ amd_comgr_status_t AMDGPUCompiler::compileToFatBin() { + return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT; + } + +- // This is a workaround to support HIP OOP Fatbin Compilation +- CompileOOP = true; + auto Status = processFiles(AMD_COMGR_DATA_KIND_FATBIN, ".fatbin"); +- CompileOOP = false; + + return Status; + } +--- a/src/comgr-compiler.h ++++ b/src/comgr-compiler.h +@@ -102,7 +102,7 @@ class AMDGPUCompiler { + std::string ClangIncludePath; + std::string ClangIncludePath2; + /// Perform out-of-process compilation. +- bool CompileOOP = false; ++ bool CompileOOP = true; + /// Precompiled header file paths. + llvm::SmallVector, 2> PrecompiledHeaders; + /// Arguments common to all driver invocations in the current action. diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch new file mode 100644 index 0000000000000..989752066b674 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch @@ -0,0 +1,42 @@ +Remove HIP/ROCM includes ("-isystem /usr/include"), as they break inclusion of . +Add inclusion of Clang dir (e. g. /usr/lib/clang/17), as it is used in hip runtime like that. +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -1028,9 +1028,8 @@ AMDGPUCompiler::addTargetIdentifierFlags(llvm::StringRef IdentStr, + } + + amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() { +- HIPIncludePath = (Twine(env::getHIPPath()) + "/include").str(); +- // HIP headers depend on hsa.h which is in ROCM_DIR/include. +- ROCMIncludePath = (Twine(env::getROCMPath()) + "/include").str(); ++ // Allow to include (used in some hip files) ++ ClangIncludePath = "/usr/lib/clang/" + std::to_string(LLVM_VERSION_MAJOR); + + Args.push_back("-x"); + +@@ -1055,9 +1054,7 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() { + Args.push_back("x86_64-unknown-linux-gnu"); + Args.push_back("--cuda-device-only"); + Args.push_back("-isystem"); +- Args.push_back(ROCMIncludePath.c_str()); +- Args.push_back("-isystem"); +- Args.push_back(HIPIncludePath.c_str()); ++ Args.push_back(ClangIncludePath.c_str()); + break; + default: + return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT; +--- a/src/comgr-compiler.h ++++ b/src/comgr-compiler.h +@@ -95,12 +95,7 @@ class AMDGPUCompiler { + /// User supplied target GPU Arch. + std::string GPUArch; + std::string OffloadArch; +- /// ROCM include Path +- std::string ROCMIncludePath; +- /// HIP and Clang Include Paths +- std::string HIPIncludePath; + std::string ClangIncludePath; +- std::string ClangIncludePath2; + /// Perform out-of-process compilation. + bool CompileOOP = false; + /// Precompiled header file paths. diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-tests-rocm-path.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-tests-rocm-path.patch new file mode 100644 index 0000000000000..39516ee39f28f --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-tests-rocm-path.patch @@ -0,0 +1,20 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index c5507a7..6bbc607 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -42,6 +42,7 @@ macro(add_test_input_bitcode name input output) + add_custom_command( + OUTPUT "${output}" + COMMAND "$" -c -emit-llvm -target amdgcn-amd-amdhsa ++ --rocm-path=@GENTOO_PORTAGE_EPREFIX@/usr --hip-device-lib-path=@GENTOO_PORTAGE_EPREFIX@/usr/lib/amdgcn/bitcode + -mcpu=gfx900 + ${ARGN} "${CMAKE_CURRENT_SOURCE_DIR}/${input}" + -o "${output}" +@@ -60,6 +61,7 @@ macro(add_test_input_bundle name input output) + add_custom_command( + OUTPUT "${output}" + COMMAND "$" -c --offload-arch=gfx900 -emit-llvm -fgpu-rdc ++ --rocm-path=@GENTOO_PORTAGE_EPREFIX@/usr --hip-device-lib-path=@GENTOO_PORTAGE_EPREFIX@/usr/lib/amdgcn/bitcode + --gpu-bundle-output ${ARGN} "${CMAKE_CURRENT_SOURCE_DIR}/${input}" + -o "${output}" + VERBATIM diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch new file mode 100644 index 0000000000000..df008e4230d70 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch @@ -0,0 +1,79 @@ +ROCm 6.0.0 and 6.0.2 releases use mix between LLVM 17 and 18 +forked as https://github.com/RadeonOpenCompute/llvm-project +which makes some libraries compatible with LLVM 17, +while other require LLVM 18. + +Backports: +* https://github.com/ROCm/llvm-project/commit/6cbc4dc91dfeb1cf2295cb350866e0b3a07dfee4 +* https://github.com/ROCm/llvm-project/commit/179ec2e67bf882c6bccb27f81db3d80f7eb9946e +* https://github.com/ROCm/llvm-project/commit/ee123c3d1706bc4346511b1a9032020782576350 +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -205,7 +205,11 @@ bool AssemblerInvocation::createFromArgs(AssemblerInvocation &Opts, + // Parse the arguments. + const OptTable &OptTbl = getDriverOptTable(); + ++#if LLVM_VERSION_MAJOR == 17 + const unsigned IncludedFlagsBitmask = options::CC1AsOption; ++#else ++ llvm::opt::Visibility IncludedFlagsBitmask(options::CC1AsOption); ++#endif + unsigned MissingArgIndex, MissingArgCount; + InputArgList Args = OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount, + IncludedFlagsBitmask); +@@ -1041,11 +1045,15 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() { + Args.push_back("cl"); + Args.push_back("-std=cl1.2"); + Args.push_back("-cl-no-stdinc"); ++ Args.push_back("-mllvm"); ++ Args.push_back("-amdgpu-internalize-symbols"); + break; + case AMD_COMGR_LANGUAGE_OPENCL_2_0: + Args.push_back("cl"); + Args.push_back("-std=cl2.0"); + Args.push_back("-cl-no-stdinc"); ++ Args.push_back("-mllvm"); ++ Args.push_back("-amdgpu-internalize-symbols"); + break; + case AMD_COMGR_LANGUAGE_HIP: + Args.push_back("hip"); +@@ -1605,6 +1613,9 @@ amd_comgr_status_t AMDGPUCompiler::assembleToRelocatable() { + Args.push_back("-x"); + Args.push_back("assembler"); + ++ // -nogpulib option not needed for assembling to relocatable ++ NoGpuLib = false; ++ + return processFiles(AMD_COMGR_DATA_KIND_RELOCATABLE, ".o"); + } + +--- a/src/comgr-metadata.cpp ++++ b/src/comgr-metadata.cpp +@@ -1087,7 +1087,12 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, + } + + BinaryStreamReader Reader(StringRef(DataP->Data, DataP->Size), +- support::little); ++#if LLVM_VERSION_MAJOR == 17 ++ support::little ++#else ++ llvm::endianness::little ++#endif ++ ); + + StringRef Magic; + if (auto EC = Reader.readFixedString(Magic, OffloadBundleMagicLen)) { +--- a/test/compile_log_remarks_test.c ++++ b/test/compile_log_remarks_test.c +@@ -107,7 +107,11 @@ int main(int argc, char *argv[]) { + AMD_COMGR_DATA_KIND_SOURCE, 1); + + checkLogs("AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY", DataSetAsm, ++#if LLVM_VERSION_MAJOR == 17 + "remark: :0:0: 8 stack bytes in function " ++#else ++ "remark: :0:0: 8 stack bytes in function 'f' " ++#endif + "[-Rpass-analysis=prologepilog]"); + + Status = amd_comgr_destroy_data_set(DataSetCl); diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-remove-incompatible-clang-args.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-remove-incompatible-clang-args.patch new file mode 100644 index 0000000000000..114f685f3ae07 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-remove-incompatible-clang-args.patch @@ -0,0 +1,27 @@ +LLVM 17 does not support -relink-builtin-bitcode-postop flag. +It was added in LLVM 18 and removed in LLVM 19 +in https://github.com/llvm/llvm-project/commit/11a6799740f824282650aa9ec249b55dcf1a8aae + +This patch reverts https://github.com/ROCm/llvm-project/commit/a7f9e94995c7709eadb0204ed08f7c211d4b4733 +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -1074,8 +1074,6 @@ amd_comgr_status_t AMDGPUCompiler::addDeviceLibraries() { + return AMD_COMGR_STATUS_ERROR; + } + Args.push_back(Saver.save(Twine("--rocm-path=") + FakeRocmDir).data()); +- Args.push_back("-mllvm"); +- Args.push_back("-relink-builtin-bitcode-postop"); + NoGpuLib = false; + + for (auto DeviceLib : getDeviceLibraries()) { +--- a/test/compile_source_with_device_libs_to_bc_test.c ++++ b/test/compile_source_with_device_libs_to_bc_test.c +@@ -48,7 +48,7 @@ int main(int argc, char *argv[]) { + amd_comgr_action_info_t DataAction; + amd_comgr_status_t Status; + const char *CodeGenOptions[] = {"-mllvm", "-amdgpu-early-inline-all", +- "-mcode-object-version=5", "-mllvm", "-amdgpu-prelink"}; ++ "-mcode-object-version=5"}; + size_t CodeGenOptionsCount = + sizeof(CodeGenOptions) / sizeof(CodeGenOptions[0]); + diff --git a/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild b/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild index 14bc03e325f63..d82f2371daee9 100644 --- a/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild +++ b/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild @@ -32,7 +32,6 @@ PATCHES=( "${FILESDIR}/${PN}-5.7.1-fix-tests.patch" "${FILESDIR}/${PN}-5.7.1-correct-license-install-dir.patch" "${FILESDIR}/${PN}-6.0.0-extend-isa-compatibility-check.patch" - "${FILESDIR}/${PN}-6.0.0-llvm-18-compat.patch" ) DESCRIPTION="Radeon Open Compute Code Object Manager" diff --git a/dev-libs/rocm-comgr/rocm-comgr-6.1.0.ebuild b/dev-libs/rocm-comgr/rocm-comgr-6.1.0.ebuild new file mode 100644 index 0000000000000..7b11cd5c6c37f --- /dev/null +++ b/dev-libs/rocm-comgr/rocm-comgr-6.1.0.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( 17 18 ) + +inherit cmake llvm-r1 prefix + +MY_P=llvm-project-rocm-${PV} +components=( "amd/comgr" ) + +DESCRIPTION="Radeon Open Compute Code Object Manager" +HOMEPAGE="https://github.com/ROCm/ROCm-CompilerSupport" +SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}/${components[0]}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="test" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-5.1.3-rocm-path.patch + "${FILESDIR}"/0001-Find-CLANG_RESOURCE_DIR-using-clang-print-resource-d.patch + "${FILESDIR}"/${PN}-5.7.1-correct-license-install-dir.patch + "${FILESDIR}"/${PN}-6.0.0-extend-isa-compatibility-check.patch + "${FILESDIR}"/${PN}-6.1.0-remove-incompatible-clang-args.patch + "${FILESDIR}"/${PN}-6.1.0-fix-comgr-default-flags.patch + "${FILESDIR}"/${PN}-6.1.0-llvm-18-compat.patch + "${FILESDIR}"/${PN}-6.1.0-enforce-oop-compiler.patch +) +RDEPEND=" + >=dev-libs/rocm-device-libs-${PV}[${LLVM_USEDEP}] + dev-util/hipcc:${SLOT}[${LLVM_USEDEP}] + sys-devel/clang-runtime:= + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT}= + sys-devel/lld:${LLVM_SLOT}= + ') +" +DEPEND="${RDEPEND}" + +CMAKE_BUILD_TYPE=Release + +src_unpack() { + if [[ ${PV} == *9999 ]] ; then + git-r3_fetch + git-r3_checkout '' . '' "${components[@]}" + else + archive="${MY_P}.tar.gz" + ebegin "Unpacking from ${archive}" + tar -x -z -o \ + -f "${DISTDIR}/${archive}" \ + "${components[@]/#/${MY_P}/}" || die + eend ${?} + fi +} + +src_prepare() { + sed '/sys::path::append(HIPPath/s,"hip","",' -i src/comgr-env.cpp || die + sed "/return LLVMPath;/s,LLVMPath,llvm::SmallString<128>(\"$(get_llvm_prefix)\")," \ + -i src/comgr-env.cpp || die + + eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0-rocm_path.patch) + eapply $(prefixify_ro "${FILESDIR}"/${PN}-6.1.0-fix-tests-rocm-path.patch) + + cmake_src_prepare + + sed "s/@HIP_VERSION@/${PV}/" -i src/comgr-compiler.cpp || die +} + +src_configure() { + local mycmakeargs=( + -DLLVM_DIR="$(get_llvm_prefix)" + -DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58 + -DBUILD_TESTING=$(usex test ON OFF) + ) + cmake_src_configure +} + +src_test() { + local CMAKE_SKIP_TESTS=( + comgr_nested_kernel_test # See https://github.com/ROCm/llvm-project/issues/35 + ) + cmake_src_test +} From bc273eef4ac98f35a92a82304d937dc5925a67e9 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:17:20 +0000 Subject: [PATCH 15/45] dev-libs/rocr-runtime: add 6.1.0 Changes: * support LLVM 18 Signed-off-by: Sv. Lockal --- dev-libs/rocr-runtime/Manifest | 1 + .../files/rocr-runtime-6.1.0-ld-lld.patch | 17 +++ .../files/rocr-runtime-6.1.0-musl.patch | 106 ++++++++++++++++++ .../rocr-runtime/rocr-runtime-6.1.0.ebuild | 63 +++++++++++ 4 files changed, 187 insertions(+) create mode 100644 dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch create mode 100644 dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch create mode 100644 dev-libs/rocr-runtime/rocr-runtime-6.1.0.ebuild diff --git a/dev-libs/rocr-runtime/Manifest b/dev-libs/rocr-runtime/Manifest index adacf6e4bca1d..68ac7696975d3 100644 --- a/dev-libs/rocr-runtime/Manifest +++ b/dev-libs/rocr-runtime/Manifest @@ -4,3 +4,4 @@ DIST rocr-runtime-5.4.3.tar.gz 811062 BLAKE2B 4ee8ef49cdac7f6918db3aa96089852847 DIST rocr-runtime-5.5.1.tar.gz 816175 BLAKE2B e588d98cbd0d9a753b950ba676d6cddeed8cd094f346b2f67a761ac2d760ba28e27d5baceecf13fff53c114bb8412c8a4d892886c304d36181d5b0b020b8088a SHA512 1cae2ae4f30a248fa27622ed8b77ce112b80aed9bc1b8fc4372143d4ef241f47295a77f9e978be1332f48c06a7cbcdfd478dbc8464028cb761480049ab2413fb DIST rocr-runtime-5.7.1.tar.gz 832009 BLAKE2B 67e4a64ee03b1f6edc43923c7ac44113ab58f78b032dc0a01952b2dd5b2ca37404044811effb9c8d83002ac4ea344a5d95ac62f3c66012bff2884ef55285cdb5 SHA512 a6547a104303032244d17b662a3eda48039732c215debb6178c0af8842c01c60f80989793420c101bd554e58332d215205da0c228dfc25538c56499f47dc6832 DIST rocr-runtime-6.0.0.tar.gz 851206 BLAKE2B f45f72719e4146fc5c6755b34625de60900a84a7f97fc559d641409edbbda73132c9cf784d59c4ccfdc3f0a1902e379db68d565f92420a8128a04483c50831dd SHA512 18d79436a93b9f57ffa0d4db670e0f2b05c5b9826c9323c7c2f8c856f650a10e5c4b7f6e55e2750156f3859a289617ac40128cfb6fe25de918ee5d8e4b6a8095 +DIST rocr-runtime-6.1.0.tar.gz 903493 BLAKE2B 4b89617cb7dca34bd7470c1ddadc013d5ed32f2ba62b5b2282d6017c8ebcf2a6e1f2a565c5eba7108c82fb00091d06dd6cd97cf05d4e2d3335e183a69c1037b7 SHA512 6a5ec95296ede0431a1988986ea32ebc9c65ed1ba05832c07d3c224ff37781c6123c635a31870b28d42f7c28ab04a53449a3e581e841b257aa96061b6e2ab038 diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch new file mode 100644 index 0000000000000..fb5d3d3419674 --- /dev/null +++ b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-ld-lld.patch @@ -0,0 +1,17 @@ +Fix "symbol not defined" when linking with ld.lld >= 17 +https://github.com/ROCm/ROCR-Runtime/issues/204 +--- a/hsacore.so.def ++++ b/hsacore.so.def +@@ -246,12 +246,6 @@ global: + hsa_amd_vmem_retain_alloc_handle; + hsa_amd_vmem_get_alloc_properties_from_handle; + hsa_amd_agent_set_async_scratch_limit; +- hsa_tools_scratch_event_alloc_start; +- hsa_tools_scratch_event_alloc_end; +- hsa_tools_scratch_event_free_start; +- hsa_tools_scratch_event_free_end; +- hsa_tools_scratch_event_async_reclaim_start; +- hsa_tools_scratch_event_async_reclaim_end; + + local: + *; diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch new file mode 100644 index 0000000000000..7554c8c79ec1b --- /dev/null +++ b/dev-libs/rocr-runtime/files/rocr-runtime-6.1.0-musl.patch @@ -0,0 +1,106 @@ +Fix compilation and symbol search with musl. + +Bug: https://github.com/ROCm/ROCR-Runtime/issues/181 +--- src.orig/core/inc/checked.h ++++ src/core/inc/checked.h +@@ -58,7 +58,7 @@ template flag().override_cpu_affinity()) { +- int cores = get_nprocs_conf(); +- cpu_set_t* cpuset = CPU_ALLOC(cores); ++ cores = get_nprocs_conf(); ++ cpuset = CPU_ALLOC(cores); + if (cpuset == nullptr) { + fprintf(stderr, "CPU_ALLOC failed: %s\n", strerror(errno)); + return; +@@ -642,11 +645,13 @@ SharedMutex CreateSharedMutex() { + fprintf(stderr, "rw lock attribute init failed: %s\n", strerror(err)); + return nullptr; + } ++#if defined(__GLIBC__) + err = pthread_rwlockattr_setkind_np(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); + if (err != 0) { + fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err)); + return nullptr; + } ++#endif + + pthread_rwlock_t* lock = new pthread_rwlock_t; + err = pthread_rwlock_init(lock, &attrib); +--- src.orig/core/util/utils.h ++++ src/core/util/utils.h +@@ -74,7 +74,7 @@ static __forceinline void* _aligned_mall + return aligned_alloc(alignment, size); + #else + void *mem = NULL; +- if (NULL != posix_memalign(&mem, alignment, size)) ++ if (0 != posix_memalign(&mem, alignment, size)) + return NULL; + return mem; + #endif +--- src.orig/image/util.h ++++ src/image/util.h +@@ -99,7 +99,7 @@ static __forceinline void* _aligned_mall + return aligned_alloc(alignment, size); + #else + void* mem = NULL; +- if (NULL != posix_memalign(&mem, alignment, size)) return NULL; ++ if (0 != posix_memalign(&mem, alignment, size)) return NULL; + return mem; + #endif + } +--- src.orig/core/util/lnx/os_linux.cpp ++++ src/core/util/lnx/os_linux.cpp +@@ -65,6 +65,16 @@ + #include + #endif + ++/* ++ * d_un.d_ptr is relative on non glibc systems ++ * elf(5) documents it this way, glibc diverts from this documentation ++ */ ++#ifdef __GLIBC__ ++#define ABS_ADDR(base, ptr) (ptr) ++#else ++#define ABS_ADDR(base, ptr) ((base) + (ptr)) ++#endif ++ + namespace rocr { + namespace os { + +@@ -299,7 +309,7 @@ static int callback(struct dl_phdr_info* info, size_t size, void* data) { + for (int j = 0;; j++) { + if (dyn_section[j].d_tag == DT_NULL) break; + +- if (dyn_section[j].d_tag == DT_STRTAB) strings = (char*)(dyn_section[j].d_un.d_ptr); ++ if (dyn_section[j].d_tag == DT_STRTAB) strings = (char*)ABS_ADDR(info->dlpi_addr, dyn_section[j].d_un.d_ptr); + + if (dyn_section[j].d_tag == DT_STRSZ) limit = dyn_section[j].d_un.d_val; + } diff --git a/dev-libs/rocr-runtime/rocr-runtime-6.1.0.ebuild b/dev-libs/rocr-runtime/rocr-runtime-6.1.0.ebuild new file mode 100644 index 0000000000000..3ada47e97b124 --- /dev/null +++ b/dev-libs/rocr-runtime/rocr-runtime-6.1.0.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( 17 18 ) + +inherit cmake flag-o-matic llvm-r1 + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/ROCm/ROCR-Runtime.git" + inherit git-r3 + S="${WORKDIR}/${P}/src" +else + SRC_URI="https://github.com/ROCm/ROCR-Runtime/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/ROCR-Runtime-rocm-${PV}/src" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Radeon Open Compute Runtime" +HOMEPAGE="https://github.com/ROCm/ROCR-Runtime" +PATCHES=( + "${FILESDIR}/${PN}-4.3.0_no-aqlprofiler.patch" + "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch" + "${FILESDIR}/${PN}-6.1.0-ld-lld.patch" + "${FILESDIR}/${PN}-6.1.0-musl.patch" +) + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +IUSE="debug" + +COMMON_DEPEND="dev-libs/elfutils + x11-libs/libdrm" +DEPEND="${COMMON_DEPEND} + >=dev-libs/roct-thunk-interface-${PV} + >=dev-libs/rocm-device-libs-${PV} + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT}= + sys-devel/lld:${LLVM_SLOT}= + ') +" +RDEPEND="${DEPEND}" +BDEPEND="app-editors/vim-core" + # vim-core is needed for "xxd" + +src_prepare() { + # Gentoo installs "*.bc" to "/usr/lib" instead of a "[path]/bitcode" directory ... + sed -e "s:-O2:--rocm-path=${EPREFIX}/usr/lib/ -O2:" -i image/blit_src/CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + # -Werror=odr + # https://bugs.gentoo.org/856091 + # https://github.com/ROCm/ROCR-Runtime/issues/182 + filter-lto + + use debug || append-cxxflags "-DNDEBUG" + local mycmakeargs=( -DINCLUDE_PATH_COMPATIBILITY=OFF ) + cmake_src_configure +} From 1f33014978fe6d16cf5c865788b7e63ce5fa0c9f Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:18:31 +0000 Subject: [PATCH 16/45] dev-libs/roct-thunk-interface: add 6.1.0 Signed-off-by: Sv. Lockal --- dev-libs/roct-thunk-interface/Manifest | 1 + .../files/kfdtest-6.1.0-libpath.patch | 13 +++ .../files/kfdtest-6.1.0-linklibLLVM.patch | 31 +++++++ ...oct-thunk-interface-6.1.0-visibility.patch | 26 ++++++ .../roct-thunk-interface-6.1.0.ebuild | 80 +++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch create mode 100644 dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch create mode 100644 dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch create mode 100644 dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.0.ebuild diff --git a/dev-libs/roct-thunk-interface/Manifest b/dev-libs/roct-thunk-interface/Manifest index 5d6ef732ff393..ab9bce34c8f41 100644 --- a/dev-libs/roct-thunk-interface/Manifest +++ b/dev-libs/roct-thunk-interface/Manifest @@ -4,3 +4,4 @@ DIST roct-thunk-interface-5.4.3.tar.gz 648897 BLAKE2B 9eefc5f417280a98c7c6b6d611 DIST roct-thunk-interface-5.5.1.tar.gz 649617 BLAKE2B 54ecae486e5d8b99363947a93b38bb80f6b129bbacc1b3152d58e44cf093e44254075cdc49f6d0f474a04c5e2a1f3945399a744892ac1e5c1fb3ff38fd02370c SHA512 359ce5c7d8fce1f6100aac236efd24d35ce8098732bf89225e7c07a4731452388b5213eda8767a8d7723afa2041033bbcb287dcb00e88a0df9494acf70f8ebaf DIST roct-thunk-interface-5.7.1.tar.gz 665529 BLAKE2B 407601d45976ad66e85999c53bcaa62fefa2ea823e1d3296a9aabe8b6a9c915776344de4499fcf6f9ee80193201308b27b387a7225aca5d2cc7e294143eefacd SHA512 c0dc449c8b713ac543f6cd6c876ea0f160dcb1a5c4a52a2b1364fcae0039e9fe195e4223a2644d7d3a7fbc2a48166e798d15b9088e2097b65974e2ba5e48bdcf DIST roct-thunk-interface-6.0.0.tar.gz 665726 BLAKE2B 634165c1dce2d4e2f635688ea54c0eb3dd0cf0a0ae84fbbf22f07f62675ad77daea168b16c73e7b4912a46b8507d414119310f31bf110475e27d4629209067d9 SHA512 136a512273823738a3a85330158099b33084018485c94cb20244d61b5f6932949d32eba1fe77512b0933f0269da2f5bcec4cef5b503dc810140a9c080cf65e0f +DIST roct-thunk-interface-6.1.0.tar.gz 666309 BLAKE2B 734a702a95a7bda38982501e21aaf23aec8888b875c27cf2d5d6e297f929a0b8e7a68f8304184daf75ea97acfe93bc2e2b7cd190a795d9cbd05eae3c3c54af86 SHA512 f8adff9ae5f4e509cd9de0b42045fc550f86d4106708825268d05912a94c79d737c2aa03250ad887f39f51d36e13894e700228ee0daa61237827e92f1dc88b0e diff --git a/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch new file mode 100644 index 0000000000000..1d7d73ad7a8ad --- /dev/null +++ b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch @@ -0,0 +1,13 @@ +The built hsakmt library is right under BUILD_DIR, not BUILD_DIR/lib +=================================================================== +--- a/tests/kfdtest/CMakeLists.txt ++++ b./tests/kfdtest/CMakeLists.txt +@@ -117,7 +117,7 @@ else() + endif() + + if( DEFINED LIBHSAKMT_PATH ) +- set ( HSAKMT_LIBRARY_DIRS ${LIBHSAKMT_PATH}/lib ) ++ set ( HSAKMT_LIBRARY_DIRS ${LIBHSAKMT_PATH}/ ) + set ( HSAKMT_LIBRARIES hsakmt ) + endif() + diff --git a/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch new file mode 100644 index 0000000000000..61d8b99bf3354 --- /dev/null +++ b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch @@ -0,0 +1,31 @@ +https://github.com/ROCm/ROCT-Thunk-Interface/pull/102 +From 6d7d48bb6843405aac2777388edf4c7c2a6f9dc3 Mon Sep 17 00:00:00 2001 +From: Yiyang Wu +Date: Tue, 30 Apr 2024 13:35:08 +0800 +Subject: [PATCH] Allow linking libLLVM dynamic library rather than separate + components + +--- + tests/kfdtest/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/tests/kfdtest/CMakeLists.txt b/tests/kfdtest/CMakeLists.txt +index 9d1172e..ccad7f4 100644 +--- a/tests/kfdtest/CMakeLists.txt ++++ b/tests/kfdtest/CMakeLists.txt +@@ -154,7 +154,11 @@ include_directories(${LLVM_INCLUDE_DIRS}) + separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS}) + add_definitions(${LLVM_DEFINITIONS_LIST}) + +-llvm_map_components_to_libnames(llvm_libs AMDGPUAsmParser Core Support) ++if (LLVM_LINK_LLVM_DYLIB) ++ set(llvm_libs LLVM) ++else() ++ llvm_map_components_to_libnames(llvm_libs AMDGPUAsmParser Core Support) ++endif() + + include_directories(${PROJECT_SOURCE_DIR}/gtest-1.6.0) + include_directories(${PROJECT_SOURCE_DIR}/include) +-- +2.44.0 + diff --git a/dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch new file mode 100644 index 0000000000000..d907d2f13e418 --- /dev/null +++ b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch @@ -0,0 +1,26 @@ +https://github.com/ROCm/ROCT-Thunk-Interface/pull/102 +From 8385d8795b994f31e00e651dc4f41e18d82ff968 Mon Sep 17 00:00:00 2001 +From: Yiyang Wu +Date: Tue, 30 Apr 2024 15:07:12 +0800 +Subject: [PATCH] hsaKmtCheckRuntimeDebugSupport should be visible for kfdtest + +--- + src/debug.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/debug.c b/src/debug.c +index 932e829..67c32c8 100644 +--- a/src/debug.c ++++ b/src/debug.c +@@ -268,7 +268,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtDbgAddressWatch(HSAuint32 NodeId, + #define HSA_RUNTIME_ENABLE_MAX_MAJOR 1 + #define HSA_RUNTIME_ENABLE_MIN_MINOR 13 + +-HSAKMT_STATUS hsaKmtCheckRuntimeDebugSupport(void) { ++HSAKMT_STATUS HSAKMTAPI hsaKmtCheckRuntimeDebugSupport(void) { + HsaNodeProperties node = {0}; + HsaSystemProperties props = {0}; + HsaVersionInfo versionInfo = {0}; +-- +2.44.0 + diff --git a/dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.0.ebuild b/dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.0.ebuild new file mode 100644 index 0000000000000..360a55716fbb5 --- /dev/null +++ b/dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.0.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_SKIP_GLOBALS=1 +inherit cmake linux-info rocm + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/ROCm/ROCT-Thunk-Interface/" + inherit git-r3 +else + SRC_URI="https://github.com/ROCm/ROCT-Thunk-Interface/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/ROCT-Thunk-Interface-rocm-${PV}" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Radeon Open Compute Thunk Interface" +HOMEPAGE="https://github.com/ROCm/ROCT-Thunk-Interface" +CONFIG_CHECK="~HSA_AMD ~HMM_MIRROR ~ZONE_DEVICE ~DRM_AMDGPU ~DRM_AMDGPU_USERPTR" +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" + +RDEPEND="sys-process/numactl + x11-libs/libdrm[video_cards_amdgpu]" +DEPEND="${RDEPEND} + test? ( sys-devel/llvm + dev-cpp/gtest )" + +IUSE="test" +RESTRICT="!test? ( test )" + +CMAKE_BUILD_TYPE=Release + +PATCHES=( + "${FILESDIR}/${PN}-5.7.1-musl.patch" + "${FILESDIR}/${PN}-6.1.0-visibility.patch" + "${FILESDIR}/kfdtest-6.1.0-linklibLLVM.patch" + "${FILESDIR}/kfdtest-6.1.0-libpath.patch" +) + +test_wrapper() { + local S="$1" + shift 1 + local CMAKE_USE_DIR="${S}" + local BUILD_DIR="${S}_build" + cd "${S}" || die + $@ +} + +src_prepare() { + sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DCPACK_PACKAGING_INSTALL_PREFIX="${EPREFIX}/usr" + ) + cmake_src_configure + + if use test; then + export LIBHSAKMT_PATH="${BUILD_DIR}" + test_wrapper "${S}/tests/kfdtest" cmake_src_configure + fi +} + +src_compile() { + cmake_src_compile + if use test; then + LIBRARY_PATH="${BUILD_DIR}" test_wrapper "${S}/tests/kfdtest" cmake_src_compile + fi +} + +src_test() { + check_amdgpu + TESTDIR="${S}/tests/kfdtest_build/" + cd "${TESTDIR}" || die + PATH="${PATH}:${TESTDIR}" ./run_kfdtest.sh +} From 7731ad962dc6608cdee6f737fba2e89b0f390aef Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 15:00:05 +0000 Subject: [PATCH 17/45] dev-util/rocm-smi: add 6.1.1 Changes: * rework soname patch to use official/Fedora soversion: librocm_smi64.so.6 (was librocm_smi64.so.1 as in Debian) * rename RadeonOpenCompute -> ROCm * add myself as a maintainer Signed-off-by: Sv. Lockal --- dev-util/rocm-smi/Manifest | 1 + .../files/rocm-smi-6.0.2-set-soversion.patch | 103 ++++++++++++++++++ .../rocm-smi-6.1.1-fix-const-qualifier.patch | 13 +++ dev-util/rocm-smi/metadata.xml | 6 +- dev-util/rocm-smi/rocm-smi-6.1.1.ebuild | 59 ++++++++++ 5 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 dev-util/rocm-smi/files/rocm-smi-6.0.2-set-soversion.patch create mode 100644 dev-util/rocm-smi/files/rocm-smi-6.1.1-fix-const-qualifier.patch create mode 100644 dev-util/rocm-smi/rocm-smi-6.1.1.ebuild diff --git a/dev-util/rocm-smi/Manifest b/dev-util/rocm-smi/Manifest index d8623a5635f48..13768c7c3df60 100644 --- a/dev-util/rocm-smi/Manifest +++ b/dev-util/rocm-smi/Manifest @@ -1,3 +1,4 @@ DIST rocm-smi-5.1.3.tar.gz 1701386 BLAKE2B c5e779f5c33fec0b1b39b09c758dfadd3c24e28f15381593f2959e5c2fb9f49af3a7ca1f9ab7d6bf34c5af4fbe3f0c0ae20c6c049cbf9421a9184735bb4a64a2 SHA512 7bf7af2b42a035c298c2f9009b6123671af41f9ca1a50607cfa362f39dbd82ff88f8c13ece6c4edab585edadd9072ed096a400dd3850851e1beef3633a8eb14e DIST rocm-smi-5.4.2.tar.gz 1553259 BLAKE2B 0560e115028caafb1d5dd8892cfa677431b792714ecd8c75f31451fa7685d1c7070cbd687c894d7eefd112de5e2df9aa7895aa57821db207dffc4e8890898638 SHA512 0fd651593df0ebbcb2c2327d030d2674efacdb6e883daa5a8adf733db2bde3e5d16dc304856221f4bb07a3cd834944ffcc7ebd689624f7ba24ffd6c262ba74b8 DIST rocm-smi-5.7.1.tar.gz 801646 BLAKE2B b4799bbdaeb7203c16117cd30511d589a2b96e15801bb9f1382fe7a4d87d43e1d4b458d6923b6ebd602fdccba74bd65bcb98766dbd83c48fc3e02219be8c1022 SHA512 ad364278f137228a39108c93d482635137ea2724a5a39debb5b32329493ebf5c706dcf3863e2e24b6f0b6286f3877942277f5ae447446f155518972b957f7d9d +DIST rocm-smi-6.1.1.tar.gz 872628 BLAKE2B 35830fd0eb36688b3803bed2059f29ba4d8613112ae4cfff2e0a3b1d7afef9f0d77ec16771e2205ba351df0aa678c3b0d2436940b76d10d020f1a30d14d760e9 SHA512 3e31ff0d94e7f0ea650c985973b27107e3f7293b92857fbf2fe196b61632c530e95c3228ad7550d44f8ee9f5f1abfd17e5c2b19164759728fb6d4b0995455fa7 diff --git a/dev-util/rocm-smi/files/rocm-smi-6.0.2-set-soversion.patch b/dev-util/rocm-smi/files/rocm-smi-6.0.2-set-soversion.patch new file mode 100644 index 0000000000000..39bc6ac350a80 --- /dev/null +++ b/dev-util/rocm-smi/files/rocm-smi-6.0.2-set-soversion.patch @@ -0,0 +1,103 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b3eff5d..d2fd098 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,20 +30,17 @@ set(SHARE_INSTALL_PREFIX + "share/${ROCM_SMI}" + CACHE STRING "Tests and Example install directory") + +-# provide git to utilities +-find_program (GIT NAMES git) +- +-## Setup the package version based on git tags. +-set(PKG_VERSION_GIT_TAG_PREFIX "rsmi_pkg_ver") +-get_package_version_number("7.0.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT) +-message("Package version: ${PKG_VERSION_STR}") +-set(${ROCM_SMI_LIBS_TARGET}_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}") +-set(${ROCM_SMI_LIBS_TARGET}_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}") +-set(${ROCM_SMI_LIBS_TARGET}_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}") +-set(${ROCM_SMI_LIBS_TARGET}_VERSION_BUILD "0") +-set(${ROCM_SMI_LIBS_TARGET}_VERSION_HASH "${PKG_VERSION_HASH}") +- +-set(${ROCM_SMI_LIBS_TARGET}_VERSION_STRING "${${ROCM_SMI_LIBS_TARGET}_VERSION_MAJOR}.${${ROCM_SMI_LIBS_TARGET}_VERSION_MINOR}.${${ROCM_SMI_LIBS_TARGET}_VERSION_PATCH}+${${ROCM_SMI_LIBS_TARGET}_VERSION_HASH}") ++set(VERSION_MAJOR "@VERSION_MAJOR@") ++set(VERSION_MINOR "@VERSION_MINOR@") ++set(VERSION_PATCH "@VERSION_PATCH@") ++set(PKG_VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") ++set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}") ++set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}") ++set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") ++set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") ++set(rocm_smi_VERSION_MAJOR "${VERSION_MAJOR}") ++set(rocm_smi_VERSION_MINOR "${VERSION_MINOR}") ++set(rocm_smi_VERSION_PATCH "${VERSION_PATCH}") + + # The following default version values should be updated as appropriate for + # ABI breaks (update MAJOR and MINOR), and ABI/API additions (update MINOR). +diff --git a/oam/CMakeLists.txt b/oam/CMakeLists.txt +index 6927d24..ee2694c 100644 +--- a/oam/CMakeLists.txt ++++ b/oam/CMakeLists.txt +@@ -29,17 +29,6 @@ set(OAM_NAME "oam") + set(OAM_COMPONENT "lib${OAM_NAME}") + set(OAM_TARGET "${OAM_NAME}") + +-################# Determine the library version ######################### +-set(SO_VERSION_GIT_TAG_PREFIX "oam_so_ver") +- +-# VERSION_* variables should be set by get_version_from_tag +-message("Package version: ${PKG_VERSION_STR}") +- +-# Debian package specific variables +-# Set a default value for the package version +-get_version_from_tag("1.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT) +- +-# VERSION_* variables should be set by get_version_from_tag + if ( ${ROCM_PATCH_VERSION} ) + set ( VERSION_PATCH ${ROCM_PATCH_VERSION}) + set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") +diff --git a/python_smi_tools/rsmiBindings.py.in b/python_smi_tools/rsmiBindings.py.in +index 8847934..71ace15 100644 +--- a/python_smi_tools/rsmiBindings.py.in ++++ b/python_smi_tools/rsmiBindings.py.in +@@ -26,17 +26,7 @@ def initRsmiBindings(silent=False): + if (rocm_smi_lib_path != None): + path_librocm = rocm_smi_lib_path + else: +- path_librocm = os.path.dirname(os.path.realpath(__file__)) + '/../../@CMAKE_INSTALL_LIBDIR@/librocm_smi64.so.@VERSION_MAJOR@' +- +- if not os.path.isfile(path_librocm): +- print_silent('Unable to find %s . Trying /opt/rocm*' % path_librocm) +- for root, dirs, files in os.walk('/opt', followlinks=True): +- if 'librocm_smi64.so.@VERSION_MAJOR@' in files: +- path_librocm = os.path.join(os.path.realpath(root), 'librocm_smi64.so.@VERSION_MAJOR@') +- if os.path.isfile(path_librocm): +- print_silent('Using lib from %s' % path_librocm) +- else: +- print('Unable to find librocm_smi64.so.@VERSION_MAJOR@') ++ path_librocm = 'librocm_smi64.so.@VERSION_MAJOR@' + + # ----------> TODO: Support static libs as well as SO + try: +diff --git a/rocm_smi/CMakeLists.txt b/rocm_smi/CMakeLists.txt +index 645e598..443b43f 100755 +--- a/rocm_smi/CMakeLists.txt ++++ b/rocm_smi/CMakeLists.txt +@@ -31,17 +31,6 @@ set(ROCM_SMI_TARGET "${ROCM_SMI}64") + ## Include common cmake modules + include(utils) + +-################# Determine the library version ######################### +-set(SO_VERSION_GIT_TAG_PREFIX "rsmi_so_ver") +- +-# VERSION_* variables should be set by get_version_from_tag +-message("Package version: ${PKG_VERSION_STR}") +- +-# Debian package specific variables +-# Set a default value for the package version +-get_version_from_tag("1.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT) +- +-# VERSION_* variables should be set by get_version_from_tag + if ( ${ROCM_PATCH_VERSION} ) + set ( VERSION_PATCH ${ROCM_PATCH_VERSION}) + set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") diff --git a/dev-util/rocm-smi/files/rocm-smi-6.1.1-fix-const-qualifier.patch b/dev-util/rocm-smi/files/rocm-smi-6.1.1-fix-const-qualifier.patch new file mode 100644 index 0000000000000..6c41970915754 --- /dev/null +++ b/dev-util/rocm-smi/files/rocm-smi-6.1.1-fix-const-qualifier.patch @@ -0,0 +1,13 @@ +Fix error "cannot assign to variable 'rhs' with const-qualified type" +PR: https://github.com/ROCm/rocm_smi_lib/pull/156 +--- a/include/rocm_smi/rocm_smi_utils.h ++++ b/include/rocm_smi/rocm_smi_utils.h +@@ -216,7 +216,7 @@ class ScopeGuard { + __forceinline ~ScopeGuard() { + if (!dismiss_) release_(); + } +- __forceinline ScopeGuard& operator=(const ScopeGuard& rhs) { ++ __forceinline ScopeGuard& operator=(ScopeGuard& rhs) { + dismiss_ = rhs.dismiss_; + release_ = rhs.release_; + rhs.dismiss_ = true; diff --git a/dev-util/rocm-smi/metadata.xml b/dev-util/rocm-smi/metadata.xml index 6ae700d1f577f..c909acfea388e 100644 --- a/dev-util/rocm-smi/metadata.xml +++ b/dev-util/rocm-smi/metadata.xml @@ -9,11 +9,15 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + proxy-maint@gentoo.org Proxy Maintainers - RadeonOpenCompute/ROC-smi + ROCm/ROC-smi diff --git a/dev-util/rocm-smi/rocm-smi-6.1.1.ebuild b/dev-util/rocm-smi/rocm-smi-6.1.1.ebuild new file mode 100644 index 0000000000000..cc629874ad4b1 --- /dev/null +++ b/dev-util/rocm-smi/rocm-smi-6.1.1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +inherit cmake python-r1 + +DESCRIPTION="ROCm System Management Interface Library" +HOMEPAGE="https://github.com/ROCm/rocm_smi_lib" + +if [[ ${PV} == *9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/ROCm/rocm_smi_lib" + EGIT_BRANCH="master" +else + SRC_URI="https://github.com/ROCm/rocm_smi_lib/archive/rocm-${PV}.tar.gz -> rocm-smi-${PV}.tar.gz" + KEYWORDS="~amd64" + S="${WORKDIR}/rocm_smi_lib-rocm-${PV}" +fi + +LICENSE="MIT NCSA-AMD" +SLOT="0/$(ver_cut 1-2)" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS}" + +PATCHES=( + "${FILESDIR}"/${PN}-5.7.1-no-strip.patch + "${FILESDIR}"/${PN}-5.7.1-remove-example.patch + "${FILESDIR}"/${PN}-6.0.2-set-soversion.patch + "${FILESDIR}"/${PN}-6.1.1-fix-const-qualifier.patch +) + +src_prepare() { + cmake_src_prepare + + sed -e "s/@VERSION_MAJOR@/$(ver_cut 1)/" \ + -e "s/@VERSION_MINOR@/$(ver_cut 2)/" \ + -e "s/@VERSION_PATCH@/$(ver_cut 3)/" \ + -i CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + python_foreach_impl python_newscript python_smi_tools/rocm_smi.py rocm-smi + python_foreach_impl python_domodule python_smi_tools/rsmiBindings.py + + mv "${ED}"/usr/share/doc/rocm_smi "${ED}"/usr/share/doc/${PF} || die +} From 6af724f2577880800a938efc12a4ae00321640f0 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 15:31:06 +0000 Subject: [PATCH 18/45] dev-util/hipify-clang: add 6.1.1 Changes: * fix-clang-libs.patch replaced with CMAKE_PREFIX_PATH * renamed ROCm-Developer-Tools to ROCm in urls Signed-off-by: Sv. Lockal --- dev-util/hipify-clang/Manifest | 1 + .../hipify-clang/hipify-clang-6.1.1.ebuild | 51 +++++++++++++++++++ dev-util/hipify-clang/metadata.xml | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 dev-util/hipify-clang/hipify-clang-6.1.1.ebuild diff --git a/dev-util/hipify-clang/Manifest b/dev-util/hipify-clang/Manifest index c191db35770b4..21ddfce17d129 100644 --- a/dev-util/hipify-clang/Manifest +++ b/dev-util/hipify-clang/Manifest @@ -1 +1,2 @@ DIST HIPIFY-5.7.1.tar.gz 673452 BLAKE2B e0293c1b7f9ea028efc8d712ddedae4ec933c5bcfba524e13816bd999e67bcf06097f9fe0e4d1f4fa6a38df133be694e92adeefd92f77301d8537b6880b1a1fe SHA512 0cc75fdbcb6278d319cfe8ee3c8547dc75ea494a007d2159c64312c3411627905e0d6c7d7f0032cbc4c727a90723325aa2705db2fd473dbeb41e60f276d1c9a7 +DIST HIPIFY-6.1.1.tar.gz 813425 BLAKE2B accc661431f11796d0c8bcf638537a6035020b2a36ebe66c1b8c10bb63b762418d5fd1f256f3a3e51d2ace224a6492abfe72838bef859b1da68c2126cc3521be SHA512 29c45e312c8e2f0d06916b57f24eba27ba7beae3bd860850b57cfe27c87df22aabe9fdcf3d12671b81e68b61c3974aaf0064e96ae68392d181148aaeef14f1c7 diff --git a/dev-util/hipify-clang/hipify-clang-6.1.1.ebuild b/dev-util/hipify-clang/hipify-clang-6.1.1.ebuild new file mode 100644 index 0000000000000..88c80f5246202 --- /dev/null +++ b/dev-util/hipify-clang/hipify-clang-6.1.1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( {17..18} ) + +inherit cmake llvm-r1 + +DESCRIPTION="A set of tools to translate CUDA source code into portable HIP C++" +HOMEPAGE="https://github.com/ROCm/HIPIFY" +SRC_URI="https://github.com/ROCm/HIPIFY/archive/rocm-${PV}.tar.gz -> HIPIFY-${PV}.tar.gz" +S="${WORKDIR}/HIPIFY-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +BDEPEND=">=dev-build/cmake-3.22" +DEPEND=" + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT}= + sys-devel/llvm:${LLVM_SLOT}= + ') +" + +PATCHES=( + "${FILESDIR}/${PN}-5.7.1-fix-clang-libs.patch" +) + +src_prepare() { + cmake_src_prepare + sed -i 's:/../libexec/hipify::' \ + bin/hipconvertinplace.sh bin/hipconvertinplace-perl.sh \ + bin/hipexamine-perl.sh bin/hipexamine.sh || die +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_PREFIX_PATH="$(get_llvm_prefix)/$(get_libdir)/cmake/llvm" + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + # rm unwanted copy + rm -rf "${ED}/usr/hip" || die +} diff --git a/dev-util/hipify-clang/metadata.xml b/dev-util/hipify-clang/metadata.xml index 82e35f93e1984..4d4ce95c15e48 100644 --- a/dev-util/hipify-clang/metadata.xml +++ b/dev-util/hipify-clang/metadata.xml @@ -10,6 +10,6 @@ Sv. Lockal - ROCm-Developer-Tools/HIPIFY + ROCm/HIPIFY From ec9d2e5612f0d70d6b8cdc9c3c89197860e4f95a Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 17:06:54 +0000 Subject: [PATCH 19/45] dev-libs/rccl: add 6.1.1 Changes since 5.7.1: * remove-chrpath patch is not needed now * bad percent escape fix is not needed now * addpredict in src_configure is not needed (compilation should not access device anyways) * removing extra copy of headers is not needed * new patch for missing ${ROCM_PATH}/.info/version is needed now * rename ROCmSoftwarePlatform to ROCm in urls * fix tests directory (in 5.7.1 too) Signed-off-by: Sv. Lockal --- dev-libs/rccl/Manifest | 1 + .../files/rccl-6.0.2-fix-version-check.patch | 15 ++++ dev-libs/rccl/metadata.xml | 6 +- dev-libs/rccl/rccl-5.7.1.ebuild | 3 +- dev-libs/rccl/rccl-6.1.1.ebuild | 69 +++++++++++++++++++ 5 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 dev-libs/rccl/files/rccl-6.0.2-fix-version-check.patch create mode 100644 dev-libs/rccl/rccl-6.1.1.ebuild diff --git a/dev-libs/rccl/Manifest b/dev-libs/rccl/Manifest index baeaa02c7d4e5..3150ae9e3339f 100644 --- a/dev-libs/rccl/Manifest +++ b/dev-libs/rccl/Manifest @@ -1,2 +1,3 @@ DIST rccl-5.1.3.tar.gz 908274 BLAKE2B 46bff7b6e3d60d5884ccd7e19c54b2f47f90a337a8fdc6dca1a3cfee147e3652e1f912642cc134d4a82bf8daabd9f1391edff139d0517ab1078bd3d9650481d7 SHA512 20deb27c7ef3e6b6b73409950ac0d51286b4634f7002ce36a9a02cdd1d5b1f2db51f6decf773af83364c94f58cc96837da25299f5f5494fc15d8559a1b3c7fcc DIST rccl-5.7.1.tar.gz 1425561 BLAKE2B 852c111ad806d5c99f48b3c65c8cf37315c68b969f9544bfa14c1faf1d5557edcc57cdc21705ced6ded4a0288d42b1076e65fb67b3f89b4fa78cfba9d317b23e SHA512 5913b8ff67fa787714713b7d5b571374898be740d56c77db9f04fe7a3e6ca74023fa930a3494d8a6f984ac9e68ee318343835e110049d08700fe773376618af4 +DIST rccl-6.1.1.tar.gz 1679144 BLAKE2B 371d64691dc74f875c49e14df8f3f2d8b9c607376e6c5a889bd2bdb50607e88715d6d75ffed4ba3184a5b9b241cb37b8501e927a5f495632212909e410102490 SHA512 6c6376dd822182bcf28f573c0f3b5c7e52f94f4b670ee7c88519232f51b443d52cd37cbe6c41b5b6e9cb0b93c1124246a989f6e6a2ae74935134135585118002 diff --git a/dev-libs/rccl/files/rccl-6.0.2-fix-version-check.patch b/dev-libs/rccl/files/rccl-6.0.2-fix-version-check.patch new file mode 100644 index 0000000000000..feff936129a2e --- /dev/null +++ b/dev-libs/rccl/files/rccl-6.0.2-fix-version-check.patch @@ -0,0 +1,15 @@ +There is no /usr/.info/version file in Gentoo +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,10 +120,7 @@ execute_process( + message(STATUS "hipcc version: ${hipcc_version_string}") + + ## Check for ROCm version +-execute_process( +- COMMAND bash "-c" "cat ${ROCM_PATH}/.info/version" +- OUTPUT_VARIABLE rocm_version_string +-) ++set(rocm_version_string "@rocm_version@") + string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" rocm_version_matches ${rocm_version_string}) + if (rocm_version_matches) + set(ROCM_MAJOR_VERSION ${CMAKE_MATCH_1}) diff --git a/dev-libs/rccl/metadata.xml b/dev-libs/rccl/metadata.xml index 70bb629584c98..6ce4f3700a3db 100644 --- a/dev-libs/rccl/metadata.xml +++ b/dev-libs/rccl/metadata.xml @@ -13,7 +13,11 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCm-Developer-Tools/rccl + ROCm/rccl diff --git a/dev-libs/rccl/rccl-5.7.1.ebuild b/dev-libs/rccl/rccl-5.7.1.ebuild index 1ebf9619a55bb..846a21c20ca0c 100644 --- a/dev-libs/rccl/rccl-5.7.1.ebuild +++ b/dev-libs/rccl/rccl-5.7.1.ebuild @@ -66,7 +66,8 @@ src_configure() { } src_test() { - CHECK_AMDGPU + check_amdgpu + cd "${BUILD_DIR}" || die LD_LIBRARY_PATH="${BUILD_DIR}" edob test/rccl-UnitTests } diff --git a/dev-libs/rccl/rccl-6.1.1.ebuild b/dev-libs/rccl/rccl-6.1.1.ebuild new file mode 100644 index 0000000000000..35783657a50db --- /dev/null +++ b/dev-libs/rccl/rccl-6.1.1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake edo rocm flag-o-matic + +DESCRIPTION="ROCm Communication Collectives Library (RCCL)" +HOMEPAGE="https://github.com/ROCm/rccl" +SRC_URI="https://github.com/ROCm/rccl/archive/rocm-${PV}.tar.gz -> rccl-${PV}.tar.gz" +S="${WORKDIR}/rccl-rocm-${PV}" + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="test" + +RDEPEND=" + =dev-util/hip-6* + dev-util/rocm-smi:${SLOT}" +DEPEND="${RDEPEND} + sys-libs/binutils-libs" +BDEPEND=" + >=dev-build/cmake-3.22 + >=dev-build/rocm-cmake-5.7.1 + dev-util/hipify-clang:${SLOT} + test? ( dev-cpp/gtest )" + +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}/${PN}-6.0.2-fix-version-check.patch" +) + +src_prepare() { + cmake_src_prepare + + # https://reviews.llvm.org/D69582 - clang does not support parallel jobs + sed 's/-parallel-jobs=[0-9][0-9]//g' -i CMakeLists.txt || die + + # https://github.com/ROCm/rccl/issues/958 - fix AMDGPU_TARGETS + sed '/set(AMDGPU_TARGETS/s/ FORCE//' -i CMakeLists.txt || die + + # complete fix-version-check patch + sed "s/@rocm_version@/${PV}/" -i CMakeLists.txt || die +} + +src_configure() { + # https://github.com/llvm/llvm-project/issues/71711 - fix issue of clang + append-ldflags -Wl,-z,noexecstack + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_TESTS=$(usex test ON OFF) + -DROCM_SYMLINK_LIBS=OFF + -Wno-dev + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}" || die + LD_LIBRARY_PATH="${BUILD_DIR}" edob test/rccl-UnitTests +} From a9998187dcd60b4b664dd29a9ebf68143fce5f0d Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 18:05:41 +0000 Subject: [PATCH 20/45] dev-util/Tensile: add 6.1.1 Changes: * fix USE=test dependency for dev-python/joblib (in 5.7.1 and 6.1.1) * ReplacementKernels-cov3 directory does not exist anymore * update expand-isa-compatibility patch to not use removed gcnArch field * update llvm eclass to r1 * add LLVM_COMPAT 18 Signed-off-by: Sv. Lockal --- dev-util/Tensile/Manifest | 1 + dev-util/Tensile/Tensile-5.7.1-r2.ebuild | 1 + dev-util/Tensile/Tensile-6.1.1.ebuild | 136 ++++++++++++++++++ ...nsile-6.0.2-expand-isa-compatibility.patch | 34 +++++ ...Tensile-6.1.1-fix-msgpack-dependency.patch | 31 ++++ 5 files changed, 203 insertions(+) create mode 100644 dev-util/Tensile/Tensile-6.1.1.ebuild create mode 100644 dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch create mode 100644 dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch diff --git a/dev-util/Tensile/Manifest b/dev-util/Tensile/Manifest index 4d93ffa204a1e..fb95e0c702e75 100644 --- a/dev-util/Tensile/Manifest +++ b/dev-util/Tensile/Manifest @@ -2,3 +2,4 @@ DIST Tensile-5.0.2-PR1419.patch.gz 43754 BLAKE2B 3b1d7333ed0115f77816806e7735e25 DIST rocm-Tensile-5.1.3.tar.gz 14357517 BLAKE2B 7c5881cc2b1d25db39f54a99f9f0a08395a5f7a58deebe74d9868e8f7044db5ae2f3907196adf16dc6abeba0f1f47f5cce5c8900891276daff8e4ad614cf3b94 SHA512 4405cb6de65c1da1fd93910fc901402a24e996ff04eccadf483c25d8eb518e03ea9bbf00e372dd5fe377696e71c39355603095f3c5fc1e26d311ed15d8e3b734 DIST rocm-Tensile-5.4.2.tar.gz 14413805 BLAKE2B ca1c13785164439f6fe83f16b36b7a0b06a63b70b9f0741d77b0fff98f38d1e1c7e9a54ef61897e6eb0a4eaf52ec9e5f14f42a7e6fd657f26306afa3de0c74a2 SHA512 d99736a202c7353979e732941199b4b20e53ff2b6c19a7175609440a840aa5624bc53a8013c435f31ac37933527771521ff02137c1c8fd53c5317eca8533be80 DIST rocm-Tensile-5.7.1.tar.gz 12396002 BLAKE2B ec2c2bc3f07fe22abd800b642c998ea80b9e4e2d0d28c4763d574dbd2fcb14c735223ddc7571d4ab3a48f0bd819cc835c16df9882049c5bf56f25ef729e6d654 SHA512 8f356f36cfec74ee9b000d1180cf52077dc5c595e5c5a40792fc3eb13f3139980c7440f9bc912218f946cf8137e2481d23fe39f110511c1bb55fe85a933ffd36 +DIST rocm-Tensile-6.1.1.tar.gz 12675289 BLAKE2B dfe3698d7dda14d5b20a6fe1ef6535ac9737ac330b71678a3a94e939adc2350e2dcf33e58c711ee90dae543efba59fe210bfa39fc69b63910ec4537db3f209bf SHA512 cf8b014b1ff7cd5d45236b8a9a6f5604b02e34a9245a163c672847b535d565151bf7e3a5127601681e80e6fe26964a0e544594044efe2fe68e39b0f1128f96e2 diff --git a/dev-util/Tensile/Tensile-5.7.1-r2.ebuild b/dev-util/Tensile/Tensile-5.7.1-r2.ebuild index 94b4aac75b1ba..64902c86549c2 100644 --- a/dev-util/Tensile/Tensile-5.7.1-r2.ebuild +++ b/dev-util/Tensile/Tensile-5.7.1-r2.ebuild @@ -38,6 +38,7 @@ BDEPEND=" dev-python/pytest-forked[${PYTHON_USEDEP}] dev-python/pytest-xdist[${PYTHON_USEDEP}] dev-python/filelock[${PYTHON_USEDEP}] + dev-python/joblib[${PYTHON_USEDEP}] ) " diff --git a/dev-util/Tensile/Tensile-6.1.1.ebuild b/dev-util/Tensile/Tensile-6.1.1.ebuild new file mode 100644 index 0000000000000..4e3f6da27627d --- /dev/null +++ b/dev-util/Tensile/Tensile-6.1.1.ebuild @@ -0,0 +1,136 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +DISTUTILS_USE_PEP517=setuptools +ROCM_VERSION=${PV} +LLVM_COMPAT=( 17 18 ) + +inherit cmake distutils-r1 llvm-r1 prefix rocm + +DESCRIPTION="Stretching GPU performance for GEMMs and tensor contractions" +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/Tensile" +SRC_URI="https://github.com/ROCmSoftwarePlatform/Tensile/archive/rocm-${PV}.tar.gz -> rocm-Tensile-${PV}.tar.gz" +S="${WORKDIR}/${PN}-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="client test" +REQUIRED_USE="client? ( ${ROCM_REQUIRED_USE} )" + +RESTRICT="!test? ( test )" + +RDEPEND="${PYTHON_DEPS} + client? ( dev-libs/boost ) + >=dev-cpp/msgpack-cxx-6.0.0 + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/msgpack[${PYTHON_USEDEP}] + =dev-util/hip-6* + >=dev-util/rocm-smi-4.3.0 + $(llvm_gen_dep ' + sys-devel/clang:${LLVM_SLOT} + ') +" +DEPEND="${RDEPEND}" +BDEPEND=" + test? ( + dev-python/pytest-forked[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] + dev-python/filelock[${PYTHON_USEDEP}] + dev-python/joblib[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}"/${PN}-4.3.0-output-commands.patch + "${FILESDIR}"/${PN}-5.4.2-fix-arch-parse.patch + "${FILESDIR}"/${PN}-5.4.2-use-ninja.patch + "${FILESDIR}"/${PN}-6.1.1-fix-msgpack-dependency.patch + "${FILESDIR}"/${PN}-6.0.2-expand-isa-compatibility.patch +) + +CMAKE_USE_DIR="${S}/${PN}/Source" + +src_prepare() { + distutils-r1_src_prepare + sed -e "s,\@LLVM_PATH\@,$(get_llvm_prefix),g" \ + "${FILESDIR}"/${PN}-5.7.1-gentoopath.patch > "${S}"/gentoopath.patch || die + eapply $(prefixify_ro "${S}"/gentoopath.patch) + + pushd ${PN} || die + + sed -e "/ROCM_SMI_ROOT/s,lib,$(get_libdir)," \ + -i Source/cmake/FindROCmSMI.cmake || die + sed -r -e "/TENSILE_USE_LLVM/s/ON/OFF/" \ + -i Source/CMakeLists.txt || die + + # ${Tensile_ROOT}/bin does not exists; call command directly + sed -e "s,\${Tensile_ROOT}/bin/,,g" -i cmake/TensileConfig.cmake || die + + local Tensile_share_dir="\"${EPREFIX}/usr/share/${PN}\"" + sed -e "/HipClangVersion/s/0.0.0/$(hipconfig -v)/" -i Common.py || die + + sed -e "s,os.path.dirname(os.path.realpath(__file__)),${Tensile_share_dir},g" \ + -i ReplacementKernels.py Common.py ${PN}.py || die + + sed -e "s|os\.path\.dirname.*$|\"${EPREFIX}/usr/share/Tensile/Source\", end='')|" -i __init__.py || die + + popd || die + + sed -e "/package_data/d" -e "/data_files/d" -i setup.py || die + use client && PATCHES= cmake_src_prepare # do not apply patches again in cmake_src_prepare +} + +src_configure() { + distutils-r1_src_configure + if use client; then + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DTENSILE_USE_MSGPACK=ON + -DTENSILE_USE_LLVM=ON + -DTensile_LIBRARY_FORMAT=msgpack + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + ) + CXX=hipcc cmake_src_configure + fi +} + +src_compile() { + distutils-r1_src_compile + use client && cmake_src_compile +} + +python_install() { + distutils-r1_python_install + + python_moduleinto Tensile + pushd Tensile || die + python_domodule Components + python_newexe Utilities/merge.py ${PN}-merge +} + +src_install() { + distutils-r1_src_install + + pushd ${PN} || die + insinto /usr/share/${PN} + doins -r Configs Perf Source CustomKernels + insinto /usr/$(get_libdir)/cmake/${PN} + doins cmake/*.cmake + + if use client; then + pushd "${BUILD_DIR}" || die + dobin client/tensile_client + fi +} + +# Test suite fails to start without this +python_test() { + export ROCM_PATH="${EPREFIX}/usr" + epytest +} diff --git a/dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch b/dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch new file mode 100644 index 0000000000000..7a72d833bba00 --- /dev/null +++ b/dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch @@ -0,0 +1,34 @@ +diff --git a/Tensile/Source/lib/source/hip/HipHardware.cpp b/Tensile/Source/lib/source/hip/HipHardware.cpp +index ffa4f0f..f894366 100644 +--- a/Tensile/Source/lib/source/hip/HipHardware.cpp ++++ b/Tensile/Source/lib/source/hip/HipHardware.cpp +@@ -24,6 +24,8 @@ + * + *******************************************************************************/ + ++#include ++ + #include + #include + #include +@@ -55,6 +57,20 @@ namespace Tensile + { + hipDeviceProp_t prop; + HIP_CHECK_EXC(hipGetDeviceProperties(&prop, deviceId)); ++ // coerce to compatible arch ++ int gcnArch = strncmp(prop.gcnArchName, "gfx", 3) == 0 ? std::stoi(prop.gcnArchName + 3) : 0; ++ switch(gcnArch) ++ { ++ case 902: case 909: case 912: ++ std::strcpy(prop.gcnArchName, "gfx900"); ++ break; ++ case 1013: ++ std::strcpy(prop.gcnArchName, "gfx1010"); ++ break; ++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036: ++ std::strcpy(prop.gcnArchName, "gfx1030"); ++ break; ++ } + #if HIP_VERSION >= 50220730 + int hip_version; + HIP_CHECK_EXC(hipRuntimeGetVersion(&hip_version)); diff --git a/dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch b/dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch new file mode 100644 index 0000000000000..7a3b1884c074f --- /dev/null +++ b/dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch @@ -0,0 +1,31 @@ +Gentoo uses "msgpack-cxx" as library name and adds important +MSGPACK_NO_BOOST compile definition when msgpack-cxx us installed with USE=-boost +--- a/Tensile/Source/lib/CMakeLists.txt ++++ b/Tensile/Source/lib/CMakeLists.txt +@@ -98,24 +98,9 @@ if(TENSILE_USE_LLVM OR TENSILE_USE_MSGPACK) + endif() + + if(TENSILE_USE_MSGPACK) +- find_package(msgpack REQUIRED NAMES msgpack msgpack-cxx msgpack-c) ++ find_package(msgpack-cxx REQUIRED) + target_compile_definitions(TensileHost PUBLIC -DTENSILE_MSGPACK=1) +- +- if(TARGET msgpackc-cxx) +- get_target_property(msgpack_inc msgpackc-cxx INTERFACE_INCLUDE_DIRECTORIES) +- elseif(TARGET msgpackc) +- get_target_property(msgpack_inc msgpackc INTERFACE_INCLUDE_DIRECTORIES) +- elseif(TARGET msgpack-cxx) +- get_target_property(msgpack_inc msgpack-cxx INTERFACE_INCLUDE_DIRECTORIES) +- endif() +- +- if(DEFINED msgpack_inc) +- # include C++ headers manually +- # External header includes included as system files +- target_include_directories(TensileHost +- SYSTEM PRIVATE $ +- ) +- endif() ++ target_link_libraries(TensileHost PRIVATE msgpack-cxx) + endif() + + if(TENSILE_USE_LLVM) From e30f24214cf70f80e86cceee219809807f2f897b Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Tue, 19 Mar 2024 18:30:55 +0000 Subject: [PATCH 21/45] sci-libs/composable-kernel: add 6.1.1 Changes: * add patch for Clang 17 compatibility (official build uses Clang 18) * add patch for "Could NOT find Git (missing: GIT_EXECUTABLE)" * drop dev-libs/half dependency in all versions (not used) * rename ROCmSoftwarePlatform -> ROCm in URLs Signed-off-by: Sv. Lockal --- sci-libs/composable-kernel/Manifest | 1 + .../composable-kernel-5.7.1-r1.ebuild | 2 +- .../composable-kernel-6.1.1.ebuild | 82 +++++++++++++++++++ ...posable-kernel-6.1.1-enable-examples.patch | 14 ++++ ...ix-clang-17-no-offload-uniform-block.patch | 18 ++++ ...mposable-kernel-6.1.1-no-git-no-hash.patch | 14 ++++ sci-libs/composable-kernel/metadata.xml | 2 +- 7 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild create mode 100644 sci-libs/composable-kernel/files/composable-kernel-6.1.1-enable-examples.patch create mode 100644 sci-libs/composable-kernel/files/composable-kernel-6.1.1-fix-clang-17-no-offload-uniform-block.patch create mode 100644 sci-libs/composable-kernel/files/composable-kernel-6.1.1-no-git-no-hash.patch diff --git a/sci-libs/composable-kernel/Manifest b/sci-libs/composable-kernel/Manifest index 7cb39079ebb9a..9272a772facfc 100644 --- a/sci-libs/composable-kernel/Manifest +++ b/sci-libs/composable-kernel/Manifest @@ -1,2 +1,3 @@ DIST composable-kernel-5.7.1.tar.gz 2158402 BLAKE2B 660c205c2a99cd17f29a9077e9e7b8b88e41f42ab40d92d0a235e7a60683a04234cce6b2eb6110265c2f461dd132c40151b2521b7d64df4cebb7f27094d8b2b0 SHA512 3931c5dbcab59513541103ebf7446311a1e318421a9e12aeafa7a98cf0717a75e1519140e6b2fbcaf4cb90829a11f03a724ff3ccc6636139c61667ac82558c55 +DIST composable-kernel-6.1.1.tar.gz 2520967 BLAKE2B 549d76c5c36b0a273a4c51159abd162403ad035520f97c43dd4b66560ad30021199d2f4cf7e2c12ffe33beee2fb49604db6d7c40b3b33fdcbfde111b9d4833aa SHA512 3f7667cea91760447c3f6ac0bfc261c0bca95abafbfce209d1c889e04f01ec29849e8d7f0e1cb1d77a4309ac06b3c2557721a773e4a67be383de91668cb279b2 DIST gtest-1.14.0_p20220421.tar.gz 849107 BLAKE2B e9c32d9c1d98959583b696430a6be411f5d69e3db96669b16cffc0f1dcad42512391c0a4733f6e829c82953ff33fa243ee782f3cf6e86436f0d290f45d1a3db7 SHA512 967aac7d85da0e216fe13b17d10f894a31d763d9b88201bac7d3dfc37600552b5472d30a166a6ef27f2778677e73fd3e43d082695a48f47824262eb9cd4fcd2f diff --git a/sci-libs/composable-kernel/composable-kernel-5.7.1-r1.ebuild b/sci-libs/composable-kernel/composable-kernel-5.7.1-r1.ebuild index fbaa9356f722a..30016b8dbf79e 100644 --- a/sci-libs/composable-kernel/composable-kernel-5.7.1-r1.ebuild +++ b/sci-libs/composable-kernel/composable-kernel-5.7.1-r1.ebuild @@ -36,7 +36,7 @@ RDEPEND=" DEPEND="${RDEPEND}" -BDEPEND="dev-libs/half:0/1 +BDEPEND=" dev-build/rocm-cmake " diff --git a/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild b/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild new file mode 100644 index 0000000000000..8c096e29135a3 --- /dev/null +++ b/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake flag-o-matic rocm + +GTEST_COMMIT="b85864c64758dec007208e56af933fc3f52044ee" +GTEST_FILE="gtest-1.14.0_p20220421.tar.gz" + +DESCRIPTION="High Performance Composable Kernel for AMD GPUs" +HOMEPAGE="https://github.com/ROCm/composable_kernel" +SRC_URI="https://github.com/ROCm/composable_kernel/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz + test? ( https://github.com/google/googletest/archive/${GTEST_COMMIT}.tar.gz -> ${GTEST_FILE} )" +S="${WORKDIR}/composable_kernel-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="debug test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-util/hip + >=dev-db/sqlite-3.17 + sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] + >=dev-libs/boost-1.72 + dev-cpp/nlohmann_json + dev-cpp/frugally-deep +" + +DEPEND="${RDEPEND}" + +BDEPEND=" + dev-build/rocm-cmake +" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-enable-examples.patch + "${FILESDIR}"/${PN}-6.1.1-fix-clang-17-no-offload-uniform-block.patch + "${FILESDIR}"/${PN}-6.1.1-no-git-no-hash.patch +) + +src_prepare() { + sed -e '/-Werror/d' -i cmake/EnableCompilerWarnings.cmake || die + cmake_src_prepare +} + +src_configure() { + if ! use debug; then + append-cflags "-DNDEBUG" + append-cxxflags "-DNDEBUG" + CMAKE_BUILD_TYPE="Release" + else + CMAKE_BUILD_TYPE="Debug" + fi + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DBUILD_DEV=OFF + -DGPU_TARGETS="$(get_amdgpu_flags)" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DBUILD_TESTING=$(usex test ON OFF) + ) + + if use test; then + mycmakeargs+=( + -DGOOGLETEST_DIR="${WORKDIR}/googletest-${GTEST_COMMIT}" + ) + fi + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + LD_LIBRARY_PATH="${BUILD_DIR}"/lib cmake_src_test -j1 +} diff --git a/sci-libs/composable-kernel/files/composable-kernel-6.1.1-enable-examples.patch b/sci-libs/composable-kernel/files/composable-kernel-6.1.1-enable-examples.patch new file mode 100644 index 0000000000000..bedc79c562bd7 --- /dev/null +++ b/sci-libs/composable-kernel/files/composable-kernel-6.1.1-enable-examples.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -470,7 +470,10 @@ if(NOT DEFINED INSTANCES_ONLY) + LIBRARY_NAME composablekernel + PACKAGE_NAME examples + ) +- add_subdirectory(example) ++ option(BUILD_EXAMPLES "Build examples" OFF) ++ if(BUILD_EXAMPLES) ++ add_subdirectory(example) ++ endif() + if(BUILD_TESTING) + add_subdirectory(test) + endif() diff --git a/sci-libs/composable-kernel/files/composable-kernel-6.1.1-fix-clang-17-no-offload-uniform-block.patch b/sci-libs/composable-kernel/files/composable-kernel-6.1.1-fix-clang-17-no-offload-uniform-block.patch new file mode 100644 index 0000000000000..3a102bec49cd0 --- /dev/null +++ b/sci-libs/composable-kernel/files/composable-kernel-6.1.1-fix-clang-17-no-offload-uniform-block.patch @@ -0,0 +1,18 @@ +`-fno-offload-uniform-block` flag was added in Clang 18; do not use it if hipcc uses Clang 17 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,11 +144,9 @@ else() + message("Building CK for the following targets: ${AMDGPU_TARGETS}") + endif() + find_package(hip) +-# No assumption that HIP kernels are launched with uniform block size for backward compatibility +-# SWDEV-413293 and https://reviews.llvm.org/D155213 +-math(EXPR hip_VERSION_FLAT "(${hip_VERSION_MAJOR} * 1000 + ${hip_VERSION_MINOR}) * 100000 + ${hip_VERSION_PATCH}") +-message("hip_version_flat=${hip_VERSION_FLAT}") +-if(NOT WIN32 AND ${hip_VERSION_FLAT} GREATER 500723302) ++ ++check_cxx_compiler_flag("-x hip -fno-offload-uniform-block" COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK) ++if(COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK) + message("Adding the fno-offload-uniform-block compiler flag") + add_compile_options(-fno-offload-uniform-block) + endif() diff --git a/sci-libs/composable-kernel/files/composable-kernel-6.1.1-no-git-no-hash.patch b/sci-libs/composable-kernel/files/composable-kernel-6.1.1-no-git-no-hash.patch new file mode 100644 index 0000000000000..6c6b161b1a14b --- /dev/null +++ b/sci-libs/composable-kernel/files/composable-kernel-6.1.1-no-git-no-hash.patch @@ -0,0 +1,14 @@ +Fix "Could NOT find Git (missing: GIT_EXECUTABLE)", git is not needed for releases +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,9 +84,7 @@ include(getopt) + # CK config file to record supported datatypes, etc. + configure_file(include/ck/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/ck/config.h) + +-# CK version file to record release version as well as git commit hash +-find_package(Git REQUIRED) +-execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD OUTPUT_VARIABLE COMMIT_ID OUTPUT_STRIP_TRAILING_WHITESPACE) ++# CK version file to record release version + configure_file(include/ck/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/ck/version.h) + + set(ROCM_SYMLINK_LIBS OFF) diff --git a/sci-libs/composable-kernel/metadata.xml b/sci-libs/composable-kernel/metadata.xml index 9236dd2846d73..afd22272458c4 100644 --- a/sci-libs/composable-kernel/metadata.xml +++ b/sci-libs/composable-kernel/metadata.xml @@ -10,6 +10,6 @@ Science Project - ROCmSoftwarePlatform/composable_kernel + ROCm/composable_kernel From 4b731940c44212d92a744c1b38d6935494ae9719 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 17 Mar 2024 18:18:10 +0000 Subject: [PATCH 22/45] dev-util/roctracer: add 6.1.1 Other changes: * Add myself as maintainer Signed-off-by: Sv. Lockal --- dev-util/roctracer/Manifest | 1 + dev-util/roctracer/metadata.xml | 6 +- dev-util/roctracer/roctracer-6.1.1.ebuild | 87 +++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 dev-util/roctracer/roctracer-6.1.1.ebuild diff --git a/dev-util/roctracer/Manifest b/dev-util/roctracer/Manifest index 48927e0649b53..60f2f32705d58 100644 --- a/dev-util/roctracer/Manifest +++ b/dev-util/roctracer/Manifest @@ -3,3 +3,4 @@ DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7f DIST rocm-tracer-5.3.3.tar.gz 353041 BLAKE2B b7614707ae3af2f5a46d058dacadfb0ef3b980963ac49face66a80c8396e66cf13e0430ab41737ba15e163f5da03697376b13238ea1decfe7ee4a7f31c7664a5 SHA512 95a202f76f6b68a35942750233bd09d372a9be843150d7ec02824da13c6b9a7c8da7a752ac69f66776e7ccfb6176473745dc46a7baadfe77c99c0596fbc2ffeb DIST rocprofiler-5.1.3.tar.gz 1402172 BLAKE2B 16e9b127ede94a3f96056e84a2942b6c9f3aec90579fb12796ab8ba385160aa020e3dc77f7a475dadbc0a813a823ae733ca9560f6a09e55c4c82b13dd792dfa4 SHA512 6e9932a425eaaa2a1e1741280d7525c6360700f85edb3bcf4967fe9be4fed662bae0d2ba609701f0d9733769c340e93e32076024b27bab3303449c1d68d9e1ce DIST roctracer-5.7.1.tar.gz 354686 BLAKE2B 2e72d8df5cf53a913102a715dab55f7c6d33b2d4a9cad7647a61824deba0363cf3dbf96d8de3469a78d6b5c8e517c163c303bf6aa12eeaf8e43f82ac8381ef97 SHA512 62cf62fc505955426596bd6d539c92f4d730d90d820d817343525f1b7be693290727c8c447ca98b1a0e46d1d188b62b3f4fafcf6bffbf2479fc5d937fb354e13 +DIST roctracer-6.1.1.tar.gz 396688 BLAKE2B e332c3a6056d1678e3da511878fd2710a4eaa02526cd1e7353dd1dbcba776cb77e6e431d90daf5f238ec7793fc8e9f51afd7f09992f70b26c7e3aab28bb319a9 SHA512 d59c367953b1d5df0daae96746095e2e19f706f43b5ebed3d45c15d23697e9c99c1623bbb8dfa001648fdeda172a3c1d820d884b6da3946addec8f4b9a86e5dc diff --git a/dev-util/roctracer/metadata.xml b/dev-util/roctracer/metadata.xml index 872a2a3bdb225..a7f7157360b09 100644 --- a/dev-util/roctracer/metadata.xml +++ b/dev-util/roctracer/metadata.xml @@ -13,7 +13,11 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCm-Developer-Tools/roctracer + ROCm/roctracer diff --git a/dev-util/roctracer/roctracer-6.1.1.ebuild b/dev-util/roctracer/roctracer-6.1.1.ebuild new file mode 100644 index 0000000000000..69473b45deef5 --- /dev/null +++ b/dev-util/roctracer/roctracer-6.1.1.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +LLVM_MAX_SLOT=17 +ROCM_VERSION=${PV} + +inherit cmake prefix python-any-r1 rocm llvm + +DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's" +HOMEPAGE="https://github.com/ROCm/roctracer" +SRC_URI="https://github.com/ROCm/roctracer/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/roctracer-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-libs/rocr-runtime + dev-util/hip" +DEPEND="${RDEPEND}" +BDEPEND=" + $(python_gen_any_dep ' + dev-python/CppHeaderParser[${PYTHON_USEDEP}] + dev-python/ply[${PYTHON_USEDEP}] + ') +" + +PATCHES=( + "${FILESDIR}"/roctracer-5.7.1-with-tests.patch +) + +python_check_deps() { + python_has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]" \ + "dev-python/ply[${PYTHON_USEDEP}]" +} + +src_prepare() { + cmake_src_prepare + + hprefixify script/*.py + eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.3.3-rocm-path.patch) + + # Install libs directly into /usr/lib64 + sed -e 's:${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}:${CMAKE_INSTALL_LIBDIR}:g' \ + -i src/CMakeLists.txt plugin/file/CMakeLists.txt || die + + # Remove all install commands for tests + sed -E '/^ *install\(.+/d' -i test/CMakeLists.txt || die + + # Fix search path for HIP cmake + sed -e "s,\${ROCM_PATH}/lib/cmake,/usr/$(get_libdir)/cmake,g" -i test/CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake/hip" + -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DWITH_TESTS=$(usex test) + ) + use test && mycmakeargs+=( + -DCMAKE_FIND_DEBUG_MODE=ON + -DHIP_ROOT_DIR="${EPREFIX}/usr" + -DHIP_CLANG_INSTALL_DIR="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin" + -DGPU_TARGETS="$(get_amdgpu_flags)" + ) + + cmake_src_configure +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}" || die + # if LD_LIBRARY_PATH not set, dlopen cannot find correct lib + LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" bash run.sh || die +} + +src_install() { + cmake_src_install + + # remove unneeded copy + rm -r "${ED}/usr/share/doc/${PF}-asan" || die +} From 75568f5eb2250cf8ea3542af8dcc46021259f21e Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 12:25:21 +0000 Subject: [PATCH 23/45] sci-libs/rocPRIM: add 6.1.1 Changes: * Dropped most of sed calls, not needed anymore * Device access is not needed to configure * Added myself as a maintainer Signed-off-by: Sv. Lockal --- sci-libs/rocPRIM/Manifest | 1 + sci-libs/rocPRIM/metadata.xml | 12 ++++-- sci-libs/rocPRIM/rocPRIM-6.1.1.ebuild | 61 +++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 sci-libs/rocPRIM/rocPRIM-6.1.1.ebuild diff --git a/sci-libs/rocPRIM/Manifest b/sci-libs/rocPRIM/Manifest index f23f73c594666..cf2bbede484f7 100644 --- a/sci-libs/rocPRIM/Manifest +++ b/sci-libs/rocPRIM/Manifest @@ -1,2 +1,3 @@ DIST rocPRIM-5.1.3.tar.gz 374510 BLAKE2B ab6960e7bd2159ac7a0d72ba6d594684f8d47028eca0940eabd35b346ac3d432a734ec575ee71341f339a9d0dead10dfafe81fb651a3b7da681aa900a5132d0e SHA512 54e14f2b40795153b862a64c9b3d336f35feccfda725daad75fae356b0147c577735884b65218c26c370ebec710af0f84aeef3103067a50db077cf9e24d2b64a DIST rocPRIM-5.7.1.tar.gz 535649 BLAKE2B 469bf59b5c92c37df96f58bac5a6559dc2cb879e5f82e539881d79bda57d23c25a9b114466042258e87862a88cd53d260155d7785c9a69a1800b0d05e931f56d SHA512 b2f0bc07dbc5cd111dd513f6c05dbc533908c52ea99caf77d6a4dd35db2b28f98c80006bd1f50a232873eab00b70e54231c38bfd1035c8845029d53690fd5e71 +DIST rocPRIM-6.1.1.tar.gz 611372 BLAKE2B 984df214179a6d2c90b31bd30ec9472a0b985d9d488ea195968f25df4cac97ce48bfa4c322f2d578771ac63caeafc2c69c9dae911bc3a9d920ab9558ba7d6e15 SHA512 298eebc8a5d3fd7da71ab98a22fd39183436b3d9e14945e450f0fb35e38ea8fb99c5f2b342f1f77f21899a14d506ce96a965fbdb24f106ec9638dcd6afe6ae98 diff --git a/sci-libs/rocPRIM/metadata.xml b/sci-libs/rocPRIM/metadata.xml index 6d29bd1f89012..b98edd6a4e2b5 100644 --- a/sci-libs/rocPRIM/metadata.xml +++ b/sci-libs/rocPRIM/metadata.xml @@ -9,10 +9,14 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/rocPRIM + ROCm/rocPRIM - - Build and install benchmark programs. - + + Build and install benchmark programs. + diff --git a/sci-libs/rocPRIM/rocPRIM-6.1.1.ebuild b/sci-libs/rocPRIM/rocPRIM-6.1.1.ebuild new file mode 100644 index 0000000000000..cd85f27b65004 --- /dev/null +++ b/sci-libs/rocPRIM/rocPRIM-6.1.1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} +inherit cmake rocm + +DESCRIPTION="HIP parallel primitives for developing performant GPU-accelerated code on ROCm" +HOMEPAGE="https://github.com/ROCm/rocPRIM" +SRC_URI="https://github.com/ROCm/rocPRIM/archive/rocm-${PV}.tar.gz -> rocPRIM-${PV}.tar.gz" +S="${WORKDIR}/rocPRIM-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="benchmark test" +REQUIRED_USE=" + benchmark? ( ${ROCM_REQUIRED_USE} ) + test? ( ${ROCM_REQUIRED_USE} ) +" + +RDEPEND="dev-util/hip + benchmark? ( dev-cpp/benchmark ) + test? ( dev-cpp/gtest )" +BDEPEND="dev-build/rocm-cmake + >=dev-build/cmake-3.22" +DEPEND="${RDEPEND}" + +RESTRICT="!test? ( test )" + +PATCHES=( "${FILESDIR}"/${PN}-5.7.1-expand-isa-compatibility.patch ) + +src_prepare() { + # install benchmark files + if use benchmark; then + sed -e "/get_filename_component/s,\${BENCHMARK_SOURCE},${PN}_\${BENCHMARK_SOURCE}," \ + -e "/add_executable/a\ install(TARGETS \${BENCHMARK_TARGET})" -i benchmark/CMakeLists.txt || die + fi + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_TEST=$(usex test ON OFF) + -DBUILD_BENCHMARK=$(usex benchmark ON OFF) + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + # uses HMM to fit tests to default <512M iGPU VRAM + ROCPRIM_USE_HMM="1" cmake_src_test -j1 +} From 5a9b3bebd9d05de850f41b42b972d33ca5710533 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 15:12:09 +0000 Subject: [PATCH 24/45] sci-libs/rocSPARSE: add 6.1.1 Also add myself as a maintainer Signed-off-by: Sv. Lockal --- sci-libs/rocSPARSE/Manifest | 1 + sci-libs/rocSPARSE/metadata.xml | 12 ++- sci-libs/rocSPARSE/rocSPARSE-6.1.1.ebuild | 125 ++++++++++++++++++++++ 3 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 sci-libs/rocSPARSE/rocSPARSE-6.1.1.ebuild diff --git a/sci-libs/rocSPARSE/Manifest b/sci-libs/rocSPARSE/Manifest index 793510341e5cf..ad5d2e4c12ad0 100644 --- a/sci-libs/rocSPARSE/Manifest +++ b/sci-libs/rocSPARSE/Manifest @@ -1,5 +1,6 @@ DIST rocSPARSE-5.1.3.tar.gz 943788 BLAKE2B f9d5fc34d74bc10f3e5bd0a18da41fe9b35a2f01aca3a74979960958fd0e7648fca96493ba9d767119a452dd75ede0733959d0d4bae84615b7a1ff212c8412a3 SHA512 735aa210bbdc3f31b0ed4defe0288606e255788e877f24ed25506d780552a779305fe5bfd692a3e720e9b286073894300fcbcf161d41e1b23abf2110a9536bf3 DIST rocSPARSE-5.7.1.tar.gz 1167162 BLAKE2B 20ed88c87afbb041a31aa8bf867dca7ee670af093347c9c6a68b0750e70c796e7cfd599f84a58de2b8038f7681524bcb5909230fc340d1575dae3b72089ec650 SHA512 cd48884c51fcddcb26c42920cf477999160b3f06da4ab182f746a18d1fe54f697d89b1e470c550bd2330b26fb596d4a5baadf64366145e0d07f3fd8891f9af59 +DIST rocSPARSE-6.1.1.tar.gz 1367035 BLAKE2B fc981df5913ea527bb4a7d3eba69373ebc7b74319f387e9f42a94feb1ec029ecca15618ea2d5ff7a91cb6e8959f164ab4be57755ee17db5f155f3b0e373cc487 SHA512 f87bd724b92fdb35e1c70cafcf09d95ab65f514bacfe1c59c5f0a2a75a8bae7a7dca2ee093ecd2e05adf542cc00165c0f8bf0a67e98013e2c4c72145ba951db2 DIST rocSPARSE_ASIC_320k.tar.gz 11301444 BLAKE2B a00cc4a3ededab3fb56339319e34e936645ddce2dee3c630153b37e337384c207b0a2829227fb7f4c2db1fe33383e97410ab7ad459d391c025f5410843d51cf2 SHA512 1db3af391c30a371c1ac0087436e266721474273a39d5b2b6d56408d950dcbbee004750e4dce4e3dbc4cb512f38f6d945676d7f29b62c52fd5a7fed0fe789e03 DIST rocSPARSE_Chebyshev4.tar.gz 50165660 BLAKE2B f1a95554c8f38937f501488fabfd406b773eb980d7463cadac0de162529ac2f834c655cadd2b65f4c42a8487bc2d67c749601ae33bd789051f9e4d1e157196a0 SHA512 fdec4947a4af923d28b4be8d23690fd6d356c58f8344a5dcdd2e3fa61769d83e47a84d65316b527e6e82d9f988de2675a852367d406e44b44d784137a90b95c0 DIST rocSPARSE_Chevron2.tar.gz 3210636 BLAKE2B 919bc19931cbcb32c09e6b623c9d3890400895dfd65e83845d351a8e3dd8b30ef43374c3c0ca3ee9708c81b5fb8886f1a4adbea6086495f08f9498f19a2279d5 SHA512 22b71deddec4f1af5b239d4065089230cf70e521102803a77ab3f16b34a0d69534817e54d81dfa7f8d1f299932c0f0424237baeb3d8289bcfffa4b902b00e256 diff --git a/sci-libs/rocSPARSE/metadata.xml b/sci-libs/rocSPARSE/metadata.xml index f4e399df67a83..0cc6b903bb243 100644 --- a/sci-libs/rocSPARSE/metadata.xml +++ b/sci-libs/rocSPARSE/metadata.xml @@ -9,10 +9,14 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/rocSPARSE + ROCm/rocSPARSE - - Build and install rocblas-bench. - + + Build and install rocblas-bench. + diff --git a/sci-libs/rocSPARSE/rocSPARSE-6.1.1.ebuild b/sci-libs/rocSPARSE/rocSPARSE-6.1.1.ebuild new file mode 100644 index 0000000000000..093273002e65b --- /dev/null +++ b/sci-libs/rocSPARSE/rocSPARSE-6.1.1.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +ROCM_VERSION=${PV} + +inherit cmake edo python-any-r1 toolchain-funcs rocm + +DESCRIPTION="Basic Linear Algebra Subroutines for sparse computation" +HOMEPAGE="https://github.com/ROCm/rocSPARSE" + +SRC_URI="https://github.com/ROCm/rocSPARSE/archive/rocm-${PV}.tar.gz -> rocSPARSE-${PV}.tar.gz +test? ( +https://sparse.tamu.edu/MM/SNAP/amazon0312.tar.gz -> ${PN}_amazon0312.tar.gz +https://sparse.tamu.edu/MM/Muite/Chebyshev4.tar.gz -> ${PN}_Chebyshev4.tar.gz +https://sparse.tamu.edu/MM/FEMLAB/sme3Dc.tar.gz -> ${PN}_sme3Dc.tar.gz +https://sparse.tamu.edu/MM/Williams/webbase-1M.tar.gz -> ${PN}_webbase-1M.tar.gz +https://sparse.tamu.edu/MM/Bova/rma10.tar.gz -> ${PN}_rma10.tar.gz +https://sparse.tamu.edu/MM/JGD_BIBD/bibd_22_8.tar.gz -> ${PN}_bibd_22_8.tar.gz +https://sparse.tamu.edu/MM/Williams/mac_econ_fwd500.tar.gz -> ${PN}_mac_econ_fwd500.tar.gz +https://sparse.tamu.edu/MM/Williams/mc2depi.tar.gz -> ${PN}_mc2depi.tar.gz +https://sparse.tamu.edu/MM/Hamm/scircuit.tar.gz -> ${PN}_scircuit.tar.gz +https://sparse.tamu.edu/MM/Sandia/ASIC_320k.tar.gz -> ${PN}_ASIC_320k.tar.gz +https://sparse.tamu.edu/MM/GHS_psdef/bmwcra_1.tar.gz -> ${PN}_bmwcra_1.tar.gz +https://sparse.tamu.edu/MM/HB/nos1.tar.gz -> ${PN}_nos1.tar.gz +https://sparse.tamu.edu/MM/HB/nos2.tar.gz -> ${PN}_nos2.tar.gz +https://sparse.tamu.edu/MM/HB/nos3.tar.gz -> ${PN}_nos3.tar.gz +https://sparse.tamu.edu/MM/HB/nos4.tar.gz -> ${PN}_nos4.tar.gz +https://sparse.tamu.edu/MM/HB/nos5.tar.gz -> ${PN}_nos5.tar.gz +https://sparse.tamu.edu/MM/HB/nos6.tar.gz -> ${PN}_nos6.tar.gz +https://sparse.tamu.edu/MM/HB/nos7.tar.gz -> ${PN}_nos7.tar.gz +https://sparse.tamu.edu/MM/DNVS/shipsec1.tar.gz -> ${PN}_shipsec1.tar.gz +https://sparse.tamu.edu/MM/Cote/mplate.tar.gz -> ${PN}_mplate.tar.gz +https://sparse.tamu.edu/MM/Bai/qc2534.tar.gz -> ${PN}_qc2534.tar.gz +https://sparse.tamu.edu/MM/Chevron/Chevron2.tar.gz -> ${PN}_Chevron2.tar.gz +https://sparse.tamu.edu/MM/Chevron/Chevron3.tar.gz -> ${PN}_Chevron3.tar.gz +https://sparse.tamu.edu/MM/Chevron/Chevron4.tar.gz -> ${PN}_Chevron4.tar.gz +)" + +S="${WORKDIR}/rocSPARSE-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="benchmark test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +RDEPEND="=dev-util/hip-6* + sci-libs/rocPRIM:${SLOT}" +DEPEND="${RDEPEND}" +BDEPEND="test? ( + dev-cpp/gtest + >=dev-build/cmake-3.22 + $(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]') +) +" + +RESTRICT="!test? ( test )" + +python_check_deps() { + if use test; then + python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]" + fi +} + +src_prepare() { + # use python interpreter specifyied by python-any-r1 + sed -e "s/\${python}/${EPYTHON}/" \ + -i clients/tests/CMakeLists.txt || die + + cmake_src_prepare + + # Test need download data from https://sparse.tamu.edu (or other mirror site), check MD5, + # unpack and convert them into csr format + # This process is handled default by ${S}/cmake/ClientMatrices.cmake, but should be the responsibility of portage. + if use test; then + mkdir -p "${BUILD_DIR}"/clients/matrices + # compile and use the mtx2csr converter. Do not use any optimization flags, because it causes error! + edo $(tc-getCXX) deps/convert.cpp -o deps/convert + find "${WORKDIR}" -maxdepth 2 -regextype egrep -regex ".*/(.*)/\1\.mtx" -print0 | + while IFS= read -r -d '' mtxfile; do + destination=${BUILD_DIR}/clients/matrices/$(basename -s '.mtx' ${mtxfile}).csr + ebegin "Converting ${mtxfile} to ${destination}" + deps/convert ${mtxfile} ${destination} + eend $? + done + fi +} + +src_configure() { + addpredict /dev/kfd + addpredict /dev/dri/ + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_CLIENTS_SAMPLES=OFF + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DCMAKE_INSTALL_INCLUDEDIR="include/rocsparse" + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}/clients/staging" || die + LD_LIBRARY_PATH="${BUILD_DIR}/library" edob ./${PN,,}-test +} + +src_install() { + cmake_src_install + + # rm unwanted copy + rm -rf "${ED}/usr/rocsparse" || die + + if use benchmark; then + cd "${BUILD_DIR}" || die + dobin clients/staging/rocsparse-bench + fi +} From 75aa990f6ba3e3f1cbc8a76f4acae05040e65546 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 15:47:57 +0000 Subject: [PATCH 25/45] sci-libs/rocSOLVER: add 6.1.1 Signed-off-by: Sv. Lockal --- sci-libs/rocSOLVER/Manifest | 1 + sci-libs/rocSOLVER/metadata.xml | 14 +++-- sci-libs/rocSOLVER/rocSOLVER-6.1.1.ebuild | 62 +++++++++++++++++++++++ 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 sci-libs/rocSOLVER/rocSOLVER-6.1.1.ebuild diff --git a/sci-libs/rocSOLVER/Manifest b/sci-libs/rocSOLVER/Manifest index 99692f4836437..bdd119767929f 100644 --- a/sci-libs/rocSOLVER/Manifest +++ b/sci-libs/rocSOLVER/Manifest @@ -1,3 +1,4 @@ DIST rocSOLVER-5.1.3.tar.gz 545627 BLAKE2B 2cca24a1310efba7f8c66d1614fb50704221ebc8aa50d6aba11083baf9a7427575642fd28218ce80f8a7b83d3406348c2dd18373fb32e533509d01d37cf06927 SHA512 38e7a4ed6b67e83960ad3416d1008f82f895d19dc85427cd6f9c76f00b1ce18f78a4dd73d1ab53ffe81588890cd5545315029e903e2e09b85d6cfb854d405753 DIST rocSOLVER-5.4.2.tar.gz 674866 BLAKE2B 0628353d567da92e3f7c3a11e19859329f3ea916184d554ee9c7172084ee4698c93408f397f493331d4dc47d833c56ead41bb4445081ba9ac73809ca0478770c SHA512 b3a60c65a18c3864568e1e0b1524850eb1b322f6005cf8a2763c9b457e43e03c8ce74be1d13f3cc3adef1f6ac979f54fb903831f4a60447a9a915a40dcbe5ff6 DIST rocSOLVER-5.7.1.tar.gz 1859403 BLAKE2B f7a40494deda9dd66f2fb2f57e13665688e89e1f82733701ec60a520bc4b9f7d5899ada618a37e73baa3a910757be4f11d5fced5d4d2ad82c56918b34d265511 SHA512 78e0a2b5b069378696afebf5e3e023449b3d7705aa79099eb7721c142d7525255825b41bf413324c33178091315e3909980a1bf0cbb66e0891c85e757858ee1c +DIST rocSOLVER-6.1.1.tar.gz 2971118 BLAKE2B 2611b6b65704e7cd64df682728013f07d20c6e17e6729cec7befb91dbed57aabaaed2887a252d4ae610fe0bcb336dfcd4b98d63c107694c22e35be06d06363db SHA512 a96901226cbe5b410fa2885023a080b5ca7dc4659be92b363c37e10eba97d3da09d97488ecdc040452a535ad3284017c64b3b68646f258655583302baa009f34 diff --git a/sci-libs/rocSOLVER/metadata.xml b/sci-libs/rocSOLVER/metadata.xml index da8fc11173b12..97b4749ddd6d4 100644 --- a/sci-libs/rocSOLVER/metadata.xml +++ b/sci-libs/rocSOLVER/metadata.xml @@ -12,11 +12,15 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/rocSOLVER + ROCm/rocSOLVER - - Perform rocsolver-test to compare the result between rocSOLVER and system LAPACK. - Build and install rocsolver-bench. - + + Perform rocsolver-test to compare the result between rocSOLVER and system LAPACK. + Build and install rocsolver-bench. + diff --git a/sci-libs/rocSOLVER/rocSOLVER-6.1.1.ebuild b/sci-libs/rocSOLVER/rocSOLVER-6.1.1.ebuild new file mode 100644 index 0000000000000..4fe2bbbdaca1b --- /dev/null +++ b/sci-libs/rocSOLVER/rocSOLVER-6.1.1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake edo rocm + +DESCRIPTION="Implementation of a subset of LAPACK functionality on the ROCm platform" +HOMEPAGE="https://github.com/ROCm/rocSOLVER" +SRC_URI="https://github.com/ROCm/rocSOLVER/archive/rocm-${PV}.tar.gz -> rocSOLVER-${PV}.tar.gz" +S=${WORKDIR}/${PN}-rocm-${PV} + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="test benchmark" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +RDEPEND="dev-util/hip + sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] + sci-libs/rocSPARSE:${SLOT}[${ROCM_USEDEP}] + dev-libs/libfmt + benchmark? ( virtual/blas )" +DEPEND="${RDEPEND}" +BDEPEND="test? ( dev-cpp/gtest + >=dev-build/cmake-3.22 + virtual/blas )" + +RESTRICT="!test? ( test )" + +src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -Wno-dev + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_CLIENTS_SAMPLES=NO + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}"/clients/staging || die + LD_LIBRARY_PATH="${BUILD_DIR}/library/src" edob ./rocsolver-test +} + +src_install() { + cmake_src_install + + if use benchmark; then + cd "${BUILD_DIR}" || die + dobin clients/staging/rocsolver-bench + fi +} From 78e1d01266599947ece844a6c0f3237ef8256093 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 16:37:22 +0000 Subject: [PATCH 26/45] sci-libs/rocRAND: add 6.1.1 Signed-off-by: Sv. Lockal --- sci-libs/rocRAND/Manifest | 1 + sci-libs/rocRAND/metadata.xml | 12 ++++-- sci-libs/rocRAND/rocRAND-6.1.1.ebuild | 62 +++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 sci-libs/rocRAND/rocRAND-6.1.1.ebuild diff --git a/sci-libs/rocRAND/Manifest b/sci-libs/rocRAND/Manifest index 9c1124f37a034..81980f21cb0e3 100644 --- a/sci-libs/rocRAND/Manifest +++ b/sci-libs/rocRAND/Manifest @@ -2,3 +2,4 @@ DIST hipRAND-de941a7eb9ede2a862d719cd3ca23234a3692d07.tar.gz 80820 BLAKE2B f2894 DIST rocRAND-5.1.3.tar.gz 11729425 BLAKE2B f61aaedb7b72ceba3868a2069c93db1e2cd88a7a0188a9d5a33f520af3b42235c0dca62495460fd5e7abbca5fe7acc01acfdc90e53ae9a6e45128df5da472f49 SHA512 12859e52b79e40fcd1fb97d0915c191bbbc24e31e00aac4dbeecb625f9978a00ece3d7a42d0f9d37516031c1fbeb66e14dcd476ea83fe32fb13e0dd5c3964a28 DIST rocRAND-5.6.0.tar.gz 23189913 BLAKE2B 2418a90c323f483d1f92630df7134bc060b9052f580259924e79680a7ec37857574973dda69dc3c28fdd5b88a5fc1d29757ed637fcde0730c53b9a5f09668aba SHA512 cccd26a6b80a7705644803a85dad3a43de3f4e2f73f964f2b5aa410f71d3782b68d6cc1ad60b7f7be5193a94098ed3fa25cad30c3acbc141522cdd738d3328a5 DIST rocRAND-5.7.1.tar.gz 23189653 BLAKE2B c70ab6f3b718c2430394f63b93bee15fa72daae704883fdb203b98b0dc4763b46bc27886af64c48bf4ebe8da9b919158b8cd346f70f9b76bf0492ce3b2c1e20e SHA512 4d74bce9fbd3cb45e3f057d38df747270c6986fea7ad524f7a88109b6a53a4ea5dcd60d4bbf2364888501e9444245fb6898bb79fccad0e37b61e819e8c4ed863 +DIST rocRAND-6.1.1.tar.gz 26683143 BLAKE2B 4108584c6372adbf2f9ef887cf1aa08f5afdfa489ba0739d247e693628f3e23978fe023c2896e7bff666b8822b0011fd3f635338b013898f8d76b3f31ec21f6c SHA512 d8df0e6bf843719e59434c952ef56b112ada23d0c226bec9f2974ed762500202ac809f495de61a4086289e35c2f4b670f4ed7dcd7092a158c0a731c368950a44 diff --git a/sci-libs/rocRAND/metadata.xml b/sci-libs/rocRAND/metadata.xml index 4add606d2dbed..1c9d7fffbee65 100644 --- a/sci-libs/rocRAND/metadata.xml +++ b/sci-libs/rocRAND/metadata.xml @@ -9,10 +9,14 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/rocRAND + ROCm/rocRAND - - Build and install benchmark programs. - + + Build and install benchmark programs. + diff --git a/sci-libs/rocRAND/rocRAND-6.1.1.ebuild b/sci-libs/rocRAND/rocRAND-6.1.1.ebuild new file mode 100644 index 0000000000000..1cfbcdbd04f3e --- /dev/null +++ b/sci-libs/rocRAND/rocRAND-6.1.1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="Generate pseudo-random and quasi-random numbers" +HOMEPAGE="https://github.com/ROCm/rocRAND" +SRC_URI="https://github.com/ROCm/${PN}/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/rocRAND-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="benchmark test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-5.7.1_fix_generator_alignment.patch +) + +RDEPEND="dev-util/hip" +DEPEND="${RDEPEND} + dev-build/rocm-cmake + benchmark? ( dev-cpp/benchmark ) + test? ( dev-cpp/gtest )" +BDEPEND="dev-build/rocm-cmake + >=dev-build/cmake-3.22" + +src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_TEST=$(usex test ON OFF) + -DBUILD_BENCHMARK=$(usex benchmark ON OFF) + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + export LD_LIBRARY_PATH="${BUILD_DIR}/library" + # uses HMM to fit tests to default <512M iGPU VRAM + ROCRAND_USE_HMM="1" cmake_src_test -j1 +} + +src_install() { + cmake_src_install + + if use benchmark; then + cd "${BUILD_DIR}"/benchmark + dobin benchmark_rocrand_* + fi +} From 4b089d4d3cb5a801da385d8ee910fcfd4aaee0ee Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 16:54:36 +0000 Subject: [PATCH 27/45] sci-libs/rocThrust: add 6.1.1 Signed-off-by: Sv. Lockal --- sci-libs/rocThrust/Manifest | 1 + sci-libs/rocThrust/metadata.xml | 14 ++++-- sci-libs/rocThrust/rocThrust-6.1.1.ebuild | 56 +++++++++++++++++++++++ 3 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 sci-libs/rocThrust/rocThrust-6.1.1.ebuild diff --git a/sci-libs/rocThrust/Manifest b/sci-libs/rocThrust/Manifest index 5c109bf5006a6..3916366accb89 100644 --- a/sci-libs/rocThrust/Manifest +++ b/sci-libs/rocThrust/Manifest @@ -1,2 +1,3 @@ DIST rocThrust-5.1.3.tar.gz 1186518 BLAKE2B 2defe71247915940917438d4f0d0a811dca7de39e5168248968fa9c165b81d94b0e20f3df9b84db1fbdcd2eb87942dec5d3adbbe1a699eb51eeb4e1b2f0a88d0 SHA512 189c70343a410cf3f3c1589ef24c68a38b5270d8780d15261a124b8250f279a3c3c7afef38e6310d57cb1741b3ee75f0b4ac0bb9dfcf4a4fb0e7e6c0516faf74 DIST rocThrust-5.7.1.tar.gz 1122808 BLAKE2B 41a5d57d03c7f95baf861b772c9513c7fbc26eee8a2f388897eb9b9f9fad3cdad81e2a79932c5b9a6d88b4e1596bf64e59e01337943a036ddb792f7b352ecd31 SHA512 52a9640808f0ed78ae2d6f25e741af59ae4e977535a0431f16c0fa1ee9a395e6f389cf29e61c02ac274cf16fcd193e5df6fb2edc340059ab282ed7cd877fc8b4 +DIST rocThrust-6.1.1.tar.gz 1147635 BLAKE2B e71288a4666ba1f23cf85d2d269f61f9085efaeb2921b7f3142c5ce0808380b27a8c07945a44b6a651747046020b412838a667232b1ba65308fd7fd336b840b4 SHA512 30eeb6df73ee0dc2361879337faae09cf19cd151510c6e22d774c22b4be19272f9980cc6ba2b2e42f43738a1e475f49fcb4384d66b24639746a05685a90e37d4 diff --git a/sci-libs/rocThrust/metadata.xml b/sci-libs/rocThrust/metadata.xml index 61a33c63bbf48..03efe0482dfe9 100644 --- a/sci-libs/rocThrust/metadata.xml +++ b/sci-libs/rocThrust/metadata.xml @@ -8,10 +8,14 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCm-Developer-Tools/rocThrust + ROCm/rocThrust - - Build and install benchmark binary. - - + + Build and install benchmark binary. + + \ No newline at end of file diff --git a/sci-libs/rocThrust/rocThrust-6.1.1.ebuild b/sci-libs/rocThrust/rocThrust-6.1.1.ebuild new file mode 100644 index 0000000000000..7a04d78cbe0f2 --- /dev/null +++ b/sci-libs/rocThrust/rocThrust-6.1.1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="HIP back-end for the parallel algorithm library Thrust" +HOMEPAGE="https://github.com/ROCm/rocThrust" +SRC_URI="https://github.com/ROCm/rocThrust/archive/rocm-${PV}.tar.gz -> rocThrust-${PV}.tar.gz" +S="${WORKDIR}/rocThrust-rocm-${PV}" + +LICENSE="Apache-2.0" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="benchmark test" +REQUIRED_USE=" + benchmark? ( ${ROCM_REQUIRED_USE} ) + test? ( ${ROCM_REQUIRED_USE} ) +" + +RESTRICT="!test? ( test )" + +RDEPEND="dev-util/hip + sci-libs/rocPRIM:${SLOT}[${ROCM_USEDEP}] + test? ( dev-cpp/gtest )" +DEPEND="${RDEPEND}" +BDEPEND=">=dev-build/cmake-3.22" + +PATCHES=( "${FILESDIR}/${PN}-4.0-operator_new.patch" ) + +src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_TEST=$(usex test ON OFF) + -DBUILD_BENCHMARKS=$(usex benchmark ON OFF) + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + # uses HMM to fit tests to default <512M iGPU VRAM + ROCTHRUST_USE_HMM="1" cmake_src_test -j1 +} + +src_install() { + cmake_src_install + + use benchmark && dobin "${BUILD_DIR}"/benchmarks/benchmark_thrust_bench +} From ea531b0c344ebc847ce3ba8fde92daee84986dfa Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 17:49:39 +0000 Subject: [PATCH 28/45] sci-libs/rocWMMA: add 6.1.1 Changes since 5.7.2: * Added patch for new issue https://github.com/ROCm/rocWMMA/issues/360 * Disabled LTO due to https://github.com/llvm/llvm-project/issues/61101 Signed-off-by: Sv. Lockal --- sci-libs/rocWMMA/Manifest | 1 + .../files/rocWMMA-6.0.2-add-iostream.patch | 14 +++++ .../rocWMMA-6.0.2-use-system-googletest.patch | 28 +++++++++ sci-libs/rocWMMA/rocWMMA-6.1.1.ebuild | 59 +++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 sci-libs/rocWMMA/files/rocWMMA-6.0.2-add-iostream.patch create mode 100644 sci-libs/rocWMMA/files/rocWMMA-6.0.2-use-system-googletest.patch create mode 100644 sci-libs/rocWMMA/rocWMMA-6.1.1.ebuild diff --git a/sci-libs/rocWMMA/Manifest b/sci-libs/rocWMMA/Manifest index 6e7f161dc9241..7aeb9da75f6f1 100644 --- a/sci-libs/rocWMMA/Manifest +++ b/sci-libs/rocWMMA/Manifest @@ -1 +1,2 @@ DIST rocWMMA-5.7.1.tar.gz 3163060 BLAKE2B 47ca55c0cd388ca51ad3843e656a31ce04d9e07988c26bfb69a7c61bfe497609408cfd20dcbe9c6698bd79b800a114ab67d582ced43dc6f1c4db4072e2901d99 SHA512 92c9c634fdf1f5319d34fabbf691df45600abdc5285a76b40255e7d6d260553076f65baa1eda566a163725e2a0cec0a85372eb07add39c65368e84505c176f50 +DIST rocWMMA-6.1.1.tar.gz 3189782 BLAKE2B fd96d8f3ba8f21ee3544d532a59ffdefa1aefc94d73401f48d470f7f699e28771d5495e98c1ee316d8379167b70b945220be6670dee2757a62af162276a2fb0f SHA512 db2bfe805a4f33c48ee98c821efe0b261eca474af9e954843c83faa3335459bfe635326ba2cfc7b8b8ece2cf0f2c418f49ff6aa81537f8d3747cc729738a6b18 diff --git a/sci-libs/rocWMMA/files/rocWMMA-6.0.2-add-iostream.patch b/sci-libs/rocWMMA/files/rocWMMA-6.0.2-add-iostream.patch new file mode 100644 index 0000000000000..90b161c083daf --- /dev/null +++ b/sci-libs/rocWMMA/files/rocWMMA-6.0.2-add-iostream.patch @@ -0,0 +1,14 @@ +Bug: https://github.com/ROCm/rocWMMA/issues/360 +--- a/test/gemm/gemm_predicates_base.hpp ++++ b/test/gemm/gemm_predicates_base.hpp +@@ -26,6 +26,10 @@ + #ifndef ROCWMMA_TEST_GEMM_PREDICATES_BASE_HPP + #define ROCWMMA_TEST_GEMM_PREDICATES_BASE_HPP + ++#if !NDEBUG ++#include ++#endif ++ + #include "gemm_test_traits.hpp" + + namespace rocwmma diff --git a/sci-libs/rocWMMA/files/rocWMMA-6.0.2-use-system-googletest.patch b/sci-libs/rocWMMA/files/rocWMMA-6.0.2-use-system-googletest.patch new file mode 100644 index 0000000000000..de29d5b704100 --- /dev/null +++ b/sci-libs/rocWMMA/files/rocWMMA-6.0.2-use-system-googletest.patch @@ -0,0 +1,28 @@ +Add an option to use system PR +Upstream PR: https://github.com/ROCm/rocWMMA/pull/353 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -29,11 +29,15 @@ include( CMakeDependentOption ) + cmake_dependent_option( ROCWMMA_BUILD_VALIDATION_TESTS "Build validation tests" ON "ROCWMMA_BUILD_TESTS" OFF ) + cmake_dependent_option( ROCWMMA_BUILD_BENCHMARK_TESTS "Build benchmarking tests" OFF "ROCWMMA_BUILD_TESTS" OFF ) + cmake_dependent_option( ROCWMMA_BUILD_EXTENDED_TESTS "Build extended test parameter coverage" OFF "ROCWMMA_BUILD_TESTS" OFF ) ++cmake_dependent_option( ROCWMMA_USE_SYSTEM_GOOGLETEST "Use system Google Test library instead of downloading and building it" OFF "ROCWMMA_BUILD_TESTS" OFF ) + + add_compile_options(-mcmodel=large) + add_link_options(-mcmodel=large) + + # Test/benchmark requires additional dependencies ++if(ROCWMMA_USE_SYSTEM_GOOGLETEST) ++ find_package(GTest 1.12.1 REQUIRED) ++else() + include( FetchContent ) + + FetchContent_Declare( +@@ -59,6 +63,7 @@ if(NOT googletest_POPULATED) + # Restore shared libs setting + set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE INTERNAL "Build SHARED libraries" FORCE) + endif() ++endif() + + set(ROCWMMA_TEST_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) + set(ROCWMMA_COMMON_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hip_device.cpp diff --git a/sci-libs/rocWMMA/rocWMMA-6.1.1.ebuild b/sci-libs/rocWMMA/rocWMMA-6.1.1.ebuild new file mode 100644 index 0000000000000..fdb5a0adc5f28 --- /dev/null +++ b/sci-libs/rocWMMA/rocWMMA-6.1.1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +ROCM_SKIP_GLOBALS=1 + +inherit cmake rocm flag-o-matic + +DESCRIPTION="library for accelerating mixed precision matrix multiply-accumulate operations" +HOMEPAGE="https://github.com/ROCm/rocWMMA" +SRC_URI="https://github.com/ROCm/rocWMMA/archive/rocm-${PV}.tar.gz -> rocWMMA-${PV}.tar.gz" +S="${WORKDIR}/rocWMMA-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +DEPEND="=dev-util/hip-6*" + +BDEPEND=" + test? ( + dev-cpp/gtest + ) + dev-build/rocm-cmake +" + +IUSE_TARGETS=( gfx908 gfx90a gfx940 gfx941 gfx942 gfx1100 gfx1101 gfx1102 ) +IUSE_TARGETS=( "${IUSE_TARGETS[@]/#/amdgpu_targets_}" ) + +IUSE="${IUSE_TARGETS[@]/#/+} test" + +REQUIRED_USE="|| ( ${IUSE_TARGETS[*]} )" + +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-6.0.2-use-system-googletest.patch + "${FILESDIR}"/${PN}-6.0.2-add-iostream.patch +) + +src_configure() { + # ld.lld bug https://github.com/llvm/llvm-project/issues/61101 + filter-lto + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DROCM_SYMLINK_LIBS=OFF + -DROCWMMA_BUILD_SAMPLES=OFF + -DROCWMMA_BUILD_TESTS=$(usex test ON OFF) + ) + use test && mycmakeargs+=(-DROCWMMA_USE_SYSTEM_GOOGLETEST=ON) + CC=hipcc CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + cmake_src_test -j1 +} From 2c4fbf9a9f5ce9624019154aaeb3585426d4ac83 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 18:16:18 +0000 Subject: [PATCH 29/45] sci-libs/hipBLAS: add 6.1.1 Changes: * Can be built with GCC; hipcc is not needed directly here * Rename ROCmSoftwarePlatform -> ROCm in URLs * Add myself as a maintainer --- sci-libs/hipBLAS/Manifest | 1 + sci-libs/hipBLAS/hipBLAS-5.7.1.ebuild | 3 +-- sci-libs/hipBLAS/hipBLAS-6.1.1.ebuild | 35 +++++++++++++++++++++++++++ sci-libs/hipBLAS/metadata.xml | 6 ++++- 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 sci-libs/hipBLAS/hipBLAS-6.1.1.ebuild diff --git a/sci-libs/hipBLAS/Manifest b/sci-libs/hipBLAS/Manifest index 21eceaa7bab4a..2e8dfa39138c3 100644 --- a/sci-libs/hipBLAS/Manifest +++ b/sci-libs/hipBLAS/Manifest @@ -1,3 +1,4 @@ DIST hipBLAS-5.1.3.tar.gz 526704 BLAKE2B d32d7029ea910c341e00dccab1ee9ab984518368cf38524f2264bb808cc1242b3d57db283937650f54460cb01174ec90f02c4bd66866cba4be5d0a1855814f0e SHA512 41dbc86b7ea53e7c0f1d629130f90b719f864ceddae972f1c68911e97b6233286f0c22c0fcfce049ae7db73a1ed41bdaf730040c72f1790fca367362c14ac707 DIST hipBLAS-5.4.2.tar.gz 930814 BLAKE2B 702df09010b50652feb8f7e5741b27117aa58fc3e3b1b5f89f5043073a47581d1710f0831740453e84f7594b1b305e95d2681709898e5231c3eee2e8207404a3 SHA512 a941350d2d25022cf5142f68559242a048136bdd048dafcd544a0241cf3b510062273163f7a0eecc55f17ec47a1063d84d6102ca766ba7cde9b704eee5c44cd8 DIST hipBLAS-5.7.1.tar.gz 669163 BLAKE2B e065f77eba0bb99d347f71920e733d30b7693f9eaf0c1f2a87a169360ccff23b8294e367eebfd6489440308b9bb1ae662c39617c5bb94275bf9b0ed60d555f85 SHA512 24c074f07865e1a3dfb0aca0b1d494e340a584ecb408813bb5b053f8282437cfd3644d730163f4faf1b93da306626ba68904141f9c3730a29749537fb7fd1a63 +DIST hipBLAS-6.1.1.tar.gz 835570 BLAKE2B dc8a54f3b6c780f63e57f208d67b15e965d3a7c98e20766ef22ecfd41e8780a6b9464e31efad8003b52562222ec7ad06801d93a502ff99f8456f415db09e5ace SHA512 390b9a9bf0238a5c72d51d034c0053ec8c6b007547b1ec9561064828c24335e099ddb0402ad76e60018ec96742d5acfbb29b9d218a613e1c6d54e4b8b05ceca7 diff --git a/sci-libs/hipBLAS/hipBLAS-5.7.1.ebuild b/sci-libs/hipBLAS/hipBLAS-5.7.1.ebuild index f5afa385cdeef..f979363cda259 100644 --- a/sci-libs/hipBLAS/hipBLAS-5.7.1.ebuild +++ b/sci-libs/hipBLAS/hipBLAS-5.7.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -19,7 +19,6 @@ RDEPEND="dev-util/hip sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] sci-libs/rocSOLVER:${SLOT}[${ROCM_USEDEP}]" DEPEND="${RDEPEND}" -BDEPEND="" S="${WORKDIR}/hipBLAS-rocm-${PV}" diff --git a/sci-libs/hipBLAS/hipBLAS-6.1.1.ebuild b/sci-libs/hipBLAS/hipBLAS-6.1.1.ebuild new file mode 100644 index 0000000000000..439a778540e92 --- /dev/null +++ b/sci-libs/hipBLAS/hipBLAS-6.1.1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm +DESCRIPTION="ROCm BLAS marshalling library" +HOMEPAGE="https://github.com/ROCm/hipBLAS" +SRC_URI="https://github.com/ROCm/hipBLAS/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/hipBLAS-rocm-${PV}" + +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +RDEPEND="dev-util/hip + sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] + sci-libs/rocSOLVER:${SLOT}[${ROCM_USEDEP}]" +DEPEND="${RDEPEND}" + +src_configure() { + local mycmakeargs=( + # currently hipBLAS is a wrapper of rocBLAS which has tests, so no need to perform test here + -DBUILD_CLIENTS_TESTS=OFF + -DBUILD_CLIENTS_BENCHMARKS=OFF + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + ) + + cmake_src_configure +} diff --git a/sci-libs/hipBLAS/metadata.xml b/sci-libs/hipBLAS/metadata.xml index 65b9259ded18f..128eeacea7f93 100644 --- a/sci-libs/hipBLAS/metadata.xml +++ b/sci-libs/hipBLAS/metadata.xml @@ -12,7 +12,11 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/hipBLAS + ROCm/hipBLAS From e5c144cb9d937ecad215b9cc49053e8647cb3696 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 18:25:28 +0000 Subject: [PATCH 30/45] sci-libs/hipRAND: add 6.1.1 * Rename ROCmSoftwarePlatform to ROCm in URLs * Add myself as a maintainer Signed-off-by: Sv. Lockal --- sci-libs/hipRAND/Manifest | 1 + sci-libs/hipRAND/hipRAND-5.6.0-r1.ebuild | 3 +- sci-libs/hipRAND/hipRAND-5.7.1.ebuild | 3 +- sci-libs/hipRAND/hipRAND-6.1.1.ebuild | 35 ++++++++++++++++++++++++ sci-libs/hipRAND/metadata.xml | 6 +++- 5 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 sci-libs/hipRAND/hipRAND-6.1.1.ebuild diff --git a/sci-libs/hipRAND/Manifest b/sci-libs/hipRAND/Manifest index 39e54dc94d021..0459d75805d50 100644 --- a/sci-libs/hipRAND/Manifest +++ b/sci-libs/hipRAND/Manifest @@ -1,2 +1,3 @@ DIST hipRAND-rocm-5.6.0.tar.gz 477597 BLAKE2B fdc88ac7076ab6b31ba794f9274881323fba32295bab5b90e38d8c8f336e0255b7d20dcba6e334b7bacd8b67eaac8a3ac6e11e3d490e7c95a973d16c9598922f SHA512 47d0cca92b458f8ef682b3c15fe4ccc5201370b1458e541080dc2150e98256962b78806c20b26d789b232d420eb305639fa50180e379ba123851d35d24d40cb2 DIST hipRAND-rocm-5.7.1.tar.gz 478352 BLAKE2B 5f435cf53d213b1d95ee8b766df2c9bc4b4d590ccf63fe867bd033eeb4b7fef67e2bde22242525686a8dee59fd811363857312481e9cb3575357c612ab519a41 SHA512 b3c51728c1d7cc37760f49f36ab7765c166f105bc5b1b6ce65ac4a1de9bb70f8e2c10f5c41f89040288b09c9257d913d745a416bd4785b71f170a4f57e1f95e2 +DIST hipRAND-rocm-6.1.1.tar.gz 119063 BLAKE2B dc314d8b09c15351075594335d14f65024be54597e7cbdfb7671ebea29fa208c9a33530a2d406a8a2a9d8738f0aae7e9fc25d8c39304ef2ef27aaf8b327b5975 SHA512 4c350c8a75e6b4064e22cd73679f66e5caf28f7922fc47ef9670c1023b58b36bf3a2a35580463ee7c89e26ed924aaaa68166a11f64823b99f2f8302f80d6e87a diff --git a/sci-libs/hipRAND/hipRAND-5.6.0-r1.ebuild b/sci-libs/hipRAND/hipRAND-5.6.0-r1.ebuild index 006440bb6a29b..1674ad72718fd 100644 --- a/sci-libs/hipRAND/hipRAND-5.6.0-r1.ebuild +++ b/sci-libs/hipRAND/hipRAND-5.6.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -21,7 +21,6 @@ RESTRICT="test" RDEPEND="dev-util/hip sci-libs/rocRAND:${SLOT}[${ROCM_USEDEP}]" DEPEND="${RDEPEND}" -BDEPEND="" S="${WORKDIR}/hipRAND-rocm-${PV}" diff --git a/sci-libs/hipRAND/hipRAND-5.7.1.ebuild b/sci-libs/hipRAND/hipRAND-5.7.1.ebuild index 006440bb6a29b..1674ad72718fd 100644 --- a/sci-libs/hipRAND/hipRAND-5.7.1.ebuild +++ b/sci-libs/hipRAND/hipRAND-5.7.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -21,7 +21,6 @@ RESTRICT="test" RDEPEND="dev-util/hip sci-libs/rocRAND:${SLOT}[${ROCM_USEDEP}]" DEPEND="${RDEPEND}" -BDEPEND="" S="${WORKDIR}/hipRAND-rocm-${PV}" diff --git a/sci-libs/hipRAND/hipRAND-6.1.1.ebuild b/sci-libs/hipRAND/hipRAND-6.1.1.ebuild new file mode 100644 index 0000000000000..2a123df19544c --- /dev/null +++ b/sci-libs/hipRAND/hipRAND-6.1.1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="CU / ROCM agnostic hip RAND implementation" +HOMEPAGE="https://github.com/ROCm/hipRAND" +SRC_URI="https://github.com/ROCm/hipRAND/archive/refs/tags/rocm-${PV}.tar.gz -> hipRAND-rocm-${PV}.tar.gz" +S="${WORKDIR}/hipRAND-rocm-${PV}" + +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +RESTRICT="test" + +RDEPEND="dev-util/hip + sci-libs/rocRAND:${SLOT}[${ROCM_USEDEP}]" +DEPEND="${RDEPEND}" + +src_configure() { + local mycmakeargs=( + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + ) + + CXX=hipcc cmake_src_configure +} diff --git a/sci-libs/hipRAND/metadata.xml b/sci-libs/hipRAND/metadata.xml index 27c8916b67d48..c47caac8ebdf5 100644 --- a/sci-libs/hipRAND/metadata.xml +++ b/sci-libs/hipRAND/metadata.xml @@ -9,7 +9,11 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/hipRAND + ROCm/hipRAND From 35feaca8fec90534ecbabaf362b0365566e2b7ed Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 18:55:00 +0000 Subject: [PATCH 31/45] sci-libs/rocFFT: add 6.1.1 Changes: * Benchmark tools were renamed from *-rider to *-bench * Add myself to maintainers * Drop sed fixes for install path Signed-off-by: Sv. Lockal --- sci-libs/rocFFT/Manifest | 1 + sci-libs/rocFFT/metadata.xml | 14 ++- sci-libs/rocFFT/rocFFT-6.1.1.ebuild | 149 ++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+), 5 deletions(-) create mode 100644 sci-libs/rocFFT/rocFFT-6.1.1.ebuild diff --git a/sci-libs/rocFFT/Manifest b/sci-libs/rocFFT/Manifest index b850aef411dd0..206e1b4ad5644 100644 --- a/sci-libs/rocFFT/Manifest +++ b/sci-libs/rocFFT/Manifest @@ -1,2 +1,3 @@ DIST rocFFT-5.1.3.tar.gz 845470 BLAKE2B 86060ce4f8612869fedc5bc92ed6a5bb7fbc539b26c7f5ab0ded5406ab6c340f64116782285d040824e54557af87d9ddb6f907fd1550b80c3da903d3c1d5e5c0 SHA512 175402856bd4753e74ce14326569be99221e21d0ce675e007900f6982c53e1566ad0b060eec545e0f17ff4dc4811688cc1003dc986226205ee95ee6f22d1ca43 DIST rocFFT-5.7.1.tar.gz 1192841 BLAKE2B 58f880f7ff866f85af70666d17e8b1a3ac8e63e853520546f746d74cecd805687fd689367a09d2b1ec4e1059b44b858377dce362cd4cae91cb85aad7c3185c00 SHA512 48467589cb4bc1334a4074bacc6a726c850dc2a79ef82622301d61c4269fb81c0b2b9fce56d72bddca584d1797a8634d243a9a6b8cf943e687b2b0f5c931116f +DIST rocFFT-6.1.1.tar.gz 1257210 BLAKE2B 01d383d32bb91a9cd1d68a3b1ef2c6d71b33a9a49389c558adca2673ce4a74aab9f0a420977d4f4d5e8b8e72f3d9bfe3a8019e137968b58984edac4f2e1a9146 SHA512 fb35b4d21b8bd598702f79707cdf19b7c30a9e62176f5f7a71b93076f904a98446dac4fa8bffcd7ba20ecb797aec727e730c8232de881a52d519c0c00a907bf9 diff --git a/sci-libs/rocFFT/metadata.xml b/sci-libs/rocFFT/metadata.xml index 5774b6a548d73..ab2a20524390e 100644 --- a/sci-libs/rocFFT/metadata.xml +++ b/sci-libs/rocFFT/metadata.xml @@ -9,11 +9,15 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/rocFFT + ROCm/rocFFT - - Build and install [dyna-]rocfft-rider. - Install rocfft-perf performance visualization suite. - + + Build and install rocfft benchmark tools. + Install rocfft-perf performance visualization suite. + diff --git a/sci-libs/rocFFT/rocFFT-6.1.1.ebuild b/sci-libs/rocFFT/rocFFT-6.1.1.ebuild new file mode 100644 index 0000000000000..4eef4ea268dc4 --- /dev/null +++ b/sci-libs/rocFFT/rocFFT-6.1.1.ebuild @@ -0,0 +1,149 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +ROCM_VERSION=${PV} + +inherit cmake check-reqs edo multiprocessing python-r1 rocm + +DESCRIPTION="Next generation FFT implementation for ROCm" +HOMEPAGE="https://github.com/ROCm/rocFFT" +SRC_URI="https://github.com/ROCm/rocFFT/archive/rocm-${PV}.tar.gz -> rocFFT-${PV}.tar.gz" +S="${WORKDIR}/rocFFT-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +# RDEPEND: perfscripts? dev-python/plotly[${PYTHON_USEDEP}] # currently masked by arch/amd64/x32/package.mask +RDEPEND=" +perfscripts? ( + >=media-gfx/asymptote-2.61 + dev-texlive/texlive-latex + dev-tex/latexmk + sys-apps/texinfo + dev-python/sympy[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/scipy[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] ) +${PYTHON_DEPS}" + +DEPEND="=dev-util/hip-6* + ${PYTHON_DEPS} + benchmark? ( + dev-libs/boost + sci-libs/hipRAND:${SLOT}[${ROCM_USEDEP}] + ) + test? ( + dev-cpp/gtest + dev-libs/boost + >=sci-libs/fftw-3 + sys-libs/libomp + sci-libs/hipRAND:${SLOT}[${ROCM_USEDEP}] + ) +" + +BDEPEND=" + >=dev-build/cmake-3.22 + dev-build/rocm-cmake + dev-db/sqlite +" + +CHECKREQS_DISK_BUILD="7G" + +IUSE="benchmark perfscripts test" +REQUIRED_USE="perfscripts? ( benchmark ) ${PYTHON_REQUIRED_USE} ${ROCM_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-5.7.1-fix-rocm-link-path.patch +) + +required_mem() { + if use test; then + echo "52G" + else + if [[ -n "${AMDGPU_TARGETS}" ]]; then + # count how many archs user specified in ${AMDGPU_TARGETS} + local NARCH=$(($(awk -F";" '{print NF-1}' <<< "${AMDGPU_TARGETS}" || die)+1)) + else + # The default number of AMDGPU_TARGETS for rocFFT-4.3.0. May change in the future. + local NARCH=7 + fi + echo "$(($(makeopts_jobs)*${NARCH}*25+2200))M" # A linear function estimating how much memory required + fi +} + +pkg_pretend() { + return # leave the disk space check to pkg_setup phase +} + +pkg_setup() { + export CHECKREQS_MEMORY=$(required_mem) + check-reqs_pkg_setup + python_setup +} + +src_prepare() { + if use perfscripts; then + pushd scripts/perf || die + sed -e "/\/opt\/rocm/d" -e "/rocmversion/s,rocm_info.strip(),\"${PV}\"," -i perflib/specs.py || dir + sed -e "/^top/,+1d" -i rocfft-perf suites.py || die + sed -e "s,perflib,${PN}_perflib,g" -i rocfft-perf suites.py perflib/*.py || die + sed -e "/^top = /s,__file__).*$,\"${EPREFIX}/usr/share/${PN}-perflib\")," \ + -i perflib/pdf.py perflib/generators.py || die + popd + fi + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -Wno-dev + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + -DBUILD_CLIENTS_BENCH=$(usex benchmark ON OFF) + -DSQLITE_USE_SYSTEM_PACKAGE=ON + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}/clients/staging" || die + export LD_LIBRARY_PATH=${BUILD_DIR}/library/src/:${BUILD_DIR}/library/src/device + edob ./${PN,,}-test + edob ./${PN,,}-selftest +} + +src_install() { + cmake_src_install + + if use benchmark; then + cd "${BUILD_DIR}"/clients/staging || die + dobin dyna-rocfft-bench rocfft-bench + dosym dyna-rocfft-bench /usr/bin/dyna-rocfft-rider + dosym rocfft-bench /usr/bin/dyna-rocfft-rider + + if ! use perfscripts; then + # prevent collision with dev-util/perf + rm -rf "${ED}"/usr/bin/perf || die + fi + fi + + if use perfscripts; then + cd "${S}"/scripts/perf || die + python_foreach_impl python_doexe rocfft-perf + python_moduleinto ${PN}_perflib + python_foreach_impl python_domodule perflib/*.py + insinto /usr/share/${PN}-perflib + doins *.asy suites.py + fi +} From 80f3cef28086dbfb327c8db168da23b04586aff2 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 19:27:44 +0000 Subject: [PATCH 32/45] sci-libs/hipFFT: add 6.1.1 Changes: * Can be built with gcc; hipcc is not needed directly * No patches needed * Added myself to maintainers Signed-off-by: Sv. Lockal --- sci-libs/hipFFT/Manifest | 1 + sci-libs/hipFFT/hipFFT-6.1.1.ebuild | 36 +++++++++++++++++++++++++++++ sci-libs/hipFFT/metadata.xml | 6 ++++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 sci-libs/hipFFT/hipFFT-6.1.1.ebuild diff --git a/sci-libs/hipFFT/Manifest b/sci-libs/hipFFT/Manifest index df28313d17873..ace4000e72e38 100644 --- a/sci-libs/hipFFT/Manifest +++ b/sci-libs/hipFFT/Manifest @@ -1,2 +1,3 @@ DIST hipFFT-rocm-5.1.3.tar.gz 89397 BLAKE2B 3c29d5d660e9f3db8afd8c9e524296c29f50faf06a5d6a58ec628b5cc5ddb47ac2b99f137c7bc5090a311189b44014ea2f6f1f7547d22506f5ba18f837fbeb68 SHA512 8d7a90630cd8bfeade9cb026e45b6b6c1ab9c96dba424559a7ced8c881cd45c1cb06d3f7e82c8e6558e4ccb8bb41b6278842057a0cf0957b0644b1139f2c9706 DIST hipFFT-rocm-5.7.1.tar.gz 102616 BLAKE2B ee8d6dcb7924c8989987b02533126c4e4419d8dc83067a816f2253efe4537e094f1665d95699d4bf27f30cd13f3fc5df7d3b0062c267ecbdcbb3aad961fab6f6 SHA512 4bfd812fa1e949574b4170833755a435f47e893f0615b65d8d273af6e8f89ea4d28632a208de20321e834c8bc237b11816e2af0363b60adca9af736b9bc87465 +DIST hipFFT-rocm-6.1.1.tar.gz 170796 BLAKE2B 8c957db8e7e2548918539c94262d912c2f33b70d8482b727c78c13323bdb6822c3e95439854b8ab4fed970d21ed0c6fd2ab8c2805db59d3a3606d73e7eb47468 SHA512 531be32b12ed5f0f2352e3e0a893ca988a4c8492e66fc9347b6754ae4e769549d6f638a760de35cb15ef2d301ab4200a76c832d769ecb0cd55e9e42f839a1876 diff --git a/sci-libs/hipFFT/hipFFT-6.1.1.ebuild b/sci-libs/hipFFT/hipFFT-6.1.1.ebuild new file mode 100644 index 0000000000000..d9700529cd243 --- /dev/null +++ b/sci-libs/hipFFT/hipFFT-6.1.1.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="CU / ROCM agnostic hip FFT implementation" +HOMEPAGE="https://github.com/ROCm/hipFFT" +SRC_URI="https://github.com/ROCm/hipFFT/archive/refs/tags/rocm-${PV}.tar.gz -> hipFFT-rocm-${PV}.tar.gz" +S="${WORKDIR}/hipFFT-rocm-${PV}" + +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +RESTRICT="test" + +RDEPEND="dev-util/hip + sci-libs/rocFFT:${SLOT}[${ROCM_USEDEP}]" +DEPEND="${RDEPEND}" + +src_configure() { + local mycmakeargs=( + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_CLIENTS_TESTS=OFF + -DBUILD_CLIENTS_RIDER=OFF + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + + cmake_src_configure +} diff --git a/sci-libs/hipFFT/metadata.xml b/sci-libs/hipFFT/metadata.xml index 54e78eb20141c..1e3fd1c52d20d 100644 --- a/sci-libs/hipFFT/metadata.xml +++ b/sci-libs/hipFFT/metadata.xml @@ -13,7 +13,11 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/hipFFT + ROCm/hipFFT From 25cf312efed57c983e7802ccc832e395b9af3d02 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 18 Mar 2024 19:41:36 +0000 Subject: [PATCH 33/45] sci-libs/hipCUB: add 6.1.1 Changes: * Access to device is not needed to configure and build * Add myself to maintainers Signed-off-by: Sv. Lockal --- sci-libs/hipCUB/Manifest | 1 + sci-libs/hipCUB/hipCUB-6.1.1.ebuild | 54 +++++++++++++++++++++++++++++ sci-libs/hipCUB/metadata.xml | 6 +++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 sci-libs/hipCUB/hipCUB-6.1.1.ebuild diff --git a/sci-libs/hipCUB/Manifest b/sci-libs/hipCUB/Manifest index 7d95be621dad1..834a95c038cfa 100644 --- a/sci-libs/hipCUB/Manifest +++ b/sci-libs/hipCUB/Manifest @@ -1,2 +1,3 @@ DIST hipCUB-5.1.3.tar.gz 278021 BLAKE2B f30e567370fea80ef63a455c2c27b3f4ff241e7e405688fa4dc33d1e0ce3dffb016a1a1523b20613a7963bff061758eac0c0d110243a9a6cedbc100bb087d7d4 SHA512 dd3ca341b78cf6985ba723feeeb560c0503ab283b63067e9a5e68d12ad42f752a7f56fd60f0f0c26c2853538853e09a102cfc6006c18c31c3162fa7b536ffb9f DIST hipCUB-5.7.1.tar.gz 322980 BLAKE2B a9b2a69b47661532858f18e7296ef37be41da814bb4886f7b8b444829e6ad1374d1c3117b57e7599095253ed56ea2403c895bb820dbde9cec77c28a041af3898 SHA512 7cf7dc819a3d8bac2cf70aa077616e65d785d76bae3ad3991db7b940a061f694ac82b1e4219aa16476351f1329e3f0d09a818b0ff0b9c5ad261937879c21dca8 +DIST hipCUB-6.1.1.tar.gz 343181 BLAKE2B 3943278597c5e9d41c225ad86c3cdcc113f35cf1bf218ba357a112c25ae14df8d0e3f385aacd82ab4c694ae2382012aea06c02d40d982d00929d03d0d3908b55 SHA512 37297f6791146cc9db11d3d494555672c021dea06bec1e8a780ca926df1e5de140c8ee560657668df6221279a0418af9e34a235b3b52df3df2a66adabea7ca6f diff --git a/sci-libs/hipCUB/hipCUB-6.1.1.ebuild b/sci-libs/hipCUB/hipCUB-6.1.1.ebuild new file mode 100644 index 0000000000000..8a38588c8d4cd --- /dev/null +++ b/sci-libs/hipCUB/hipCUB-6.1.1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="Wrapper of rocPRIM or CUB for GPU parallel primitives" +HOMEPAGE="https://github.com/ROCm/hipCUB" +SRC_URI="https://github.com/ROCm/hipCUB/archive/rocm-${PV}.tar.gz -> hipCUB-${PV}.tar.gz" +S="${WORKDIR}/hipCUB-rocm-${PV}" + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="benchmark test" +REQUIRED_USE=" + benchmark? ( ${ROCM_REQUIRED_USE} ) + test? ( ${ROCM_REQUIRED_USE} ) +" +RESTRICT="!test? ( test )" + +RDEPEND="dev-util/hip + sci-libs/rocPRIM:${SLOT}[${ROCM_USEDEP}] + benchmark? ( dev-cpp/benchmark ) + test? ( dev-cpp/gtest ) +" +DEPEND="${RDEPEND}" + +src_prepare() { + sed -e "s:set(ROCM_INSTALL_LIBDIR lib):set(ROCM_INSTALL_LIBDIR $(get_libdir)):" \ + -i cmake/ROCMExportTargetsHeaderOnly.cmake || die + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_TEST=$(usex test ON OFF) + -DBUILD_BENCHMARK=$(usex benchmark ON OFF) + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + # uses HMM to fit tests to default <512M iGPU VRAM + HIPCUB_USE_HMM="1" cmake_src_test -j1 +} diff --git a/sci-libs/hipCUB/metadata.xml b/sci-libs/hipCUB/metadata.xml index 5e18b914d0702..64944bcdc7452 100644 --- a/sci-libs/hipCUB/metadata.xml +++ b/sci-libs/hipCUB/metadata.xml @@ -12,8 +12,12 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + - ROCm-Developer-Tools/hipCUB + ROCm/hipCUB Build and install benchmark binaries. From 4a038aa6622c0d3d47c06e40592f3dbb53e0c5e5 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Tue, 19 Mar 2024 18:24:37 +0000 Subject: [PATCH 34/45] sci-libs/miopen: add 6.1.1 Changes: * drop all old patches, except for enable-test * add new patch for Clang 17 compatibility (official build uses Clang 18) * new dependency on dev-util/roctracer * set >=dev-libs/half-1.12.0-r1 depencency to find half/half.hpp automatically * add myself to maintainers * add include path for dev-libs/half (works even then half.hpp is installed into /usr/include) Signed-off-by: Sv. Lockal --- sci-libs/miopen/Manifest | 1 + .../files/miopen-6.1.1-build-all-tests.patch | 13 +++ sci-libs/miopen/metadata.xml | 6 +- sci-libs/miopen/miopen-5.1.3-r1.ebuild | 1 + sci-libs/miopen/miopen-5.7.1-r1.ebuild | 1 + sci-libs/miopen/miopen-6.1.1.ebuild | 106 ++++++++++++++++++ 6 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 sci-libs/miopen/files/miopen-6.1.1-build-all-tests.patch create mode 100644 sci-libs/miopen/miopen-6.1.1.ebuild diff --git a/sci-libs/miopen/Manifest b/sci-libs/miopen/Manifest index 13af314de19a2..2b9827766bf05 100644 --- a/sci-libs/miopen/Manifest +++ b/sci-libs/miopen/Manifest @@ -1,3 +1,4 @@ DIST MIOpen-5.1.3.tar.gz 88118329 BLAKE2B d24722ffc5f5dab6d6a1de2ce34193ad2f25c9a2562e38c52e010a29870f01d9ea1c56970ba0601a088c8286e97958ee95d0da27fc8082126dd2ebe5ccb36b70 SHA512 a14e28cfcb12e5061e0e7b999ef3e67fa0a0e897e31bc50e7288b8a23eb1791312e33d3b697021c2b654ccc065ae1b046c1cfd77ba8e04b0f3e87e9cc0626dcd DIST MIOpen-5.7.1.tar.gz 100751593 BLAKE2B c5f847fe4374ab22737c281a65401125012328412d584fc09244b431ea6265d6d5028429115ee15fa8b04cbe0edd020e4e7ac8deb22561183ed76cb8c3d4d9d4 SHA512 3354b3b154f29a6337403abc5a71ec47c0b2558320c5a1b0cbfbbdb370c4fada2db12d4a19a312b5e30ca2e2302ee50ece3390603e84d132b2212a168e9523fa +DIST MIOpen-6.1.1.tar.gz 101935496 BLAKE2B 5aadaa5eefa1b22dedfe87deb36f8acdbe57962cac8b7b6b20bc76f136ef29f0441e48112010280c2e674a1ae9fd202ca3e07be47cf4a4bc797234d6dc618be5 SHA512 b8860583919bf2f3e0da7ace30fdb0595ab45b85a367be3737e0b15a22a5565b8d6660c652ee070f21c36ac7d17ef3ba8e2eda7ed89bd6a0c65a4df799626d1a DIST gtest-1.11.0_p20210611.tar.gz 887296 BLAKE2B 8f29b7028a6dd8190a113cd93398705b23b61d88bee38beaf9dcc0dfc8a463aed7fcd3719f6f1b131d4363aa57231629aaeffa108f6558efb58416cfface6d6e SHA512 cf9e7f3fd3e31ce6677eac355fb8bfe19c5b56a8ec3af8b9417d0904cdf5da92f99f7411a08131cc9fa4fc7d38e6a71fcfac993648e47b269a74a27de7607f7a diff --git a/sci-libs/miopen/files/miopen-6.1.1-build-all-tests.patch b/sci-libs/miopen/files/miopen-6.1.1-build-all-tests.patch new file mode 100644 index 0000000000000..49ec1ccbff3bd --- /dev/null +++ b/sci-libs/miopen/files/miopen-6.1.1-build-all-tests.patch @@ -0,0 +1,13 @@ +Normally, MIOpen compiles tests during test phase instead of "compile". +This patch allows to build testing executables during compile phase. +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -330,7 +330,7 @@ endfunction() + separate_arguments(MIOPEN_TEST_FLAGS_ARGS NATIVE_COMMAND ${MIOPEN_TEST_FLAGS}) + + function(add_test_executable TEST_NAME) +- add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) ++ add_executable (${TEST_NAME} ${ARGN}) + if(WIN32) + target_compile_definitions(${TEST_NAME} PRIVATE NOMINMAX) + endif() diff --git a/sci-libs/miopen/metadata.xml b/sci-libs/miopen/metadata.xml index 08c299887077f..e08e7753394d2 100644 --- a/sci-libs/miopen/metadata.xml +++ b/sci-libs/miopen/metadata.xml @@ -12,7 +12,11 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + - ROCmSoftwarePlatform/MIOpen + ROCm/MIOpen diff --git a/sci-libs/miopen/miopen-5.1.3-r1.ebuild b/sci-libs/miopen/miopen-5.1.3-r1.ebuild index 2ef5b8fb50b86..7d02435948f70 100644 --- a/sci-libs/miopen/miopen-5.1.3-r1.ebuild +++ b/sci-libs/miopen/miopen-5.1.3-r1.ebuild @@ -87,6 +87,7 @@ src_configure() { -DMIOPEN_USE_MLIR=OFF -DBUILD_TESTS=$(usex test ON OFF) -DMIOPEN_TEST_ALL=$(usex test ON OFF) + -DHALF_INCLUDE_DIR="${EPREFIX}/usr/include/half" ) if use test; then diff --git a/sci-libs/miopen/miopen-5.7.1-r1.ebuild b/sci-libs/miopen/miopen-5.7.1-r1.ebuild index 93bcde8190aea..b13e6354554fd 100644 --- a/sci-libs/miopen/miopen-5.7.1-r1.ebuild +++ b/sci-libs/miopen/miopen-5.7.1-r1.ebuild @@ -91,6 +91,7 @@ src_configure() { -DBUILD_TESTS=$(usex test ON OFF) -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF -DROCM_SYMLINK_LIBS=OFF + -DHALF_INCLUDE_DIR="${EPREFIX}/usr/include/half" ) if use test; then diff --git a/sci-libs/miopen/miopen-6.1.1.ebuild b/sci-libs/miopen/miopen-6.1.1.ebuild new file mode 100644 index 0000000000000..681117658e869 --- /dev/null +++ b/sci-libs/miopen/miopen-6.1.1.ebuild @@ -0,0 +1,106 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} +LLVM_COMPAT=( 17 18 ) + +inherit cmake flag-o-matic llvm-r1 rocm + +DESCRIPTION="AMD's Machine Intelligence Library" +HOMEPAGE="https://github.com/ROCm/MIOpen" +SRC_URI="https://github.com/ROCm/MIOpen/archive/rocm-${PV}.tar.gz -> MIOpen-${PV}.tar.gz" +S="${WORKDIR}/MIOpen-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="debug test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-util/hip + >=dev-db/sqlite-3.17 + sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] + sci-libs/composable-kernel:${SLOT}[${ROCM_USEDEP}] + dev-util/roctracer:${SLOT}[${ROCM_USEDEP}] + >=dev-libs/boost-1.72 + dev-cpp/nlohmann_json + dev-cpp/frugally-deep +" + +DEPEND="${RDEPEND}" + +BDEPEND=" + >=dev-libs/half-1.12.0-r1 + dev-build/rocm-cmake + test? ( dev-cpp/gtest ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-build-all-tests.patch +) + +src_prepare() { + cmake_src_prepare + + sed -e '/MIOPEN_TIDY_ERRORS ALL/d' \ + -e 's/FLAGS_RELEASE} -s/FLAGS_RELEASE}/g' \ + -i CMakeLists.txt || die + + sed -e "/add_test/s:--build \${CMAKE_CURRENT_BINARY_DIR}:--build ${BUILD_DIR}:" \ + -i test/CMakeLists.txt || die + + sed -e "s:\${PROJECT_BINARY_DIR}/miopen/include:\${PROJECT_BINARY_DIR}/include:" \ + -i src/CMakeLists.txt || die + + sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:${EPREFIX}/usr/lib/amdgcn/bitcode:" -i cmake/hip-config.cmake || die +} + +src_configure() { + if ! use debug; then + append-cflags "-DNDEBUG" + append-cxxflags "-DNDEBUG" + CMAKE_BUILD_TYPE="Release" + else + CMAKE_BUILD_TYPE="Debug" + fi + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DMIOPEN_BACKEND=HIP + -DBoost_USE_STATIC_LIBS=OFF + -DMIOPEN_USE_MLIR=OFF + -DBUILD_TESTING=$(usex test ON OFF) + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DMIOPEN_HIP_COMPILER="${ESYSROOT}/usr/bin/hipcc" + -DMIOPEN_AMDGCN_ASSEMBLER="$(get_llvm_prefix)/bin/clang" + -DHIP_OC_COMPILER="$(get_llvm_prefix)/bin/clang" + ) + + if use test; then + mycmakeargs+=( + -DMIOPEN_TEST_ALL=ON + -DMIOPEN_TEST_GDB=OFF + ) + # needed by rocminfo + addpredict /dev/random + check_amdgpu + fi + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + LD_LIBRARY_PATH="${BUILD_DIR}"/lib MIOPEN_SYSTEM_DB_PATH="${BUILD_DIR}"/share/miopen/db/ cmake_src_test -j1 +} + +src_install() { + cmake_src_install +} From b3bc7a9c3f8cc85a676545539dee7aa2f3bbb6c7 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Tue, 19 Mar 2024 18:49:11 +0000 Subject: [PATCH 35/45] sci-libs/rocBLAS: add 6.1.1 Changes: * in updated expand-isa-compatibility patch do not coerce gfx1011 and gfx1012 to gfx1010, as Gentoo users can build rocBLAS for gfx1011 and gfx1012 with USE flags * add myself to maintainers Signed-off-by: Sv. Lockal --- sci-libs/rocBLAS/Manifest | 1 + ...cBLAS-6.0.2-expand-isa-compatibility.patch | 96 +++++++++++++++ sci-libs/rocBLAS/metadata.xml | 4 + sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild | 111 ++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch create mode 100644 sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest index f17d3a47c686c..ca306e9c9efb2 100644 --- a/sci-libs/rocBLAS/Manifest +++ b/sci-libs/rocBLAS/Manifest @@ -3,3 +3,4 @@ DIST rocBLAS-5.4.2-Tensile-asm_full-navi22.tar.gz 1057686 BLAKE2B aa755595bbcd48 DIST rocm-rocBLAS-5.1.3.tar.gz 13741546 BLAKE2B af10d8cb69bee44ef5aab2dc350e1d9f3b6fddb3a840c17230c4b55b2649a4724c9f2e58c1eafdb3e2716eea016a72a35c3ddb498881b1ce682d780baa8d8b07 SHA512 5ab71838fdd0e9c5848cbf28a19d113353b619a878d8c7d05f64feb32faae2054169c95ed6e9dd6b05a2e807b57229dd2c361c4d289b6e6f17c196558640890f DIST rocm-rocBLAS-5.4.2.tar.gz 15938434 BLAKE2B 14ebafa944fdac443800bb7f9b16f8ecf0f420b168d3c6534f68ad7d14bf058a4cc1673fce8f4b9be53e4a6c1cf05011e01853cd901bce0b59827d2aca4d029f SHA512 e62bb80457c1e89454885499bdce9d60beecd706806724418983c78c65c2ae303550f9670b5a6e71dae6a61c0e42b223ab01b36b8406430731ebcbff54c4a8f4 DIST rocm-rocBLAS-5.7.1.tar.gz 55389700 BLAKE2B 9e58b1d29c8a04aa58ce17fdd9b0c2504934261851619dc5b696a04e8c6a79e7c44d86a6db7a9c76a434d76593de8c191cba6f163cf398d01cfc001e5fa32b5a SHA512 cfc73f6c490595a3c153c2ac2a3cb5926c48c2c19baa07ff3dcdf3a7ccaed82cfdff64ed5a3be64c349cb43d654d4b104d9090e2ec9f2061049d6a4921c07722 +DIST rocm-rocBLAS-6.1.1.tar.gz 100103895 BLAKE2B df89a21e47730714b80c62717a86d65ac0d819c2d33b2a3c6252b60b8d7cc9eb5f8f1db27159b0a8dfc87aba7ccad97e2f832bc0044e92d0b69c526d382c745a SHA512 74e847c4ddee16cae7f41e268a815ea03875519c365abe7dfce313a9545df245baa73301b432f64a36cc988281fec7530629a0d72583e9ea287c98ec8a0b3907 diff --git a/sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch b/sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch new file mode 100644 index 0000000000000..ca895c4b4ff59 --- /dev/null +++ b/sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch @@ -0,0 +1,96 @@ +--- a/library/src/handle.cpp ++++ b/library/src/handle.cpp +@@ -21,6 +21,7 @@ + * ************************************************************************ */ + #include "handle.hpp" + #include ++#include + #include + #ifdef WIN32 + #include +@@ -80,6 +81,20 @@ static Processor getActiveArch(int deviceId) + // strip out xnack/ecc from name + std::string deviceFullString(deviceProperties.gcnArchName); + std::string deviceString = deviceFullString.substr(0, deviceFullString.find(":")); ++ // coerce to compatible arch ++ int gcnArch = deviceString.substr(0, 3) == "gfx" ? std::stoi(deviceString.substr(3)) : 0; ++ switch(gcnArch) ++ { ++ case 902: case 909: case 912: ++ std::strcpy(deviceProperties.gcnArchName, "gfx900"); ++ break; ++ case 1013: ++ std::strcpy(deviceProperties.gcnArchName, "gfx1010"); ++ break; ++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036: ++ std::strcpy(deviceProperties.gcnArchName, "gfx1030"); ++ break; ++ } + + if(deviceString.find("gfx803") != std::string::npos) + { +--- a/library/src/rocblas_auxiliary.cpp ++++ b/library/src/rocblas_auxiliary.cpp +@@ -24,6 +24,7 @@ + #include "logging.hpp" + #include "rocblas-auxiliary.h" + #include ++#include + #include + #include + #include +@@ -1242,6 +1243,20 @@ std::string rocblas_internal_get_arch_name() + hipGetDevice(&deviceId); + hipDeviceProp_t deviceProperties; + hipGetDeviceProperties(&deviceProperties, deviceId); ++ // coerce to compatible arch ++ int gcnArch = strncmp(deviceProperties.gcnArchName, "gfx", 3) == 0 ? std::stoi(deviceProperties.gcnArchName + 3) : 0; ++ switch(gcnArch) ++ { ++ case 902: case 909: case 912: ++ std::strcpy(deviceProperties.gcnArchName, "gfx900"); ++ break; ++ case 1013: ++ std::strcpy(deviceProperties.gcnArchName, "gfx1010"); ++ break; ++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036: ++ std::strcpy(deviceProperties.gcnArchName, "gfx1030"); ++ break; ++ } + return ArchName{}(deviceProperties); + } + +--- a/library/src/tensile_host.cpp ++++ b/library/src/tensile_host.cpp +@@ -45,6 +45,7 @@ extern "C" void rocblas_shutdown(); + #include + #include + #include ++#include + #include + #include + #include +@@ -802,6 +803,23 @@ namespace + std::string deviceFullString(prop.gcnArchName); + std::string deviceString + = deviceFullString.substr(0, deviceFullString.find(":")); ++ // coerce to compatible arch ++ int gcnArch = deviceString.substr(0, 3) == "gfx" ? std::stoi(deviceString.substr(3)) : 0; ++ switch(gcnArch) ++ { ++ case 902: case 909: case 912: ++ std::strcpy(prop.gcnArchName, "gfx900"); ++ deviceString = prop.gcnArchName; ++ break; ++ case 1013: ++ std::strcpy(prop.gcnArchName, "gfx1010"); ++ deviceString = prop.gcnArchName; ++ break; ++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036: ++ std::strcpy(prop.gcnArchName, "gfx1030"); ++ deviceString = prop.gcnArchName; ++ break; ++ } + m_devicePropMap[deviceString] = std::make_shared(prop); + } + } diff --git a/sci-libs/rocBLAS/metadata.xml b/sci-libs/rocBLAS/metadata.xml index 066f5c749e3f8..0e8f76b2a76ee 100644 --- a/sci-libs/rocBLAS/metadata.xml +++ b/sci-libs/rocBLAS/metadata.xml @@ -12,6 +12,10 @@ xgreenlandforwyy@gmail.com Yiyang Wu + + lockalsash@gmail.com + Sv. Lockal + Perform rocblas-test to compare the result between rocBLAS and system BLAS. Build and install rocblas-bench. diff --git a/sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild b/sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild new file mode 100644 index 0000000000000..fed17e82b14e1 --- /dev/null +++ b/sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DOCS_BUILDER="doxygen" +DOCS_DIR="docs/.doxygen" +DOCS_DEPEND="media-gfx/graphviz" +ROCM_VERSION=${PV} +inherit cmake docs edo multiprocessing rocm + +DESCRIPTION="AMD's library for BLAS on ROCm" +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS" +SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz" +S="${WORKDIR}/${PN}-rocm-${PV}" + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="benchmark test" +RESTRICT="!test? ( test )" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +BDEPEND=" + >=dev-build/rocm-cmake-5.3 + dev-util/Tensile:${SLOT} + dev-python/joblib + test? ( dev-cpp/gtest ) +" + +DEPEND=" + >=dev-cpp/msgpack-cxx-6.0.0 + =dev-util/hip-6* + test? ( + virtual/blas + dev-cpp/gtest + sys-libs/libomp + ) + benchmark? ( + virtual/blas + sys-libs/libomp + ) +" + +QA_FLAGS_IGNORED="/usr/lib64/rocblas/library/.*" + +PATCHES=( + "${FILESDIR}"/${PN}-5.4.2-cpp_lib_filesystem.patch + "${FILESDIR}"/${PN}-5.4.2-add-missing-header.patch + "${FILESDIR}"/${PN}-5.4.2-link-cblas.patch + "${FILESDIR}"/${PN}-6.0.2-expand-isa-compatibility.patch + ) + +src_prepare() { + cmake_src_prepare + sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die +} + +src_configure() { + addpredict /dev/random + addpredict /dev/kfd + addpredict /dev/dri/ + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DTensile_LOGIC="asm_full" + -DTensile_COMPILER="hipcc" + -DTensile_LIBRARY_FORMAT="msgpack" + -DTensile_CODE_OBJECT_VERSION="default" + -DTensile_ROOT="${EPREFIX}/usr/share/Tensile" + -DBUILD_WITH_TENSILE=ON + -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas" + -DBUILD_CLIENTS_SAMPLES=OFF + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) + -DTensile_CPU_THREADS=$(makeopts_jobs) + -DBUILD_WITH_PIP=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_compile() { + docs_compile + cmake_src_compile +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}"/clients/staging || die + export ROCBLAS_TEST_TIMEOUT=3600 ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" + export LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src" + edob ./${PN,,}-test +} + +src_install() { + cmake_src_install + + if use benchmark; then + cd "${BUILD_DIR}" || die + dolib.a clients/librocblas_fortran_client.a + dobin clients/staging/rocblas-bench + fi + + # Stop llvm-strip from removing .strtab section from *.hsaco files, + # otherwise rocclr/elf/elf.cpp complains with "failed: null sections(STRTAB)" and crashes + dostrip -x /usr/$(get_libdir)/rocblas/library/ +} From 0e8cea63782841bd2ab1476fd39c42a4233deb43 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 20 Mar 2024 12:01:46 +0000 Subject: [PATCH 36/45] sci-libs/hipSPARSE: add 6.1.1 Changes: * Drop configure fixes (not needed anymore) * Add myself to maintainers Signed-off-by: Sv. Lockal --- sci-libs/hipSPARSE/Manifest | 1 + sci-libs/hipSPARSE/hipSPARSE-6.1.1.ebuild | 86 +++++++++++++++++++++++ sci-libs/hipSPARSE/metadata.xml | 4 ++ 3 files changed, 91 insertions(+) create mode 100644 sci-libs/hipSPARSE/hipSPARSE-6.1.1.ebuild diff --git a/sci-libs/hipSPARSE/Manifest b/sci-libs/hipSPARSE/Manifest index 1876cfe32d71d..c38dc6c9f99c5 100644 --- a/sci-libs/hipSPARSE/Manifest +++ b/sci-libs/hipSPARSE/Manifest @@ -1,5 +1,6 @@ DIST hipSPARSE-5.1.tar.gz 449838 BLAKE2B 7727ecb9fa397e2730cfda4c9367188c37ad201d501b50129994869c6ef15b51cdf2d1f481f19f2f37cf0530f1ec3689c40a9651924f70fabe945d80732df64a SHA512 8b01c01a10b8419d14a532ebccfa5b5b5b5c3f6a6e73f3f0ecee58c7e240d2754485a9da020fe4693df3ef9fc08e5bb09b05396472ccbeebf89bc2635d94eb64 DIST hipSPARSE-5.7.tar.gz 458521 BLAKE2B 94695ef3cf4294f571723e31ab5d4295b5aaa24528e90838375ee8477cf0957b297663d80e5fe3406762b475b6ef4741f9ccfb4dfb1448ce71ea4014da14b46e SHA512 bb28cd81b7ec298eb2e6462a8588ed93eee7b4892923b11087a91d1c32341f29f488fd4e6797debe51a989f463db31030eae02d07be6512d6b755367ba221aac +DIST hipSPARSE-6.1.tar.gz 471148 BLAKE2B 18119ac355e180adb5ce38561f44e39119226d209a970ae8cac6b85575bad1ab2a690a3bb72de1c179c1190aa2c29d691e6ce02855f3df89a58f634d42e54103 SHA512 09f9e94c5f976e6f17c07f9be2fde31c2e740871215a6b77b49675644b883bd9994fcaacb19864ace3883bb5aea7a7dc589ddbaf9b6aaf3d9f411c7e452a0b78 DIST rocSPARSE_ASIC_320k.tar.gz 11301444 BLAKE2B a00cc4a3ededab3fb56339319e34e936645ddce2dee3c630153b37e337384c207b0a2829227fb7f4c2db1fe33383e97410ab7ad459d391c025f5410843d51cf2 SHA512 1db3af391c30a371c1ac0087436e266721474273a39d5b2b6d56408d950dcbbee004750e4dce4e3dbc4cb512f38f6d945676d7f29b62c52fd5a7fed0fe789e03 DIST rocSPARSE_Chebyshev4.tar.gz 50165660 BLAKE2B f1a95554c8f38937f501488fabfd406b773eb980d7463cadac0de162529ac2f834c655cadd2b65f4c42a8487bc2d67c749601ae33bd789051f9e4d1e157196a0 SHA512 fdec4947a4af923d28b4be8d23690fd6d356c58f8344a5dcdd2e3fa61769d83e47a84d65316b527e6e82d9f988de2675a852367d406e44b44d784137a90b95c0 DIST rocSPARSE_amazon0312.tar.gz 11303646 BLAKE2B 388947a29380253bb5eecb22d3a3b6f3378711044b3fe98d6d2517cd27330f11b3d12fdb96320a2889e139224f1a6a5ad1c455ff8e91a262aa2aadbe16301330 SHA512 aed2d62581763742d9c7faf3dcaf1eaa983caa1e2e7ad4abebe97c5e7c2aec9942e0e32291092b348b60052c92b130e721ec19ed59bda22e1b233ef72ac7d2ff diff --git a/sci-libs/hipSPARSE/hipSPARSE-6.1.1.ebuild b/sci-libs/hipSPARSE/hipSPARSE-6.1.1.ebuild new file mode 100644 index 0000000000000..46d70c4b6625d --- /dev/null +++ b/sci-libs/hipSPARSE/hipSPARSE-6.1.1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake edo rocm toolchain-funcs + +DESCRIPTION="ROCm SPARSE marshalling library" +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/hipSPARSE" +# share some test datasets with rocSPARSE +SRC_URI="https://github.com/ROCmSoftwarePlatform/hipSPARSE/archive/rocm-${PV}.tar.gz -> hipSPARSE-$(ver_cut 1-2).tar.gz +test? ( +https://sparse.tamu.edu/MM/SNAP/amazon0312.tar.gz -> rocSPARSE_amazon0312.tar.gz +https://sparse.tamu.edu/MM/Muite/Chebyshev4.tar.gz -> rocSPARSE_Chebyshev4.tar.gz +https://sparse.tamu.edu/MM/FEMLAB/sme3Dc.tar.gz -> rocSPARSE_sme3Dc.tar.gz +https://sparse.tamu.edu/MM/Williams/webbase-1M.tar.gz -> rocSPARSE_webbase-1M.tar.gz +https://sparse.tamu.edu/MM/Bova/rma10.tar.gz -> rocSPARSE_rma10.tar.gz +https://sparse.tamu.edu/MM/JGD_BIBD/bibd_22_8.tar.gz -> rocSPARSE_bibd_22_8.tar.gz +https://sparse.tamu.edu/MM/Williams/mac_econ_fwd500.tar.gz -> rocSPARSE_mac_econ_fwd500.tar.gz +https://sparse.tamu.edu/MM/Williams/mc2depi.tar.gz -> rocSPARSE_mc2depi.tar.gz +https://sparse.tamu.edu/MM/Hamm/scircuit.tar.gz -> rocSPARSE_scircuit.tar.gz +https://sparse.tamu.edu/MM/Sandia/ASIC_320k.tar.gz -> rocSPARSE_ASIC_320k.tar.gz +https://sparse.tamu.edu/MM/GHS_psdef/bmwcra_1.tar.gz -> rocSPARSE_bmwcra_1.tar.gz +https://sparse.tamu.edu/MM/HB/nos1.tar.gz -> rocSPARSE_nos1.tar.gz +https://sparse.tamu.edu/MM/HB/nos2.tar.gz -> rocSPARSE_nos2.tar.gz +https://sparse.tamu.edu/MM/HB/nos3.tar.gz -> rocSPARSE_nos3.tar.gz +https://sparse.tamu.edu/MM/HB/nos4.tar.gz -> rocSPARSE_nos4.tar.gz +https://sparse.tamu.edu/MM/HB/nos5.tar.gz -> rocSPARSE_nos5.tar.gz +https://sparse.tamu.edu/MM/HB/nos6.tar.gz -> rocSPARSE_nos6.tar.gz +https://sparse.tamu.edu/MM/HB/nos7.tar.gz -> rocSPARSE_nos7.tar.gz +https://sparse.tamu.edu/MM/DNVS/shipsec1.tar.gz -> rocSPARSE_shipsec1.tar.gz +)" +S="${WORKDIR}/hipSPARSE-rocm-${PV}" + +LICENSE="MIT" +SLOT="0"/$(ver_cut 1-2) +KEYWORDS="~amd64" +IUSE="test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +RESTRICT="!test? ( test )" + +RDEPEND="dev-util/rocminfo + dev-util/hip + sci-libs/rocSPARSE:${SLOT}[${ROCM_USEDEP}]" +DEPEND="${RDEPEND}" +BDEPEND="dev-build/rocm-cmake + >=dev-build/cmake-3.22 + test? ( dev-cpp/gtest )" + +src_prepare() { + cmake_src_prepare + + if use test; then + mkdir -p "${BUILD_DIR}"/clients/matrices + # compile and use the mtx2bin converter. Do not use any optimization flags! + edo $(tc-getCXX) deps/convert.cpp -o deps/convert + find "${WORKDIR}" -maxdepth 2 -regextype grep -E -regex ".*/(.*)/\1\.mtx" -print0 | + while IFS= read -r -d '' mtxfile; do + destination=${BUILD_DIR}/clients/matrices/$(basename -s '.mtx' ${mtxfile}).bin + ebegin "Converting ${mtxfile} to ${destination}" + deps/convert ${mtxfile} ${destination} + eend $? + done + fi +} + +src_configure() { + local mycmakeargs=( + -DHIP_RUNTIME="ROCclr" + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + -DBUILD_CLIENTS_SAMPLES=OFF + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + + cmake_src_configure +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}"/clients/staging || die + edob ./${PN,,}-test +} diff --git a/sci-libs/hipSPARSE/metadata.xml b/sci-libs/hipSPARSE/metadata.xml index 693bc03ef766d..db85e1426e8f8 100644 --- a/sci-libs/hipSPARSE/metadata.xml +++ b/sci-libs/hipSPARSE/metadata.xml @@ -13,6 +13,10 @@ gentoo@holzke.net Wilfried Holzke + + lockalsash@gmail.com + Sv. Lockal + ROCmSoftwarePlatform/hipSPARSE From c6520fd41ad747eb4760fbf49d45262cdeb0de58 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 20 Mar 2024 12:06:34 +0000 Subject: [PATCH 37/45] sci-libs/hipSOLVER: add 6.1.1 Signed-off-by: Sv. Lockal --- sci-libs/hipSOLVER/Manifest | 1 + .../files/hipSOLVER-6.1.1-find-cholmod.patch | 29 ++++++++++++ sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild | 47 +++++++++++++++++++ sci-libs/hipSOLVER/metadata.xml | 3 ++ 4 files changed, 80 insertions(+) create mode 100644 sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch create mode 100644 sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild diff --git a/sci-libs/hipSOLVER/Manifest b/sci-libs/hipSOLVER/Manifest index 44e9bd41301ad..bb01207f1e209 100644 --- a/sci-libs/hipSOLVER/Manifest +++ b/sci-libs/hipSOLVER/Manifest @@ -1 +1,2 @@ DIST hipSOLVER-rocm-5.7.1.tar.gz 1516012 BLAKE2B 8d0966d34877978784b9872150283719602465c85036c3a74a72a2fe7c516b6029af3f4aefbc022088b2cf37bb1e0a450c0221aef0ac3227018020de340adfcd SHA512 f9c14b51ea582f17d1b323c7d066d9c0c95f4250f08515768d7a11067774fd2841fa3dec7354d3c98e56bd8dd53cff3b993c68b1d7df4b24f562b3afe9c4625e +DIST hipSOLVER-rocm-6.1.1.tar.gz 2553462 BLAKE2B 77731b876a7fe5f80f79e5af5128a84d8a5d4dee6d511f3e1cf4964845b636380f7f1e19f07e84ed24b98e99c3bdfbba623b97b48cf4ea1bc09a4c1bd3dccaed SHA512 4f28ecd807717013318f293df8c48d7674f64fd3a538c2b827f4188a00a36165f48277d5ac50e806461d52a8a3b6d626cab91ff7c6687b17fea2580461e08de9 diff --git a/sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch b/sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch new file mode 100644 index 0000000000000..da43f4ff116bd --- /dev/null +++ b/sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch @@ -0,0 +1,29 @@ +cholmod.h is in /usr/include in Gentoo, use pkg-config to find it +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -221,11 +221,9 @@ if( NOT USE_CUDA ) + if( BUILD_WITH_SPARSE ) + list(APPEND hipsolver_pkgdeps "rocsparse >= 2.3.0") + +- if( SYSTEM_OS STREQUAL "centos" OR SYSTEM_OS STREQUAL "rhel" ) +- list(APPEND hipsolver_pkgdeps "suitesparse") +- else() +- list(APPEND hipsolver_pkgdeps "libcholmod3" "libsuitesparseconfig5") +- endif() ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(CHOLMOD REQUIRED IMPORTED_TARGET cholmod) ++ target_link_libraries(hipsolver-common INTERFACE PkgConfig::CHOLMOD) + endif( ) + + rocm_package_add_dependencies(DEPENDS ${hipsolver_pkgdeps}) +--- a/library/src/amd_detail/hipsolver_sparse.cpp ++++ b/library/src/amd_detail/hipsolver_sparse.cpp +@@ -45,7 +45,7 @@ + + #ifdef HAVE_ROCSPARSE + #include +-#include ++#include + #endif + + #undef TRUE diff --git a/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild b/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild new file mode 100644 index 0000000000000..be450babaed38 --- /dev/null +++ b/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="CU / ROCM agnostic marshalling library for LAPACK routines on the GPU" +HOMEPAGE="https://github.com/ROCm/hipSOLVER" +SRC_URI="https://github.com/ROCm/hipSOLVER/archive/refs/tags/rocm-${PV}.tar.gz -> hipSOLVER-rocm-${PV}.tar.gz" +S="${WORKDIR}/hipSOLVER-rocm-${PV}" + +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" +IUSE="sparse" + +RESTRICT="test" + +RDEPEND=" + dev-util/hip + sci-libs/rocSOLVER:${SLOT}[${ROCM_USEDEP}] + sparse? ( + sci-libs/suitesparseconfig + sci-libs/cholmod + ) +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-find-cholmod.patch +) + +src_configure() { + local mycmakeargs=( + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_WITH_SPARSE=$(usex sparse ON OFF) + ) + + CXX=hipcc cmake_src_configure +} diff --git a/sci-libs/hipSOLVER/metadata.xml b/sci-libs/hipSOLVER/metadata.xml index dfd45574f2168..9aa1438b519ca 100644 --- a/sci-libs/hipSOLVER/metadata.xml +++ b/sci-libs/hipSOLVER/metadata.xml @@ -16,4 +16,7 @@ ROCmSoftwarePlatform/hipSOLVER + + Build hipSOLVER with sparse functionality (sci-libs/cholmod) + From 1adba4d8cdfa7ec2e9ff5ccefc422e58bd57a274 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 20 Mar 2024 12:32:43 +0000 Subject: [PATCH 38/45] sci-libs/caffe2: limit rocm libs to 5.7*. 6.0 will be only in >=caffe2-2.3.0 Signed-off-by: Sv. Lockal --- sci-libs/caffe2/caffe2-2.1.2-r7.ebuild | 24 ++++++++++++------------ sci-libs/caffe2/caffe2-2.2.2-r1.ebuild | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sci-libs/caffe2/caffe2-2.1.2-r7.ebuild b/sci-libs/caffe2/caffe2-2.1.2-r7.ebuild index 8198f516b251d..01d23f32c4ba3 100644 --- a/sci-libs/caffe2/caffe2-2.1.2-r7.ebuild +++ b/sci-libs/caffe2/caffe2-2.1.2-r7.ebuild @@ -65,18 +65,18 @@ RDEPEND=" opencv? ( media-libs/opencv:= ) qnnpack? ( sci-libs/QNNPACK ) rocm? ( - >=dev-util/hip-5.7 - >=dev-libs/rccl-5.7[${ROCM_USEDEP}] - >=sci-libs/rocThrust-5.7[${ROCM_USEDEP}] - >=sci-libs/rocPRIM-5.7[${ROCM_USEDEP}] - >=sci-libs/hipBLAS-5.7[${ROCM_USEDEP}] - >=sci-libs/hipFFT-5.7[${ROCM_USEDEP}] - >=sci-libs/hipSPARSE-5.7[${ROCM_USEDEP}] - >=sci-libs/hipRAND-5.7[${ROCM_USEDEP}] - >=sci-libs/hipCUB-5.7[${ROCM_USEDEP}] - >=sci-libs/hipSOLVER-5.7[${ROCM_USEDEP}] - >=sci-libs/miopen-5.7[${ROCM_USEDEP}] - >=dev-util/roctracer-5.7[${ROCM_USEDEP}] + =dev-util/hip-5.7* + =dev-libs/rccl-5.7*[${ROCM_USEDEP}] + =sci-libs/rocThrust-5.7*[${ROCM_USEDEP}] + =sci-libs/rocPRIM-5.7*[${ROCM_USEDEP}] + =sci-libs/hipBLAS-5.7*[${ROCM_USEDEP}] + =sci-libs/hipFFT-5.7*[${ROCM_USEDEP}] + =sci-libs/hipSPARSE-5.7*[${ROCM_USEDEP}] + =sci-libs/hipRAND-5.7*[${ROCM_USEDEP}] + =sci-libs/hipCUB-5.7*[${ROCM_USEDEP}] + =sci-libs/hipSOLVER-5.7*[${ROCM_USEDEP}] + =sci-libs/miopen-5.7*[${ROCM_USEDEP}] + =dev-util/roctracer-5.7*[${ROCM_USEDEP}] ) tensorpipe? ( sci-libs/tensorpipe[cuda?] ) xnnpack? ( >=sci-libs/XNNPACK-2022.12.22 ) diff --git a/sci-libs/caffe2/caffe2-2.2.2-r1.ebuild b/sci-libs/caffe2/caffe2-2.2.2-r1.ebuild index cd3d8757daa61..6649975ddf2d3 100644 --- a/sci-libs/caffe2/caffe2-2.2.2-r1.ebuild +++ b/sci-libs/caffe2/caffe2-2.2.2-r1.ebuild @@ -62,18 +62,18 @@ RDEPEND=" opencv? ( media-libs/opencv:= ) qnnpack? ( sci-libs/QNNPACK ) rocm? ( - >=dev-util/hip-5.7 - >=dev-libs/rccl-5.7[${ROCM_USEDEP}] - >=sci-libs/rocThrust-5.7[${ROCM_USEDEP}] - >=sci-libs/rocPRIM-5.7[${ROCM_USEDEP}] - >=sci-libs/hipBLAS-5.7[${ROCM_USEDEP}] - >=sci-libs/hipFFT-5.7[${ROCM_USEDEP}] - >=sci-libs/hipSPARSE-5.7[${ROCM_USEDEP}] - >=sci-libs/hipRAND-5.7[${ROCM_USEDEP}] - >=sci-libs/hipCUB-5.7[${ROCM_USEDEP}] - >=sci-libs/hipSOLVER-5.7[${ROCM_USEDEP}] - >=sci-libs/miopen-5.7[${ROCM_USEDEP}] - >=dev-util/roctracer-5.7[${ROCM_USEDEP}] + =dev-util/hip-5.7* + =dev-libs/rccl-5.7*[${ROCM_USEDEP}] + =sci-libs/rocThrust-5.7*[${ROCM_USEDEP}] + =sci-libs/rocPRIM-5.7*[${ROCM_USEDEP}] + =sci-libs/hipBLAS-5.7*[${ROCM_USEDEP}] + =sci-libs/hipFFT-5.7*[${ROCM_USEDEP}] + =sci-libs/hipSPARSE-5.7*[${ROCM_USEDEP}] + =sci-libs/hipRAND-5.7*[${ROCM_USEDEP}] + =sci-libs/hipCUB-5.7*[${ROCM_USEDEP}] + =sci-libs/hipSOLVER-5.7*[${ROCM_USEDEP}] + =sci-libs/miopen-5.7*[${ROCM_USEDEP}] + =dev-util/roctracer-5.7*[${ROCM_USEDEP}] ) distributed? ( sci-libs/tensorpipe[cuda?] ) xnnpack? ( >=sci-libs/XNNPACK-2022.12.22 ) From e60c2528bd2b3f4c3aebc21bd65739405573b70c Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sun, 24 Mar 2024 19:17:45 +0000 Subject: [PATCH 39/45] dev-util/rocminfo: Fix "SyntaxWarning: invalid escape sequence" with python 3.12+ Upstream bug: https://github.com/ROCm/rocminfo/issues/69 Signed-off-by: Sv. Lockal --- .../rocminfo-6.0.0-python-3-12-support.patch | 34 +++++++++++++++++++ ...-6.0.0.ebuild => rocminfo-6.0.0-r1.ebuild} | 11 +++--- 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch rename dev-util/rocminfo/{rocminfo-6.0.0.ebuild => rocminfo-6.0.0-r1.ebuild} (76%) diff --git a/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch b/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch new file mode 100644 index 0000000000000..2b14e42e4705e --- /dev/null +++ b/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch @@ -0,0 +1,34 @@ +Fix "SyntaxWarning: invalid escape sequence" SyntaxWarning in python 3.12+ +Bug: https://github.com/ROCm/rocminfo/issues/69 +--- a/rocm_agent_enumerator ++++ b/rocm_agent_enumerator +@@ -92,7 +92,7 @@ def getGCNISA(line, match_from_beginning = False): + return result.group(0) + return None + +-@staticVars(search_name=re.compile("gfx[0-9a-fA-F]+(:[-+:\w]+)?")) ++@staticVars(search_name=re.compile(r"gfx[0-9a-fA-F]+(:[-+:\w]+)?")) + def getGCNArchName(line): + result = getGCNArchName.search_name.search(line) + +@@ -149,9 +149,9 @@ def readFromROCMINFO(search_arch_name = False): + + # search AMDGCN gfx ISA + if search_arch_name is True: +- line_search_term = re.compile("\A\s+Name:\s+(amdgcn-amd-amdhsa--gfx\d+)") ++ line_search_term = re.compile(r"\A\s+Name:\s+(amdgcn-amd-amdhsa--gfx\d+)") + else: +- line_search_term = re.compile("\A\s+Name:\s+(gfx\d+)") ++ line_search_term = re.compile(r"\A\s+Name:\s+(gfx\d+)") + for line in rocminfo_output: + if line_search_term.match(line) is not None: + if search_arch_name is True: +@@ -172,7 +172,7 @@ def readFromLSPCI(): + except: + lspci_output = [] + +- target_search_term = re.compile("1002:\w+") ++ target_search_term = re.compile(r"1002:\w+") + for line in lspci_output: + search_result = target_search_term.search(line) + if search_result is not None: diff --git a/dev-util/rocminfo/rocminfo-6.0.0.ebuild b/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild similarity index 76% rename from dev-util/rocminfo/rocminfo-6.0.0.ebuild rename to dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild index 296b859a1fd3e..6304f3b430da2 100644 --- a/dev-util/rocminfo/rocminfo-6.0.0.ebuild +++ b/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -22,13 +22,14 @@ SLOT="0/$(ver_cut 1-2)" RDEPEND=">=dev-libs/rocr-runtime-${PV}" DEPEND="${RDEPEND}" -#PATCHES=( -# "${FILESDIR}/${PN}-5.5.1-detect-builtin-amdgpu.patch" -#) +PATCHES=( + "${FILESDIR}/${PN}-6.0.0-python-3-12-support.patch" +) src_prepare() { sed -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i CMakeLists.txt || die - sed -e "/num_change_since_prev_pkg(/cset(NUM_COMMITS 0)" -i cmake_modules/utils.cmake || die # Fix QA issue on "git not found" + sed -e "/num_change_since_prev_pkg(/cset(NUM_COMMITS 0)" \ + -i cmake_modules/utils.cmake || die # Fix QA issue on "git not found" cmake_src_prepare } From 35128b336a20d2fcf27865eca9a041b61e61fe23 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:23:49 +0000 Subject: [PATCH 40/45] dev-util/rocminfo: add 6.1.0, drop 6.0.0-r1 Signed-off-by: Sv. Lockal --- dev-util/rocminfo/Manifest | 2 +- ...rocminfo-6.0.0-detect-builtin-amdgpu.patch | 33 +++++++++++++++++++ ...-6.0.0-r1.ebuild => rocminfo-6.1.0.ebuild} | 21 ++++++++---- 3 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 dev-util/rocminfo/files/rocminfo-6.0.0-detect-builtin-amdgpu.patch rename dev-util/rocminfo/{rocminfo-6.0.0-r1.ebuild => rocminfo-6.1.0.ebuild} (54%) diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest index b4888c9bbca0d..8087026be77d8 100644 --- a/dev-util/rocminfo/Manifest +++ b/dev-util/rocminfo/Manifest @@ -3,4 +3,4 @@ DIST rocminfo-5.3.3.tar.gz 16829 BLAKE2B 341908048b9726a22ab5e81317916166d4ba114 DIST rocminfo-5.4.3.tar.gz 16832 BLAKE2B 2344b6bd3ffecdfa657559e4d4d8c09de862ebcda287fd67db9864d19aab0a928b071bc43ddd4a24a31037c61500b1bb9697d11b3031c860c5bac77392c664ef SHA512 80221c91f56cd04ba8dcbddd53bb47cb57bb97b74102890a7a43203e9a2fd572762025feb65676774f774a9a5f0d0a1293fc4508fc82d21b6b4042ad92210096 DIST rocminfo-5.5.1.tar.gz 17020 BLAKE2B 42fdbd32b7092306dc4442910ae922b616c859439511e2acfb17dee32557d77a9731aeb1d7ce25d32ae76f9cafd1e56476ac522545efe516d238d9285fa7b4a3 SHA512 5710979ee885bf35d40b7d07b157226ea4bb84bd14a2c57bdf8c93ca483685a8ce39d01f15b828d015968102457e9a94335a5273524d98eca76d0f8ceed2e8c1 DIST rocminfo-5.7.1.tar.gz 17302 BLAKE2B 395c695ed0b79c771c4240310c457aec893ffd889ddd551866753d2a0c8d4e98399672d74a7114a89faf8b1960dd54fbb0425ea00f7d15e5c740e33ce4046d0b SHA512 38726bc52bd045b6281cccd702706fd6ea5b57cdc421ad23106d5447a002f4b530e8d4e4430d2bb8eb30803af3bacdaf34646a965cea26f42d726bf7f6aafbab -DIST rocminfo-6.0.0.tar.gz 17614 BLAKE2B f296d43103062c492c3a13a8f79a70ebe719126136abe38b020035f0e31819b9b25928aa538416ec9cc733a4e352e83fe8550d15c10f8071b7f889b361814fa6 SHA512 66de2e84b78f69a0c7d302e5432b08874374a45f7d577b158f23abbb40455c574868a7093e64c3a7d19e21dd13b48865a36bd626ef34b99ce52f3363bbb261a7 +DIST rocminfo-6.1.0.tar.gz 17734 BLAKE2B 3606c74b7b097a623175789e0ece4718da919bfdcc1b2852988d22ee67e036debbeba890e0667cb1ac2fb9ae3de05841a29fcf122a2feeed493bcdcbed021eea SHA512 417aad1bd65f056c43d264a5d0b62aa4c3b20ac4869a71efd5e6fa94a1cd4773112e75e1479efeae9342b8c222caba45213c75f1e8b8ece640bd47c934ace324 diff --git a/dev-util/rocminfo/files/rocminfo-6.0.0-detect-builtin-amdgpu.patch b/dev-util/rocminfo/files/rocminfo-6.0.0-detect-builtin-amdgpu.patch new file mode 100644 index 0000000000000..38bf547140a9c --- /dev/null +++ b/dev-util/rocminfo/files/rocminfo-6.0.0-detect-builtin-amdgpu.patch @@ -0,0 +1,33 @@ +https://github.com/ROCm/rocminfo/pull/65 +From: YiyangWu +Date: Wed, 18 Aug 2021 21:05:20 +0800 +Subject: [PATCH] Check /sys/module/amdgpu for ROCk instead of lsmod + +Closes: #42 + +Signed-off-by: YiyangWu +--- + rocminfo.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/rocminfo.cc b/rocminfo.cc +index 8ed9111..78b3afd 100755 +--- a/rocminfo.cc ++++ b/rocminfo.cc +@@ -1063,9 +1063,14 @@ int CheckInitialState(void) { + return -1; + } + } else { +- printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n", ++ int module_dir; ++ module_dir = open("/sys/module/amdgpu", O_DIRECTORY); ++ if (module_dir < 0) { ++ printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n", + COL_RED, COL_RESET); +- return -1; ++ return -1; ++ } ++ close(module_dir); + } + + // Check if user belongs to the group for /dev/kfd (e.g. "video" or \ No newline at end of file diff --git a/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild b/dev-util/rocminfo/rocminfo-6.1.0.ebuild similarity index 54% rename from dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild rename to dev-util/rocminfo/rocminfo-6.1.0.ebuild index 6304f3b430da2..90ec124928f31 100644 --- a/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild +++ b/dev-util/rocminfo/rocminfo-6.1.0.ebuild @@ -3,27 +3,30 @@ EAPI=8 -inherit cmake +PYTHON_COMPAT=( python3_{11..12} ) +inherit cmake python-r1 if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/" + EGIT_REPO_URI="https://github.com/ROCm/rocminfo/" inherit git-r3 else - SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI="https://github.com/ROCm/rocminfo/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64" S="${WORKDIR}/rocminfo-rocm-${PV}" fi DESCRIPTION="ROCm Application for Reporting System Info" -HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo" +HOMEPAGE="https://github.com/ROCm/rocminfo" LICENSE="UoI-NCSA" SLOT="0/$(ver_cut 1-2)" -RDEPEND=">=dev-libs/rocr-runtime-${PV}" +RDEPEND=">=dev-libs/rocr-runtime-${PV} + ${PYTHON_DEPS}" DEPEND="${RDEPEND}" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" PATCHES=( - "${FILESDIR}/${PN}-6.0.0-python-3-12-support.patch" + "${FILESDIR}/${PN}-6.0.0-detect-builtin-amdgpu.patch" ) src_prepare() { @@ -37,3 +40,9 @@ src_configure() { local mycmakeargs=( -DROCRTST_BLD_TYPE=Release ) cmake_src_configure } + +src_install() { + cmake_src_install + rm "${ED}/usr/bin/rocm_agent_enumerator" || die + python_foreach_impl python_doexe rocm_agent_enumerator "${BUILD_DIR}"/rocm_agent_enumerator +} From ab1e4bb3fece6fbad2527467a9456099e6d8e85a Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Tue, 19 Mar 2024 18:55:15 +0000 Subject: [PATCH 41/45] profiles: unmask ROCm-6 Signed-off-by: Sv. Lockal --- profiles/package.mask | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/profiles/package.mask b/profiles/package.mask index 4a674cf9ae953..c82aba2ed4f97 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -811,17 +811,6 @@ sec-keys/openpgp-keys-jiatan # Test failure in watchpoints.dem, undefined function FresnelC. ~sci-visualization/gnuplot-6.0.0 -# Patrick Lauer (2023-12-23) -# ROCm-6 builds but has runtime issues for me ->=dev-libs/roct-thunk-interface-6.0.0 ->=dev-libs/rocr-runtime-6.0.0 ->=dev-libs/rocm-comgr-6.0.0 ->=dev-libs/rocm-device-libs-6.0.0 ->=dev-libs/rocm-opencl-runtime-6.0.0 ->=dev-util/hipcc-6.0.0 ->=dev-util/hip-6.0.0 ->=dev-util/rocminfo-6.0.0 - # Sam James (2023-12-14) # Gentoo's kernel maintainers have decided to discontinue gentoo-sources and # gentoo-kernel for old kernel LTS branches because of the resources to require From f5f026b3277cd0258e38a1d53adc70c36af059f1 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 20 Mar 2024 13:35:04 +0000 Subject: [PATCH 42/45] dev-libs/hipother: new package, add 6.1.1 Signed-off-by: Sv. Lockal --- dev-libs/hipother/Manifest | 1 + dev-libs/hipother/hipother-6.1.1.ebuild | 18 ++++++++++++++++++ dev-libs/hipother/metadata.xml | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 dev-libs/hipother/Manifest create mode 100644 dev-libs/hipother/hipother-6.1.1.ebuild create mode 100644 dev-libs/hipother/metadata.xml diff --git a/dev-libs/hipother/Manifest b/dev-libs/hipother/Manifest new file mode 100644 index 0000000000000..0c54674e72c0a --- /dev/null +++ b/dev-libs/hipother/Manifest @@ -0,0 +1 @@ +DIST hipother-6.1.1.tar.gz 33496 BLAKE2B 026967cb298a888df441d543d70478836036b81dc26c8284410076daf18eb28dc42f7d4b6aaf2bfaa8b6c957ada8244afc0e7c40882c0370bc2b6a0ae94ffaf8 SHA512 ca4d5df9e3138e845be051aace8fb02d84b879439e6bc9ca1551853f80f54b554b9cad1a91c6c114160b21d3ca62fa47a88e32efe60c0f475ff8b56f7f18b5d4 diff --git a/dev-libs/hipother/hipother-6.1.1.ebuild b/dev-libs/hipother/hipother-6.1.1.ebuild new file mode 100644 index 0000000000000..843fa3cbbe4b5 --- /dev/null +++ b/dev-libs/hipother/hipother-6.1.1.ebuild @@ -0,0 +1,18 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="ROCclr runtime implementation for non-AMD HIP platforms, like NVIDIA" +HOMEPAGE="https://github.com/ROCm/hipother" +SRC_URI="https://github.com/ROCm/hipother/archive/refs/tags/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/hipother-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1)" +KEYWORDS="~amd64" + +src_install() { + insinto /usr/include + doins -r hipnv/include/hip +} diff --git a/dev-libs/hipother/metadata.xml b/dev-libs/hipother/metadata.xml new file mode 100644 index 0000000000000..9d92b0b0e73f5 --- /dev/null +++ b/dev-libs/hipother/metadata.xml @@ -0,0 +1,14 @@ + + + + + sci@gentoo.org + + + lockalsash@gmail.com + Sv. Lockal + + + ROCm/hipother + + From ad7ac90869c5b84fc2be7a5364e8acb28765e22f Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 20 Mar 2024 22:00:14 +0000 Subject: [PATCH 43/45] sci-libs/rpp: new package, add 6.1.1 Signed-off-by: Sv. Lockal --- sci-libs/rpp/Manifest | 1 + .../rpp-6.1.1-skip-install-license.patch | 17 ++++ sci-libs/rpp/metadata.xml | 14 +++ sci-libs/rpp/rpp-6.1.1.ebuild | 91 +++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 sci-libs/rpp/Manifest create mode 100644 sci-libs/rpp/files/rpp-6.1.1-skip-install-license.patch create mode 100644 sci-libs/rpp/metadata.xml create mode 100644 sci-libs/rpp/rpp-6.1.1.ebuild diff --git a/sci-libs/rpp/Manifest b/sci-libs/rpp/Manifest new file mode 100644 index 0000000000000..322ed39e26eac --- /dev/null +++ b/sci-libs/rpp/Manifest @@ -0,0 +1 @@ +DIST rpp-6.1.1.tar.gz 37016755 BLAKE2B 884090ab50e0a4a3aed4e52c5bbd934a8c5b62eca310471c30cf4c5a7cafdd36fed7894320b4d5246620b3c47e90fafd0f8160a7d4ed0295c7668c8d147f4b18 SHA512 a7c10bdd08739eba08209783decf0f4fd7c12194b9ebc63bd16e4cb998645110c089833efb83a77d4bed7f8599cf3a320608be28633f0dc956079f9d70e765f8 diff --git a/sci-libs/rpp/files/rpp-6.1.1-skip-install-license.patch b/sci-libs/rpp/files/rpp-6.1.1-skip-install-license.patch new file mode 100644 index 0000000000000..2253bb5aed67e --- /dev/null +++ b/sci-libs/rpp/files/rpp-6.1.1-skip-install-license.patch @@ -0,0 +1,17 @@ +Skip installation of license: it will be installed by ebuild to correct place +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -343,13 +343,6 @@ install(FILES ${PROJECT_BINARY_DIR}/include/rpp_backend.h + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test COMPONENT test) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utilities/test_suite/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test COMPONENT test) + +-# set license information +-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT runtime) +-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-asan COMPONENT asan) +-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-dev COMPONENT dev) +-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-test COMPONENT test) +- + # CTest - Needs RPP Installed + enable_testing() + include(CTest) diff --git a/sci-libs/rpp/metadata.xml b/sci-libs/rpp/metadata.xml new file mode 100644 index 0000000000000..944efd1831772 --- /dev/null +++ b/sci-libs/rpp/metadata.xml @@ -0,0 +1,14 @@ + + + + + sci@gentoo.org + + + lockalsash@gmail.com + Sv. Lockal + + + ROCm/rpp + + diff --git a/sci-libs/rpp/rpp-6.1.1.ebuild b/sci-libs/rpp/rpp-6.1.1.ebuild new file mode 100644 index 0000000000000..d38645f9ff56a --- /dev/null +++ b/sci-libs/rpp/rpp-6.1.1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake flag-o-matic rocm + +DESCRIPTION="AMD ROCm Performance Primitives (RPP) high-performance computer vision library" +HOMEPAGE="https://github.com/ROCm/rpp" +SRC_URI="https://github.com/ROCm/rpp/archive/refs/tags/rocm-${PV}.tar.gz -> rpp-${PV}.tar.gz" +S="${WORKDIR}/${PN}-rocm-${PV}" + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +# pkgcheck warning: RequiredUseDefaults +REQUIRED_USE=" + cpu_flags_x86_avx2 cpu_flags_x86_fma3 cpu_flags_x86_f16c + ${ROCM_REQUIRED_USE} +" + +RDEPEND=" + dev-util/hip:${SLOT} +" +DEPEND="${RDEPEND}" +BDEPEND=" + >=dev-build/cmake-3.22 + >=dev-libs/half-1.12.0-r1 + test? ( dev-cpp/gtest ) +" + +IUSE="cpu_flags_x86_avx2 cpu_flags_x86_fma3 cpu_flags_x86_f16c test" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-skip-install-license.patch +) + +DOCS=( CHANGELOG.md LICENSE README.md ) + +rcc_test_wrapper() { + local S="${WORKDIR}/${PN}-rocm-${PV}/utilities/rpp-unittests/HIP_NEW" + local CMAKE_USE_DIR="${S}" + local BUILD_DIR="${BUILD_DIR}/utilities/rpp-unittests/HIP_NEW" + cd "${S}" || die + $@ +} + +src_prepare() { + sed -e "s:\${ROCM_PATH}/llvm/bin/clang++:hipcc:" \ + -i CMakeLists.txt || die + + cmake_src_prepare + use test && rcc_test_wrapper cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DROCM_PATH=/usr + -DBACKEND=HIP + -DBUILD_WITH_AMD_ADVANCE=OFF + ) + + cmake_src_configure + + if use test; then + append-cxxflags -I"${S}/include" + append-ldflags -L"${BUILD_DIR}/lib64" + local mycmakeargs=(-DROCM_PATH=/usr) + use test && rcc_test_wrapper cmake_src_configure + fi +} + +src_compile() { + cmake_src_compile + use test && rcc_test_wrapper cmake_src_compile +} + +src_test() { + check_amdgpu + + cd "${BUILD_DIR}"/utilities/rpp-unittests/HIP_NEW || die + for params in "0 0" "0 1" "1 1" "2 1" "5 1" "0 2" "0 3" "0 4" "0 5" "0 8"; do + LD_LIBRARY_PATH="${BUILD_DIR}"/lib64 ./uniqueFunctionalities_hip $params || die + done +} From 07254cd0f4ea42dd7167b35a686c3db6942c5856 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Sat, 30 Mar 2024 09:30:49 +0000 Subject: [PATCH 44/45] dev-libs/rocdbgapi: new package, add 5.7.1, 6.1.1 Signed-off-by: Sv. Lockal --- dev-libs/rocdbgapi/Manifest | 2 + dev-libs/rocdbgapi/metadata.xml | 15 ++++++ dev-libs/rocdbgapi/rocdbgapi-5.7.1.ebuild | 60 +++++++++++++++++++++ dev-libs/rocdbgapi/rocdbgapi-6.1.1.ebuild | 63 +++++++++++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 dev-libs/rocdbgapi/Manifest create mode 100644 dev-libs/rocdbgapi/metadata.xml create mode 100644 dev-libs/rocdbgapi/rocdbgapi-5.7.1.ebuild create mode 100644 dev-libs/rocdbgapi/rocdbgapi-6.1.1.ebuild diff --git a/dev-libs/rocdbgapi/Manifest b/dev-libs/rocdbgapi/Manifest new file mode 100644 index 0000000000000..9153f597bc1bf --- /dev/null +++ b/dev-libs/rocdbgapi/Manifest @@ -0,0 +1,2 @@ +DIST rocdbgapi-5.7.1.tar.gz 251913 BLAKE2B 96dc859937fdde75a3d68368b29efdd14711e256c7d3c60cd40b128e9a0c066f108c02f7d47d9d64d7ca485e85e9d56d48cac6c67088fc3fbafe44d1d23a7ce2 SHA512 e30cf6062b07ced7de1660398cd84d104e632907cfaf9bc05d29289a81a977c2272b69ff0810db201675f9d7e8476b4451c988ad9da0a13eee01fffdde839d26 +DIST rocdbgapi-6.1.1.tar.gz 254274 BLAKE2B 1621dc715e2540578126ff2fa6dc30dc9db711689e82b5c750dd203aafa091c00f897425a372d4617bec25eddb7b9a44105e8c9b46eb660e197602ede2beecba SHA512 d613e633e27ad9f582b9612d7d088c3ea465c29d6520e94b4821e0340c736e556dcd4a89f8027701097ee4e2d8b55640a232d484f9fa26f8a9165c648f8af219 diff --git a/dev-libs/rocdbgapi/metadata.xml b/dev-libs/rocdbgapi/metadata.xml new file mode 100644 index 0000000000000..696fb60c236ee --- /dev/null +++ b/dev-libs/rocdbgapi/metadata.xml @@ -0,0 +1,15 @@ + + + + + lockalsash@gmail.com + Sv. Lockal + + + proxy-maint@gentoo.org + Proxy Maintainers + + + ROCm/ROCdbgapi + + diff --git a/dev-libs/rocdbgapi/rocdbgapi-5.7.1.ebuild b/dev-libs/rocdbgapi/rocdbgapi-5.7.1.ebuild new file mode 100644 index 0000000000000..3573342f8b6f0 --- /dev/null +++ b/dev-libs/rocdbgapi/rocdbgapi-5.7.1.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="AMD Debugger API" +HOMEPAGE="https://github.com/ROCm/ROCdbgapi" +SRC_URI="https://github.com/ROCm/ROCdbgapi/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +KEYWORDS="~amd64" +SLOT="0/$(ver_cut 1-2)" + +IUSE="doc" + +BDEPEND=" + doc? ( + app-text/doxygen[dot] + virtual/latex-base + dev-texlive/texlive-latexextra + dev-texlive/texlive-plaingeneric + ) +" +RDEPEND=" + dev-libs/rocm-comgr:${SLOT} + dev-libs/rocr-runtime:${SLOT} +" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/ROCdbgapi-rocm-${PV}" + +src_prepare() { + sed -e "s/-Werror//" \ + -e "s/if(DOXYGEN_FOUND)/if(WITH_DOCS AND DOXYGEN_FOUND)/" \ + -e "s:\${CMAKE_INSTALL_DATADIR}/html/amd-dbgapi:\${CMAKE_INSTALL_DOCDIR}/html:" \ + -i CMakeLists.txt || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DWITH_DOCS=$(usex doc ON OFF) + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}" + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile + use doc && cmake_src_compile doc +} + +src_install() { + cmake_src_install + + # remove unneeded copy + rm -r "${ED}/usr/share/doc/${PF}-asan" || die +} diff --git a/dev-libs/rocdbgapi/rocdbgapi-6.1.1.ebuild b/dev-libs/rocdbgapi/rocdbgapi-6.1.1.ebuild new file mode 100644 index 0000000000000..eff59469418fd --- /dev/null +++ b/dev-libs/rocdbgapi/rocdbgapi-6.1.1.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="AMD Debugger API" +HOMEPAGE="https://github.com/ROCm/ROCdbgapi" +SRC_URI="https://github.com/ROCm/ROCdbgapi/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/ROCdbgapi-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="doc" + +BDEPEND=" + doc? ( + app-text/doxygen[dot] + virtual/latex-base + dev-texlive/texlive-latexextra + dev-texlive/texlive-plaingeneric + ) +" +RDEPEND=" + dev-libs/rocm-comgr:${SLOT} + dev-libs/rocr-runtime:${SLOT} +" +DEPEND="${RDEPEND}" + +src_prepare() { + sed -e "s/-Werror//" \ + -e "s/if(DOXYGEN_FOUND)/if(WITH_DOCS AND DOXYGEN_FOUND)/" \ + -e "s:\${CMAKE_INSTALL_DATADIR}/html/amd-dbgapi:\${CMAKE_INSTALL_DOCDIR}/html:" \ + -i CMakeLists.txt || die + + # Clang 19 detects error + # https://github.com/ROCm/ROCdbgapi/issues/12 + sed -e "s/->n_next/->m_next/g" -i src/utils.h || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DWITH_DOCS=$(usex doc ON OFF) + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}" + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile + use doc && cmake_src_compile doc +} + +src_install() { + cmake_src_install + + # remove unneeded copy + rm -r "${ED}/usr/share/doc/${PF}-asan" || die +} From 0fb67446ce4b67fd145f87a6ca9a0f1f3607b5a2 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 13 May 2024 14:01:53 +0000 Subject: [PATCH 45/45] sci-libs/hipBLASLt: new package, add 6.1.1 Signed-off-by: Sv. Lockal --- sci-libs/hipBLASLt/Manifest | 1 + .../files/hipBLASLt-6.1.1-clang-19.patch | 11 ++ ...pBLASLt-6.1.1-fix-msgpack-dependency.patch | 29 +++++ .../files/hipBLASLt-6.1.1-gentoopath.patch | 24 ++++ .../files/hipBLASLt-6.1.1-no-arch.patch | 56 +++++++++ .../files/hipBLASLt-6.1.1-no-git.patch | 13 ++ sci-libs/hipBLASLt/hipBLASLt-6.1.1.ebuild | 117 ++++++++++++++++++ sci-libs/hipBLASLt/metadata.xml | 14 +++ 8 files changed, 265 insertions(+) create mode 100644 sci-libs/hipBLASLt/Manifest create mode 100644 sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-clang-19.patch create mode 100644 sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-fix-msgpack-dependency.patch create mode 100644 sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-gentoopath.patch create mode 100644 sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-arch.patch create mode 100644 sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-git.patch create mode 100644 sci-libs/hipBLASLt/hipBLASLt-6.1.1.ebuild create mode 100644 sci-libs/hipBLASLt/metadata.xml diff --git a/sci-libs/hipBLASLt/Manifest b/sci-libs/hipBLASLt/Manifest new file mode 100644 index 0000000000000..83717bb68f79f --- /dev/null +++ b/sci-libs/hipBLASLt/Manifest @@ -0,0 +1 @@ +DIST hipBLASLt-6.1.1.tar.gz 78448557 BLAKE2B 08ac9ce45d7d1e4384a36939af22f65589ed87e25b4db77f5f7ff5fbe65b8070e9c55fbb09db3b7bd49be98981dc8bf939e646ea27571bf1d1ccfa52a50b0f92 SHA512 1aa3a1cb8e9c7f653db66909b38be065b7386b97d4bd6b52ecc6c2bf72c6cdfabde6f12ebc6016b5fa195f979359af875eda8d54ea6772329312cb357bc2ebc5 diff --git a/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-clang-19.patch b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-clang-19.patch new file mode 100644 index 0000000000000..5d082cc704b69 --- /dev/null +++ b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-clang-19.patch @@ -0,0 +1,11 @@ +Clang 19 is so smart, it can analyze templates before instantiation +--- a/tensilelite/Tensile/Source/lib/include/Tensile/MasterSolutionLibrary.hpp ++++ b/tensilelite/Tensile/Source/lib/include/Tensile/MasterSolutionLibrary.hpp +@@ -36,6 +36,7 @@ + + namespace Tensile + { ++ enum class LazyLoadingInit; + + /** + * \ingroup SolutionLibrary diff --git a/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-fix-msgpack-dependency.patch b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-fix-msgpack-dependency.patch new file mode 100644 index 0000000000000..ef0b8395c527e --- /dev/null +++ b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-fix-msgpack-dependency.patch @@ -0,0 +1,29 @@ +Gentoo uses "msgpack-cxx" as library name and adds important +MSGPACK_NO_BOOST compile definition when msgpack-cxx us installed with USE=-boost +--- a/tensilelite/Tensile/Source/lib/CMakeLists.txt ++++ b/tensilelite/Tensile/Source/lib/CMakeLists.txt +@@ -102,22 +102,9 @@ if(TENSILE_USE_LLVM OR TENSILE_USE_MSGPACK) + endif() + + if(TENSILE_USE_MSGPACK) +- find_package(msgpack REQUIRED) ++ find_package(msgpack-cxx REQUIRED) + target_compile_definitions(TensileHost PUBLIC -DTENSILE_MSGPACK=1) +- +- if(TARGET msgpackc-cxx) +- get_target_property(msgpack_inc msgpackc-cxx INTERFACE_INCLUDE_DIRECTORIES) +- elseif(TARGET msgpackc) +- get_target_property(msgpack_inc msgpackc INTERFACE_INCLUDE_DIRECTORIES) +- endif() +- +- if(DEFINED msgpack_inc) +- # include C++ headers manually +- # External header includes included as system files +- target_include_directories(TensileHost +- SYSTEM PRIVATE $ +- ) +- endif() ++ target_link_libraries(TensileHost PRIVATE msgpack-cxx) + endif() + + if(TENSILE_USE_LLVM) diff --git a/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-gentoopath.patch b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-gentoopath.patch new file mode 100644 index 0000000000000..17c5d9c534c0a --- /dev/null +++ b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-gentoopath.patch @@ -0,0 +1,24 @@ +--- a/tensilelite/Tensile/Ops/gen_assembly.sh ++++ b/tensilelite/Tensile/Ops/gen_assembly.sh +@@ -32,7 +32,7 @@ if ! [ -z ${ROCM_PATH+x} ]; then + rocm_path=${ROCM_PATH} + fi + +-toolchain=${rocm_path}/llvm/bin/clang++ ++toolchain=@LLVM_PATH@/bin/clang++ + + . ${venv}/bin/activate + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -97,10 +97,6 @@ endif() + # hipBLASLt project + project(hipblaslt LANGUAGES CXX) + +-# Force library install path to lib (CentOS 7 defaults to lib64) +-set(CMAKE_INSTALL_LIBDIR "lib" CACHE INTERNAL "Installation directory for libraries" FORCE) +- +- + # Build options + option(BUILD_SHARED_LIBS "Build hipBLASLt as a shared library" ON) + option(BUILD_CLIENTS_TESTS "Build tests (requires googletest)" OFF) diff --git a/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-arch.patch b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-arch.patch new file mode 100644 index 0000000000000..6bd608c94d0e7 --- /dev/null +++ b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-arch.patch @@ -0,0 +1,56 @@ +Add ability to build without specitying any arch. +This produces dummy library, which can be linked to other project (like caffe2 in pytorch). + +Related upstream bug: https://github.com/ROCm/hipBLASLt/issues/535 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -220,6 +220,10 @@ else() + else() + find_package(Tensile 4.33.0 EXACT REQUIRED HIP LLVM OpenMP PATHS "${INSTALLED_TENSILE_PATH}") + endif() ++ else() # link to Tensile (required), but don't generate libraries ++ cmake_policy(SET CMP0074 NEW) ++ set(Tensile_ROOT "${CMAKE_SOURCE_DIR}/tensilelite/Tensile") ++ find_package(Tensile REQUIRED HIP LLVM OpenMP) + endif() + + # setup hipblaslt defines used for both the library and clients +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -75,7 +75,7 @@ add_library(roc::hipblaslt ALIAS hipblaslt) + + # Target compile definitions + if(NOT BUILD_CUDA) +-if( BUILD_WITH_TENSILE ) ++if( TRUE ) # link with Tensile is always reqiured + + if( BUILD_SHARED_LIBS ) + target_link_libraries( hipblaslt PRIVATE TensileHost ) +@@ -194,7 +194,7 @@ rocm_install_targets(TARGETS hipblaslt + ${CMAKE_BINARY_DIR}/include + ) + +-if ( NOT BUILD_CUDA ) ++if ( NOT BUILD_CUDA AND BUILD_WITH_TENSILE ) + if (WIN32) + set( HIPBLASLT_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}hipblaslt/bin" CACHE PATH "path to tensile library" ) + else() +--- a/library/src/amd_detail/rocblaslt/src/CMakeLists.txt ++++ b/library/src/amd_detail/rocblaslt/src/CMakeLists.txt +@@ -100,7 +100,16 @@ if( BUILD_WITH_TENSILE ) + set( Tensile_INC + ${CMAKE_CURRENT_SOURCE_DIR}/src/amd_detail/rocblaslt/src/Tensile + ) ++else() ++ set_target_properties( TensileHost PROPERTIES POSITION_INDEPENDENT_CODE ON ) + ++ set( Tensile_SRC ++ src/amd_detail/rocblaslt/src/tensile_host.cpp ++ ) ++ ++ set( Tensile_INC ++ ${CMAKE_CURRENT_SOURCE_DIR}/src/amd_detail/rocblaslt/src/Tensile ++ ) + endif( ) # BUILD_WITH_TENSILE + + set(DL_LIB dl) \ No newline at end of file diff --git a/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-git.patch b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-git.patch new file mode 100644 index 0000000000000..55c26680673f5 --- /dev/null +++ b/sci-libs/hipBLASLt/files/hipBLASLt-6.1.1-no-git.patch @@ -0,0 +1,13 @@ +Git is not used +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -23,9 +23,6 @@ + + # Dependencies + +-# Git +-find_package(Git REQUIRED) +- + # Workaround until hcc & hip cmake modules fixes symlink logic in their config files. + # (Thanks to rocBLAS devs for finding workaround for this problem!) + list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) diff --git a/sci-libs/hipBLASLt/hipBLASLt-6.1.1.ebuild b/sci-libs/hipBLASLt/hipBLASLt-6.1.1.ebuild new file mode 100644 index 0000000000000..5ca0a6ba73685 --- /dev/null +++ b/sci-libs/hipBLASLt/hipBLASLt-6.1.1.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_SKIP_GLOBALS=1 +PYTHON_COMPAT=( python3_{10..12} ) + +# gfx941 and gfx942 assembly uses directives of LLVM >= 18.1.0 +LLVM_COMPAT=( 18 ) + +inherit cmake python-any-r1 llvm-r1 prefix rocm +DESCRIPTION="General matrix-matrix operations library for AMD Instinct accelerators" +HOMEPAGE="https://github.com/ROCm/hipBLASLt" +SRC_URI="https://github.com/ROCm/hipBLASLt/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/hipBLASLt-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +SUPPORTED_GPUS=( gfx90a gfx940 gfx941 gfx942 ) +IUSE_TARGETS=( "${SUPPORTED_GPUS[@]/#/amdgpu_targets_}" ) +IUSE="${IUSE_TARGETS[@]/#/+} test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-util/hip + dev-cpp/msgpack-cxx + sci-libs/hipBLAS:${SLOT} +" + +DEPEND="${RDEPEND}" +BDEPEND=" + dev-build/rocm-cmake + $(python_gen_any_dep ' + dev-python/msgpack[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/joblib[${PYTHON_USEDEP}] + ') + $(llvm_gen_dep 'sys-devel/clang:${LLVM_SLOT}') + test? ( + dev-cpp/gtest + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-fix-msgpack-dependency.patch + "${FILESDIR}"/${PN}-6.1.1-no-arch.patch + "${FILESDIR}"/${PN}-6.1.1-no-git.patch + "${FILESDIR}"/${PN}-6.1.1-clang-19.patch +) + +python_check_deps() { + python_has_version "dev-python/msgpack[${PYTHON_USEDEP}]" && + python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]" && + python_has_version "dev-python/joblib[${PYTHON_USEDEP}]" +} + +pkg_setup() { + python-any-r1_pkg_setup +} + +src_prepare() { + sed -e "s,\@LLVM_PATH\@,$(get_llvm_prefix),g" \ + "${FILESDIR}"/${PN}-6.1.1-gentoopath.patch > "${S}"/gentoopath.patch || die + eapply $(prefixify_ro "${S}"/gentoopath.patch) + + local shebangs=($(grep -rl "#!/usr/bin/env python3" tensilelite/Tensile || die)) + python_fix_shebang -q ${shebangs[*]} + + cmake_src_prepare +} + +src_configure() { + local targets="$(get_amdgpu_flags)" + + if [[ -z "${targets}" ]]; then + ewarn "hipBLASLt supports only few GPUs: ${SUPPORTED_GPUS[@]}," + ewarn "but none of them were defined in AMDGPU_TARGETS USE_EXPAND variable." + ewarn + ewarn "Library will continue to be built in \"dummy\" mode," + ewarn "serving as a non-functional placeholder for end-user applications." + fi + + local mycmakeargs=( + -DROCM_SYMLINK_LIBS=OFF + -DAMDGPU_TARGETS="$targets" + -DBUILD_WITH_TENSILE=$([ -z "${targets}" ] && echo OFF || echo ON ) + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + ) + + use test && mycmakeargs+=( -DBUILD_FORTRAN_CLIENTS=ON ) + + CXX=hipcc cmake_src_configure +} + +src_compile() { + local -x ROCM_PATH="${EPREFIX}/usr" + # set PYTHONPATH to load Tensile from virtualenv, not the system-wide one + local -x PYTHONPATH="${S}_build/virtualenv/lib/${EPYTHON}/site-packages" + local -x TENSILE_ROCM_ASSEMBLER_PATH="$(get_llvm_prefix)/bin/clang++" + cmake_src_compile +} + +src_install() { + cmake_src_install + + # Stop llvm-strip from removing .strtab section from *.hsaco files, + # otherwise rocclr/elf/elf.cpp complains with "failed: null sections(STRTAB)" and crashes + dostrip -x /usr/$(get_libdir)/hipblaslt/library/ +} + +src_test() { + check_amdgpu + cmake_src_test -j1 +} diff --git a/sci-libs/hipBLASLt/metadata.xml b/sci-libs/hipBLASLt/metadata.xml new file mode 100644 index 0000000000000..da84ad53885ce --- /dev/null +++ b/sci-libs/hipBLASLt/metadata.xml @@ -0,0 +1,14 @@ + + + + + sci@gentoo.org + + + lockalsash@gmail.com + Sv. Lockal + + + ROCm/hipBLASLt + +