Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: virtual/opencl/
Date: Fri, 28 Feb 2020 12:04:01
Message-Id: 1582890343.4d3b73032bb7a22457d8cd762f4240305ef66111.marecki@gentoo
1 commit: 4d3b73032bb7a22457d8cd762f4240305ef66111
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 28 11:45:43 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 28 11:45:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d3b7303
7
8 virtual/opencl: Only pull in media-libs/mesa on supported GPUs
9
10 virtual/opencl uses media-libs/mesa[opencl] as driver-independent
11 fallback OpenCL provider. However, media-libs/mesa[opencl] depends
12 on dev-libs/libclc - which at the time of me writing this only
13 supports nvidia, r600 and radeonsi, and whose REQUIRED_USE clause
14 requires at least one of the corresponding VIDEO_CARDS flags to be
15 set. This effectively breaks the OpenCL dependency cycle for a lot of
16 configurations, e.g. for VIDEO_CARDS="nouveau" systems.
17
18 Only try to use Mesa as an OpenCL provider when VIDEO_CARDS includes a
19 GPU supported by dev-libs/libclc.
20
21 Note that this means there is now no fallback OpenCL provider for
22 ABI_X86_32. Moreover, for ABI_X86_64 the fallback provider is now
23 dev-util/intel-ocl-sdk, which almost certainly doesn't work on AMD CPUs
24 - which however should be mostly harmless (the package should simply do
25 nothing beyond satisfying virtual/opencl dependencies), especially given
26 many OpenCL-aware applications ignore CPU-type devices anyway.
27
28 Closes: https://bugs.gentoo.org/710724
29 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
30
31 virtual/opencl/opencl-2.ebuild | 12 ++++++++----
32 1 file changed, 8 insertions(+), 4 deletions(-)
33
34 diff --git a/virtual/opencl/opencl-2.ebuild b/virtual/opencl/opencl-2.ebuild
35 index 81e5238f3c1..9963833977e 100644
36 --- a/virtual/opencl/opencl-2.ebuild
37 +++ b/virtual/opencl/opencl-2.ebuild
38 @@ -1,4 +1,4 @@
39 -# Copyright 1999-2019 Gentoo Authors
40 +# Copyright 1999-2020 Gentoo Authors
41 # Distributed under the terms of the GNU General Public License v2
42
43 EAPI=6
44 @@ -8,7 +8,7 @@ inherit multilib-build
45 DESCRIPTION="Virtual for OpenCL implementations"
46 SLOT="0"
47 KEYWORDS="amd64 x86"
48 -CARDS=( amdgpu i965 nvidia )
49 +CARDS=( amdgpu i965 nvidia r600 radeonsi )
50 IUSE="${CARDS[@]/#/video_cards_}"
51
52 # intel-neo and intel-ocl-sdk are amd64-only
53 @@ -17,11 +17,15 @@ RDEPEND="app-eselect/eselect-opencl
54 video_cards_i965? ( || (
55 abi_x86_64? ( !abi_x86_32? ( dev-libs/intel-neo ) )
56 dev-libs/beignet ) )
57 - >=media-libs/mesa-9.1.6[opencl,X(+),${MULTILIB_USEDEP}]
58 video_cards_amdgpu? ( || (
59 dev-libs/rocm-opencl-runtime
60 dev-libs/amdgpu-pro-opencl ) )
61 video_cards_nvidia? (
62 - >=x11-drivers/nvidia-drivers-290.10-r2[uvm] )
63 + >=x11-drivers/nvidia-drivers-290.10-r2[uvm]
64 + >=media-libs/mesa-9.1.6[opencl,X(+),${MULTILIB_USEDEP}] )
65 + video_cards_r600? (
66 + >=media-libs/mesa-9.1.6[opencl,X(+),${MULTILIB_USEDEP}] )
67 + video_cards_radeonsi? (
68 + >=media-libs/mesa-9.1.6[opencl,X(+),${MULTILIB_USEDEP}] )
69 abi_x86_64? ( !abi_x86_32? ( dev-util/intel-ocl-sdk ) )
70 )"