Gentoo Archives: gentoo-dev

From: Marek Szuba <marecki@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] virtual/opencl: new version
Date: Mon, 06 Apr 2020 22:05:58
Message-Id: 20200406220518.453150-2-marecki@gentoo.org
In Reply to: [gentoo-dev] [PATCH v2] Refactor virtual/opencl to provide the API, not an implementation by Marek Szuba
1 One, instead of pulling in various OpenCL runtimes, only depend on
2 an OpenCL ICD loader (dev-libs/ocl-icd, with dev-libs/opencl-icd-loader
3 to be added later) in order to provide hardware-independent header
4 files and libraries for OpenCL-aware software to build against.
5 Actual runtimes are now simply suggested to the user via a postinst
6 message / README.gentoo file.
7
8 Two, do not depend on eselect-opencl either - both ICD loaders pull in
9 their own OpenCL headers so there is no need to depend on the legacy
10 headers provided by this package, and for being able to switch to a
11 specific loader it is enough for loaders themselves to depend on this.
12
13 Signed-off-by: Marek Szuba <marecki@g.o>
14 ---
15 virtual/opencl/files/README.gentoo | 18 ++++++++++++++++++
16 virtual/opencl/opencl-3.ebuild | 25 +++++++++++++++++++++++++
17 2 files changed, 43 insertions(+)
18 create mode 100644 virtual/opencl/files/README.gentoo
19 create mode 100644 virtual/opencl/opencl-3.ebuild
20
21 diff --git a/virtual/opencl/files/README.gentoo b/virtual/opencl/files/README.gentoo
22 new file mode 100644
23 index 00000000000..aa2dc0ef519
24 --- /dev/null
25 +++ b/virtual/opencl/files/README.gentoo
26 @@ -0,0 +1,18 @@
27 +In order to take advantage of OpenCL you will need a runtime for your hardware.
28 +Currently included in Gentoo are:
29 +
30 + * open:
31 + - dev-libs/intel-neo - integrated Intel GPUs from Broadwell onwards. 64-bit only;
32 + - dev-libs/rocm-opencl-runtime - AMD GPUs supported by the amdgpu kernel driver.
33 + Image support still requires a proprietary extension [1]. 64-bit only;
34 + - media-libs/mesa[opencl] - some older AMD GPUs; see [2]. 32-bit support;
35 +
36 + * proprietary:
37 + - dev-libs/amdgpu-pro-opencl - AMD Polaris GPUs. 32-bit support;
38 + - dev-util/intel-ocl-sdk - Intel CPUs (*not* GPUs). 64-bit only;
39 + - x11-drivers/nvidia-drivers[uvm] - Nvidia GPUs; specific package versions
40 + required for older devices [3]. 32-bit support.
41 +
42 + [1] dev-libs/hsa-ext-rocr
43 + [2] https://dri.freedesktop.org/wiki/GalliumCompute/
44 + [3] https://www.nvidia.com/en-us/drivers/unix/legacy-gpu/
45 diff --git a/virtual/opencl/opencl-3.ebuild b/virtual/opencl/opencl-3.ebuild
46 new file mode 100644
47 index 00000000000..6268723a166
48 --- /dev/null
49 +++ b/virtual/opencl/opencl-3.ebuild
50 @@ -0,0 +1,25 @@
51 +# Copyright 1999-2020 Gentoo Authors
52 +# Distributed under the terms of the GNU General Public License v2
53 +
54 +EAPI=7
55 +
56 +inherit multilib-build readme.gentoo-r1
57 +
58 +DESCRIPTION="Virtual for OpenCL API"
59 +SLOT="0"
60 +KEYWORDS="~amd64 ~x86"
61 +
62 +# Will add dev-libs/opencl-icd-loader here as an alternative once all potential
63 +# file collisions with eselect-opencl have been resolved
64 +RDEPEND="dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]"
65 +
66 +# so that src_install() doesn't fail on missing directory
67 +S="${WORKDIR}"
68 +
69 +src_install() {
70 + readme.gentoo_create_doc
71 +}
72 +
73 +pkg_postinst() {
74 + readme.gentoo_print_elog
75 +}
76 --
77 2.24.1