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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 01DF0138334 for ; Wed, 29 May 2019 10:31:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 18AE0E076B; Wed, 29 May 2019 10:31:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B2093E076B for ; Wed, 29 May 2019 10:31:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2022C345154 for ; Wed, 29 May 2019 10:31:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8152A326 for ; Wed, 29 May 2019 10:31:09 +0000 (UTC) From: "Marek Szuba" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Marek Szuba" Message-ID: <1559125858.5b8c1208f08af0fa8b870e3e677abf8cdc7c1bc3.marecki@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/amdgpu-pro-opencl/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-19.10.785425-r1.ebuild X-VCS-Directories: dev-libs/amdgpu-pro-opencl/ X-VCS-Committer: marecki X-VCS-Committer-Name: Marek Szuba X-VCS-Revision: 5b8c1208f08af0fa8b870e3e677abf8cdc7c1bc3 X-VCS-Branch: master Date: Wed, 29 May 2019 10:31: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: 91acc446-af6d-4cec-aa1c-2704d99537bf X-Archives-Hash: 7e053b960962eae07c5fbb29489a5d79 commit: 5b8c1208f08af0fa8b870e3e677abf8cdc7c1bc3 Author: Marek Szuba gentoo org> AuthorDate: Wed May 29 10:30:24 2019 +0000 Commit: Marek Szuba gentoo org> CommitDate: Wed May 29 10:30:58 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b8c1208 dev-libs/amdgpu-pro-opencl: conflict with media-libs/mesa[opencl] With both this and the Mesa OpenCL state tracker enabled, using dev-libs/ocl-icd one ends up with two OpenCL platforms pointing to the same hardware - and more importantly causes segmentation faults in all applications attempting to use OpenCL. Closes: https://bugs.gentoo.org/686790 Signed-off-by: Marek Szuba gentoo.org> Package-Manager: Portage-2.3.66, Repoman-2.3.11 .../amdgpu-pro-opencl-19.10.785425-r1.ebuild | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-19.10.785425-r1.ebuild b/dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-19.10.785425-r1.ebuild new file mode 100644 index 00000000000..9e9ca9dc6be --- /dev/null +++ b/dev-libs/amdgpu-pro-opencl/amdgpu-pro-opencl-19.10.785425-r1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MULTILIB_COMPAT=( abi_x86_{32,64} ) + +inherit unpacker multilib-minimal + +SUPER_PN='amdgpu-pro' +MY_PV=$(ver_rs 2 '-') + +DESCRIPTION="Proprietary OpenCL implementation for AMD GPUs" +HOMEPAGE="https://www.amd.com/en/support/kb/release-notes/rn-rad-lin-19-10-unified" +SRC_URI="${SUPER_PN}-${MY_PV}-ubuntu-18.04.tar.xz" + +LICENSE="AMD-GPU-PRO-EULA" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RESTRICT="mirror fetch strip" + +BDEPEND="dev-util/patchelf" +COMMON="app-eselect/eselect-opencl + dev-libs/ocl-icd" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + !media-libs/mesa[opencl]" # Bug #686790 + +QA_PREBUILT="/opt/amdgpu/lib*/*" + +S="${WORKDIR}/${SUPER_PN}-${MY_PV}-ubuntu-18.04" + +pkg_nofetch() { + local pkgver=$(ver_cut 1-2) + einfo "Please download Radeon Software for Linux version ${pkgver} for Ubuntu 18.04 from" + einfo " ${HOMEPAGE}" + einfo "The archive should then be placed into your distfiles directory." +} + +src_unpack() { + default + + local ids_ver="1.0.0" + local patchlevel=$(ver_cut 3) + cd "${S}" || die + unpack_deb "${S}/libdrm-amdgpu-common_${ids_ver}-${patchlevel}_all.deb" + multilib_parallel_foreach_abi multilib_src_unpack +} + +multilib_src_unpack() { + local libdrm_ver="2.4.97" + local patchlevel=$(ver_cut 3) + local deb_abi + [[ ${ABI} == x86 ]] && deb_abi=i386 + + mkdir -p "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" >/dev/null || die + unpack_deb "${S}/opencl-orca-amdgpu-pro-icd_${MY_PV}_${deb_abi:-${ABI}}.deb" + unpack_deb "${S}/libdrm-amdgpu-amdgpu1_${libdrm_ver}-${patchlevel}_${deb_abi:-${ABI}}.deb" + popd >/dev/null || die +} + +multilib_src_install() { + local dir_abi short_abi + [[ ${ABI} == x86 ]] && dir_abi=i386-linux-gnu && short_abi=32 + [[ ${ABI} == amd64 ]] && dir_abi=x86_64-linux-gnu && short_abi=64 + + into "/opt/amdgpu" + patchelf --set-rpath '$ORIGIN' "opt/${SUPER_PN}/lib/${dir_abi}"/libamdocl-orca${short_abi}.so || die "Failed to fix library rpath" + dolib.so "opt/${SUPER_PN}/lib/${dir_abi}"/* + dolib.so "opt/amdgpu/lib/${dir_abi}"/* + + insinto /etc/OpenCL/vendors + echo "/opt/amdgpu/$(get_libdir)/libamdocl-orca${short_abi}.so" \ + > "${T}/${SUPER_PN}-${ABI}.icd" || die "Failed to generate ICD file for ABI ${ABI}" + doins "${T}/${SUPER_PN}-${ABI}.icd" +} + +# FIXME: is this right? +multilib_src_install_all() { + ewarn "FOO $PWD" + ewarn `ls` + insinto "/opt/amdgpu" + doins -r opt/amdgpu/share +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + ewarn "Please note that using proprietary OpenCL libraries together with the" + ewarn "Open Source amdgpu stack is not officially supported by AMD. Do not ask them" + ewarn "for support in case of problems with this package." + ewarn "" + ewarn "Furthermore, if you have the whole AMDGPU-Pro stack installed this package" + ewarn "will almost certainly conflict with it. This might change once AMDGPU-Pro" + ewarn "has become officially supported by Gentoo." + fi + + "${ROOT}"/usr/bin/eselect opencl set --use-old ocl-icd +}