virtual/opencl: new version
authorMarek Szuba <marecki@gentoo.org>
Sat, 4 Apr 2020 21:38:36 +0000 (22:38 +0100)
committerMarek Szuba <marecki@gentoo.org>
Wed, 8 Apr 2020 14:44:45 +0000 (15:44 +0100)
One, instead of pulling in various OpenCL runtimes, only depend on
an OpenCL ICD loader (dev-libs/ocl-icd, with dev-libs/opencl-icd-loader
to be added later) in order to provide hardware-independent header
files and libraries for OpenCL-aware software to build against.
Actual runtimes are now simply suggested to the user via a postinst
message / README.gentoo file.

Two, do not depend on eselect-opencl either - both ICD loaders pull in
their own OpenCL headers so there is no need to depend on the legacy
headers provided by this package, and for being able to switch to a
specific loader it is enough for loaders themselves to depend on this.

Signed-off-by: Marek Szuba <marecki@gentoo.org>
virtual/opencl/files/README.gentoo [new file with mode: 0644]
virtual/opencl/opencl-3.ebuild [new file with mode: 0644]

diff --git a/virtual/opencl/files/README.gentoo b/virtual/opencl/files/README.gentoo
new file mode 100644 (file)
index 0000000..aa2dc0e
--- /dev/null
@@ -0,0 +1,18 @@
+In order to take advantage of OpenCL you will need a runtime for your hardware.
+Currently included in Gentoo are:
+
+ * open:
+    - dev-libs/intel-neo - integrated Intel GPUs from Broadwell onwards. 64-bit only;
+    - dev-libs/rocm-opencl-runtime - AMD GPUs supported by the amdgpu kernel driver.
+      Image support still requires a proprietary extension [1]. 64-bit only;
+    - media-libs/mesa[opencl] - some older AMD GPUs; see [2]. 32-bit support;
+
+ * proprietary:
+    - dev-libs/amdgpu-pro-opencl - AMD Polaris GPUs. 32-bit support;
+    - dev-util/intel-ocl-sdk - Intel CPUs (*not* GPUs). 64-bit only;
+    - x11-drivers/nvidia-drivers[uvm] - Nvidia GPUs; specific package versions
+      required for older devices [3]. 32-bit support.
+
+ [1] dev-libs/hsa-ext-rocr
+ [2] https://dri.freedesktop.org/wiki/GalliumCompute/
+ [3] https://www.nvidia.com/en-us/drivers/unix/legacy-gpu/
diff --git a/virtual/opencl/opencl-3.ebuild b/virtual/opencl/opencl-3.ebuild
new file mode 100644 (file)
index 0000000..6268723
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build readme.gentoo-r1
+
+DESCRIPTION="Virtual for OpenCL API"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# Will add dev-libs/opencl-icd-loader here as an alternative once all potential
+# file collisions with eselect-opencl have been resolved
+RDEPEND="dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]"
+
+# so that src_install() doesn't fail on missing directory
+S="${WORKDIR}"
+
+src_install() {
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}