summaryrefslogtreecommitdiff
path: root/dev-util/hip
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-02 02:07:07 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-02 02:07:07 +0000
commitd4f65848c7ecabb56e2f93889cbd20078cd347f7 (patch)
tree180032f5afeb689db6a270d612f3e3364ed8fd2b /dev-util/hip
parentc635a4b7ddb6105bfc6fef130b188a087726677b (diff)
gentoo auto-resync : 02:12:2024 - 02:07:07
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/Manifest4
-rw-r--r--dev-util/hip/hip-6.2.4.ebuild243
2 files changed, 247 insertions, 0 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 2a3fcbc4d6e1..2a2cbca5a4f8 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -47,8 +47,10 @@ DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96ea
DIST hip-5.7.1.tar.gz 553774 BLAKE2B f88c235f688d3a662ec6cb4ad7fe3f82c0015015997871609cc30ab5b2f7fcb9709a08683d77194e45a6dbbe1d24c6355b128d2ecf655f1dea3468711c64e0a3 SHA512 68fa8753725b53c999d102d254c6b1dba53af4e00d6a48db93d10213cc02eec30b4a39c66e773d4f625dd9636cf8b0c5faa05b69fac27cf5a6b19dd3ddd2b905
DIST hip-6.1.1.tar.gz 247192 BLAKE2B c40bb483fb61b3037693f456e546046598df7e0dd81a1f1c8d222ab0d9c0752092ce85c8533bd355f883dda5ce1f32f7ff2b2a58cebac50d53e0e7f4d85ca3ae SHA512 3e6162938294a74af51bc2161ada38dc4ba19614e182238f320f2052a9025be6ea413e40f00cb80f4e86696793d6c4431e2417ea798a2330886a3f3e66aedf0d
DIST hip-6.1.2.tar.gz 247193 BLAKE2B e343bdf233752e40cdefa0c2bbd56858bbb471155045ae1adcf651ddff2ed40dc7c7069998a35e9b26324fdf1c972e13e1222406bc52ae2591c23a45611864c5 SHA512 771f6494c7ff0ddb7d22193dfdbb3fb9461f6e4be347ecb879bb84c5a01a95fb4c4d3f7a0f039265d5369f6c6a5b66949af7bc91ed220f5e81a5b15ec98a68eb
+DIST hip-6.2.4.tar.gz 1482993 BLAKE2B 5ba367305505109631941d89f0b0566fddd73d9f7722216b9a42f9f863490fbbe3f817075ea3739005fc2b0c6c757dbe043823d9d1ec62416a5319992dd1b447 SHA512 1415770bec17cb93aee51683efe17b2bafb625300dd5dbf8e0dbb609a98ef875810dc40f4a3923c8a28f3cecd118d4c58bce61d1334197bca33dfa01336f62fd
DIST hip-test-6.1.1.tar.gz 1080605 BLAKE2B 7eddf648be31365479baa0cd4fd1c060a682a6b44d923cac1c4840c0768782db2fef4e5d97318ef0423be1e5c85b1a0cc6b9d324db789dad28be17f64ab38cae SHA512 0dd679c5b94a59e192bea5789f4448b53ac23c8a03b24a347758b1d70ff692483fd4aaea0b19345eb6ffb82a4492ed21958398b53ae6244a244a660dfa33412f
DIST hip-test-6.1.2.tar.gz 1080493 BLAKE2B ff501ab92c1d3207e330f5e9630e3300aa52f7c2acfae2173a964a2843952db90eea2b4ecf5db1ec6ba65d7764750b9eae3f2a9641d1a3fc71d5172e3a7264a8 SHA512 09fa4243c8b73ddbe163ff4c60f0f8f4182f1a37071e9747bf95ecdc219ba3a0407bdf1e2391481f537b223565a38f16e918667194666558a469d94f88a1e236
+DIST hip-test-6.2.4.tar.gz 1403884 BLAKE2B edd19e1cd44eeea6c8df9eb3a8af96f12d5296149b7167a0754c79ca494881f76a0ed04ea7c0ff686cb54384c10ee457d367b645624c836024556da3453a6097 SHA512 8b28f07dcece8cb25d6ec2aed63b02feca91c5f48cecd5ae545b058317b6ed59a6300689a398cfb3310ac4e1eb52a83f03f5a671fe0c1a0bca57c49399dc782d
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
@@ -57,6 +59,7 @@ DIST rocm-5.7.0.tar.gz 845881 BLAKE2B 08255edc1407e5ef85895336b11496319695318fce
DIST rocm-clr-5.7.1.tar.gz 2008647 BLAKE2B 3db0760d6f83504e60caf88a2dd5e0bc02c7db9d6f263ad0eb2cfc79aa0f88a3699c412844a0158a796d9d02e79660287e791edad787d814eefffea4fd2298b4 SHA512 d79323481d82fc02c12a32cdcc0d14437d512af023e7737db0387b7eecb27fe6e4ae7c71d6adce57932a04bb24c880440d9dc10aeb5af11a4f2ca64d44330965
DIST rocm-clr-6.1.1.tar.gz 2031034 BLAKE2B b0485bb015d31986f4988d1db0c029c826856e50b5bb1b58fac2097c14b3966668f1b8d41ec198889e27ac860497a8b3c081ec31d52390d5c9ff5db092bf7cce SHA512 86925e8b9a9e77b06a57daefbc7279887b4ef7c6a79c3717bc2f2d3bf29926281c60063fd17e21c65d7def520d9f579bf88f69051d053a38750ba968f69ca3fc
DIST rocm-clr-6.1.2.tar.gz 2031283 BLAKE2B d51d32a77794ea97f1a3817786c9fd6b482106b665eea6e2c9b4c11e4dce19a3486386eb5ba111554c2d82c30e2a93add7502eed5768caf3fb709fb5fbb2e71b SHA512 e97224451864efe0084c4117f54893c9624a6a9f365a0b4abad08fd9635f008dea742dc589429fbb714e1b8177d06362c0f5a741f6c4a050d0fd4d48da72d54b
+DIST rocm-clr-6.2.4.tar.gz 2078004 BLAKE2B 28fdd2a81a5b831e157d781d6d869c02a288d9b8dc47a8a1d0a9f3b7ed99393c06f9b2bbc8d7dc2b2173a1b8c57fa1328b0fd6a7f24e759ace77e8c1ae777442 SHA512 74a198595929003248a3684fb5d83c20a8769eef237fcc07371f4385380f347917d6beaca15527334d06ea19bc446a03fca7251e5b2782f05547a36ccd1dfa49
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
@@ -77,4 +80,5 @@ EBUILD hip-5.5.1.ebuild 5269 BLAKE2B 29d0f7303267e6baec24ea65b24b1b4e1d622553124
EBUILD hip-5.7.1-r2.ebuild 5452 BLAKE2B ff7f44547964dabff96ed68e60d0928512d208b37a446053bc93052aea809914fe4c49430958b7c26900015886b7be0b7c9e6bea4aed91377d83b19f5ba63754 SHA512 a0d0786e8f5e75b4450b90a53131c2580810afcb51d8df618d253c2968b8da3ab1641df9142d8f13db93ed773dcb7e2b746eaab9f42a4f49f820819d5cdb64fb
EBUILD hip-6.1.1.ebuild 6720 BLAKE2B 7bdf29e4da2db2f2203f3765c87482d01db6c99d42897021b996e42f882297bec1ee001be7f58a1ebbe092dbbe45a336afc12f76daeb13675c0ce87bf975de08 SHA512 43f960844a5003a83151ff09a2a331bea605a565f9ae0f8e969431442988ef4e9c4b2b1d9cd7dcf85eb9c5e04d634a7f9f569d332424ca4232604518cf968faf
EBUILD hip-6.1.2.ebuild 6720 BLAKE2B 7bdf29e4da2db2f2203f3765c87482d01db6c99d42897021b996e42f882297bec1ee001be7f58a1ebbe092dbbe45a336afc12f76daeb13675c0ce87bf975de08 SHA512 43f960844a5003a83151ff09a2a331bea605a565f9ae0f8e969431442988ef4e9c4b2b1d9cd7dcf85eb9c5e04d634a7f9f569d332424ca4232604518cf968faf
+EBUILD hip-6.2.4.ebuild 6652 BLAKE2B 815c0b5d6e598fb72609b0532d6f7ba21c791091b825f0ac4f2939361b7f4ca8d7a5fc928e8ab5d82f5e8a7ac61ea6e6195c9046dafe0aa9d037c731bf41ae60 SHA512 3a9ecbdf876870a2ab2ac934296557aea33d6d4b6ec5be07c01f033f13958cbf29d1bc68edffc99b0bbf19ba4d1fee1120ae9c8015bb52ad82fc0f603cf9b349
MISC metadata.xml 1076 BLAKE2B 816a3628360882d89e2bc64f7b5be6442ad4fb0866b6a8291c4701a03e626d9482b93980b34e5ab21c37bda025359978b471d09e2d4817ceeb209d83afaecbfe SHA512 009079d56a9fb1c3212dc4e67dd88bc16bbc6350bb832912543b2a1e6747c77d13021e7a94da9a4c9371722828214b308246e7ad58406276126cdf6e44281506
diff --git a/dev-util/hip/hip-6.2.4.ebuild b/dev-util/hip/hip-6.2.4.ebuild
new file mode 100644
index 000000000000..bf54429bb4c1
--- /dev/null
+++ b/dev-util/hip/hip-6.2.4.ebuild
@@ -0,0 +1,243 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DEPEND="media-gfx/graphviz"
+ROCM_SKIP_GLOBALS=1
+
+LLVM_COMPAT=( 18 )
+
+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-${TEST_PV}.tar.gz -> hip-test-${TEST_PV}.tar.gz
+ )
+"
+S="${WORKDIR}/clr-rocm-${PV}/"
+TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+
+IUSE="debug +hip opencl test video_cards_amdgpu video_cards_nvidia"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+ || ( hip opencl )
+ ^^ ( video_cards_amdgpu video_cards_nvidia )
+"
+
+DEPEND="
+ video_cards_amdgpu? (
+ >=dev-util/rocminfo-5
+ $(llvm_gen_dep '
+ sys-devel/clang:${LLVM_SLOT}
+ ')
+ dev-libs/rocm-comgr:${SLOT}
+ dev-libs/rocr-runtime:${SLOT}
+ )
+ video_cards_nvidia? (
+ dev-libs/hipother:${SLOT}
+ )
+ x11-base/xorg-proto
+ virtual/opengl
+"
+BDEPEND="
+ video_cards_amdgpu? (
+ dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
+ )
+"
+RDEPEND="${DEPEND}
+ sys-devel/clang-runtime:=
+ opencl? (
+ !dev-libs/opencl-icd-loader
+ !dev-libs/rocm-opencl-runtime
+ !dev-util/clinfo
+ !dev-util/opencl-headers
+ )
+ video_cards_amdgpu? (
+ dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
+ >=dev-libs/rocm-device-libs-${PV}
+ >=dev-libs/roct-thunk-interface-5
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
+ "${FILESDIR}/${PN}-6.1.0-install.patch"
+ "${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
+)
+
+hip_test_wrapper() {
+ local CMAKE_USE_DIR="${TEST_S}"
+ local BUILD_DIR="${TEST_S}_build"
+ cd "${TEST_S}" || die
+ "${@}"
+}
+
+src_prepare() {
+ # NOTE We do this head stand to safe the patch size.
+ # NOTE Adjust when we drop 5.7.1
+ sed \
+ -e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
+ -i hipamd/src/hip_code_object.cpp || die
+ eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
+ sed \
+ -e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
+ -i hipamd/src/hip_code_object.cpp || die
+
+ # hipamd is itself built by cmake, and should never provide a
+ # FindHIP.cmake module. But the reality is some package relies on it.
+ # 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
+
+ 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" -le "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
+
+ if use test; then
+ 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.1-fix-musl.patch
+ )
+ hip_test_wrapper cmake_src_prepare
+ fi
+}
+
+src_configure() {
+ # -Werror=strict-aliasing
+ # https://bugs.gentoo.org/858383
+ # https://github.com/ROCm/clr/issues/64
+ #
+ # Do not trust it for LTO either
+ append-flags -fno-strict-aliasing
+ filter-lto
+
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
+ # See also: https://github.com/gentoo/gentoo/pull/29097
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="$(get_llvm_prefix)"
+ -DCMAKE_SKIP_RPATH=ON
+ -D__HIP_ENABLE_PCH="no"
+
+ -DCLR_BUILD_HIP="$(usex hip)"
+ -DCLR_BUILD_OCL="$(usex opencl)"
+
+ -DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}"
+ -DHIPCC_BIN_DIR="${EPREFIX}/usr/bin"
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API="no"
+ -DFILE_REORG_BACKWARD_COMPATIBILITY="no"
+
+ -DOpenGL_GL_PREFERENCE="GLVND"
+ -DCMAKE_DISABLE_FIND_PACKAGE_Git="yes"
+ )
+
+ if use video_cards_amdgpu; then
+ mycmakeargs+=(
+ -DHIP_PLATFORM="amd"
+ )
+ elif use video_cards_nvidia; then
+ mycmakeargs+=(
+ -DHIPNV_DIR="${EPREFIX}/usr"
+ -DHIP_PLATFORM="nvidia"
+ )
+ fi
+
+ cmake_src_configure
+
+ if use test; then
+ local mycmakeargs=(
+ -DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2"
+ )
+ if use video_cards_amdgpu; then
+ mycmakeargs+=(
+ -DROCM_PATH="${BUILD_DIR}/hipamd"
+ -DHIP_PLATFORM="amd"
+ )
+ elif use video_cards_nvidia; then
+ mycmakeargs+=(
+ -DROCM_PATH="${BUILD_DIR}/hipother"
+ -DHIP_PLATFORM="nvidia"
+ )
+ fi
+ HIP_PATH="${EPREFIX}/usr" hip_test_wrapper cmake_src_configure
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use test; then
+ HIP_PATH="${BUILD_DIR}"/hipamd \
+ hip_test_wrapper cmake_src_compile build_tests
+ fi
+}
+
+src_test() {
+ check_amdgpu
+ export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
+
+ # TODO: research how to test Vulkan-related features.
+ local CMAKE_SKIP_TESTS=(
+ Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
+ Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
+ Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
+ Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
+ Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
+ Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
+ Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
+ Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
+ Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
+ Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
+ Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
+ )
+
+ MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
+}
+
+src_install() {
+ cmake_src_install
+
+ # add version file that is required by some libraries
+ mkdir "${ED}"/usr/include/rocm-core || die
+ cat <<-EOF > "${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
+
+ if use video_cards_nvidia; then
+ newenvd - 99hipconfig <<-EOF
+ HIP_PLATFORM="nvidia"
+ HIP_RUNTIME="cuda"
+ CUDA_PATH="${EPREFIX}/opt/cuda"
+ EOF
+ fi
+}