From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [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 ECB59158041 for ; Mon, 25 Mar 2024 18:57:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A186E2AB2; Mon, 25 Mar 2024 18:57:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 F1CF1E2AAD for ; Mon, 25 Mar 2024 18:57:12 +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 DD6C2343091 for ; Mon, 25 Mar 2024 18:57:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6D84D15F1 for ; Mon, 25 Mar 2024 18:57:09 +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: <1711392897.24c3de08e5ef07f46d1a887e8ad8a56821012a60.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/oidn/, media-libs/oidn/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/oidn/files/oidn-2.1.0-amdgpu-targets.patch media-libs/oidn/oidn-2.1.0.ebuild X-VCS-Directories: media-libs/oidn/ media-libs/oidn/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 24c3de08e5ef07f46d1a887e8ad8a56821012a60 X-VCS-Branch: master Date: Mon, 25 Mar 2024 18:57:09 +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: 6975eb21-3994-46f9-8b3b-af2409dee08b X-Archives-Hash: 4367da56d850b8b7b4090a8bb7b6d2f7 commit: 24c3de08e5ef07f46d1a887e8ad8a56821012a60 Author: Sv. Lockal gmail com> AuthorDate: Fri Jan 19 21:12:57 2024 +0000 Commit: Sam James gentoo org> CommitDate: Mon Mar 25 18:54:57 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24c3de08 media-libs/oidn: apply Gentoo-related fixes for hip suport Signed-off-by: Sv. Lockal gmail.com> Signed-off-by: Sam James gentoo.org> .../oidn/files/oidn-2.1.0-amdgpu-targets.patch | 46 ++++++++++++++++++++++ media-libs/oidn/oidn-2.1.0.ebuild | 28 ++++++++++++- 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/media-libs/oidn/files/oidn-2.1.0-amdgpu-targets.patch b/media-libs/oidn/files/oidn-2.1.0-amdgpu-targets.patch new file mode 100644 index 000000000000..90d3c17f38cc --- /dev/null +++ b/media-libs/oidn/files/oidn-2.1.0-amdgpu-targets.patch @@ -0,0 +1,46 @@ +Allow specifying AMDGPU_TARGETS with CMake flags. +Fix build when main compiler is set to GCC. +--- a/devices/CMakeLists.txt ++++ b/devices/CMakeLists.txt +@@ -123,6 +123,10 @@ if(OIDN_DEVICE_HIP) + ) + mark_as_advanced(OIDN_DEVICE_HIP_COMPILER) + ++ set(AMDGPU_TARGETS "gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103" CACHE STRING "AMD GPU targets to compile for") ++ mark_as_advanced(AMDGPU_TARGETS) ++ message(STATUS "AMD targets: ${AMDGPU_TARGETS}") ++ + # Add ROCm to CMAKE_PREFIX_PATH + set(_hip_prefix_path CMAKE_PREFIX_PATH) + list(APPEND _hip_prefix_path ${ROCM_PATH}/hip ${ROCM_PATH}) +@@ -137,7 +141,6 @@ if(OIDN_DEVICE_HIP) + CMAKE_CACHE_ARGS + -DCMAKE_PREFIX_PATH:STRING=${_hip_prefix_path_str} + -DCMAKE_CXX_COMPILER:FILEPATH=${OIDN_DEVICE_HIP_COMPILER} +- -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/hip/preinstall + -DCMAKE_INSTALL_BINDIR:PATH=${CMAKE_INSTALL_BINDIR} +@@ -149,6 +152,9 @@ if(OIDN_DEVICE_HIP) + -DOIDN_API_NAMESPACE:STRING=${OIDN_API_NAMESPACE} + -DOIDN_WARN_AS_ERRORS:BOOL=${OIDN_WARN_AS_ERRORS} + -DOIDN_SANITIZER:STRING=${OIDN_SANITIZER} ++ -DGPU_TARGETS:STRING=${AMDGPU_TARGETS} ++ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ++ -G "${CMAKE_GENERATOR}" + BUILD_ALWAYS TRUE + DEPENDS + OpenImageDenoise_core +--- a/devices/hip/CMakeLists.txt ++++ b/devices/hip/CMakeLists.txt +@@ -25,8 +25,8 @@ include(oidn_common_external) + # FIXME: The HIP runtime has a bug that causes a crash if the kernels are not compiled for all + # targets detected in the system. As a workaround, we compile for more targets then we actually + # support to avoid the crash on systems with dedicated + integrated GPUs. +-set(GPU_TARGETS "gfx1030,gfx1031,gfx1032,gfx1033,gfx1034,gfx1035,gfx1036,gfx1100,gfx1101,gfx1102,gfx1103" CACHE INTERNAL "") +-set(AMDGPU_TARGETS ${GPU_TARGETS} CACHE INTERNAL "") ++set(GPU_TARGETS "gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103" CACHE STRING "") ++set(AMDGPU_TARGETS ${GPU_TARGETS} CACHE STRING "") + + # Find HIP + find_package(hip REQUIRED) diff --git a/media-libs/oidn/oidn-2.1.0.ebuild b/media-libs/oidn/oidn-2.1.0.ebuild index 2eab9e4151b6..4cc4883b6c7f 100644 --- a/media-libs/oidn/oidn-2.1.0.ebuild +++ b/media-libs/oidn/oidn-2.1.0.ebuild @@ -1,11 +1,13 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) +LLVM_MAX_SLOT=17 +ROCM_VERSION=5.7 -inherit cmake python-single-r1 +inherit cmake python-single-r1 llvm rocm DESCRIPTION="Intel(R) Open Image Denoise library" HOMEPAGE="https://www.openimagedenoise.org/" @@ -37,15 +39,37 @@ RDEPEND=" " DEPEND="${RDEPEND}" +PATCHES=( + "${FILESDIR}/${PN}-2.1.0-amdgpu-targets.patch" +) + src_configure() { local mycmakeargs=( -DOIDN_DEVICE_CUDA=$(usex cuda) -DOIDN_DEVICE_HIP=$(usex hip) -DOIDN_APPS=$(usex apps) ) + + if use hip; then + mycmakeargs+=( + -DROCM_PATH="${EPREFIX}/usr" + -DOIDN_DEVICE_HIP_COMPILER="$(get_llvm_prefix ${LLVM_MAX_SLOT})/bin/clang++" + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + ) + fi + cmake_src_configure } src_test() { "${BUILD_DIR}"/oidnTest || die "There were test faliures!" } + +src_install() { + cmake_src_install + + if use hip || use cuda ; then + # remove garbage in /var/tmp left by subprojects + rm -rf "${ED}"/var || die + fi +}