From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (unknown [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 048A11580CF for ; Wed, 26 Jun 2024 09:21:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB0932BC0F0; Wed, 26 Jun 2024 09:21:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C3A6C2BC0EC for ; Wed, 26 Jun 2024 09:21:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A5D0D34301C for ; Wed, 26 Jun 2024 09:21:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7AE0D1D69 for ; Wed, 26 Jun 2024 09:21:26 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1719393569.440c80fe2dac37d4a6e970436d498f73c165d3fd.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/hip/hip-6.1.1.ebuild dev-util/hip/metadata.xml X-VCS-Directories: dev-util/hip/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 440c80fe2dac37d4a6e970436d498f73c165d3fd X-VCS-Branch: master Date: Wed, 26 Jun 2024 09:21:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a42c72bb-f4ac-49bb-a7ed-b00049138f88 X-Archives-Hash: db7fc6fe80a69c31b4597c397d4f0fdf commit: 440c80fe2dac37d4a6e970436d498f73c165d3fd Author: Paul Zander gmail com> AuthorDate: Tue Jun 25 21:05:06 2024 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 26 09:19:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=440c80fe dev-util/hip: 6.1.1 add cuda support Add platform options via video_cards. Make HIP / OpenCL for CLR optional. Signed-off-by: Paul Zander gmail.com> Closes: https://github.com/gentoo/gentoo/pull/35998 Signed-off-by: Sam James gentoo.org> dev-util/hip/hip-6.1.1.ebuild | 86 +++++++++++++++++++++++++++++++++---------- dev-util/hip/metadata.xml | 6 +++ 2 files changed, 73 insertions(+), 19 deletions(-) diff --git a/dev-util/hip/hip-6.1.1.ebuild b/dev-util/hip/hip-6.1.1.ebuild index 3bc1a3162b5f..eab3697cf4ef 100644 --- a/dev-util/hip/hip-6.1.1.ebuild +++ b/dev-util/hip/hip-6.1.1.ebuild @@ -29,25 +29,42 @@ LICENSE="MIT" SLOT="0/$(ver_cut 1-2)" KEYWORDS="~amd64" -IUSE="debug test" +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=" - >=dev-util/rocminfo-5 - $(llvm_gen_dep ' - sys-devel/clang:${LLVM_SLOT} - ') - dev-libs/rocm-comgr:${SLOT} - dev-libs/rocr-runtime:${SLOT} + 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="test? ( dev-util/hipcc:${SLOT}[${LLVM_USEDEP}] )" +BDEPEND=" + video_cards_amdgpu? ( + dev-util/hipcc:${SLOT}[${LLVM_USEDEP}] + ) +" RDEPEND="${DEPEND} - dev-util/hipcc:${SLOT}[${LLVM_USEDEP}] - dev-perl/URI-Encode sys-devel/clang-runtime:= - >=dev-libs/roct-thunk-interface-5" + 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" @@ -117,27 +134,50 @@ src_configure() { local mycmakeargs=( -DCMAKE_PREFIX_PATH="$(get_llvm_prefix)" - -DCMAKE_BUILD_TYPE=${buildtype} -DCMAKE_SKIP_RPATH=ON - -DHIP_PLATFORM=amd + -D__HIP_ENABLE_PCH="no" + + -DCLR_BUILD_HIP="$(usex hip)" + -DCLR_BUILD_OCL="$(usex opencl)" + -DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}" - -DROCM_PATH="${EPREFIX}/usr" - -DUSE_PROF_API=0 - -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF - -DCLR_BUILD_HIP=ON -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=( - -DROCM_PATH="${BUILD_DIR}"/hipamd - -DHIP_PLATFORM=amd -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 } @@ -187,4 +227,12 @@ src_install() { 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 } diff --git a/dev-util/hip/metadata.xml b/dev-util/hip/metadata.xml index 0d035a139560..8746df97725c 100644 --- a/dev-util/hip/metadata.xml +++ b/dev-util/hip/metadata.xml @@ -24,4 +24,10 @@ ROCm/HIP + + Build HIP runtime + Build OpenCL runtime + Build for AMD platform + Build for Nvidia platform +