All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/6] OpenCL support
@ 2018-10-20 22:14 Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package Thomas Petazzoni
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

Hello,

This series started with the patches from Valentin enabling mesa3d as
an OpenCL provider, and clinfo as a first package using OpenCL.

OpenCL, like OpenGL or EGL, is an API specified by Khronos, so it can
have multiple implementations. Therefore, tying clinfo directly with
mesa3d wasn't the right thing to do.

And indeed, we have at least another package in Buildroot that
provides an OpenCL implementation: nvidia-driver, and clinfo builds
fine against it.

So, this series introduces a virtual-package for OpenCL, and makes
nvidia-driver and mesa3d providers of OpenCL. In order to make
nvidia-driver a provider of OpenCL, we need to teach mesa3d-headers
how to install OpenCL headers, because nvidia-drivers doesn't provide
them (just like it doesn't provide GL, EGL, etc. headers).

Thomas

Thomas Petazzoni (4):
  package/opengl/opencl: new virtual package
  package/mesa3d-headers: install OpenCL headers when needed
  package/nvidia-driver: use += where appropriate
  package/nvidia-driver: become an OpenCL provider

Valentin Korenblit (2):
  package/mesa3d: enable OpenCL support
  package/clinfo: new package

 DEVELOPERS                                      |  1 +
 package/Config.in                               |  1 +
 package/clinfo/Config.in                        | 12 ++++++++
 package/clinfo/clinfo.hash                      |  4 +++
 package/clinfo/clinfo.mk                        | 21 ++++++++++++++
 package/mesa3d-headers/mesa3d-headers.mk        |  4 +++
 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch | 37 +++++++++++++++++++++++++
 package/mesa3d/Config.in                        | 14 ++++++++++
 package/mesa3d/mesa3d.mk                        | 12 +++++++-
 package/nvidia-driver/Config.in                 |  5 ++++
 package/nvidia-driver/nvidia-driver.mk          |  8 ++++--
 package/opengl/Config.in                        |  1 +
 package/opengl/libopencl/Config.in              |  6 ++++
 package/opengl/libopencl/libopencl.mk           |  7 +++++
 14 files changed, 129 insertions(+), 4 deletions(-)
 create mode 100644 package/clinfo/Config.in
 create mode 100644 package/clinfo/clinfo.hash
 create mode 100644 package/clinfo/clinfo.mk
 create mode 100644 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
 create mode 100644 package/opengl/libopencl/Config.in
 create mode 100644 package/opengl/libopencl/libopencl.mk

-- 
2.14.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
@ 2018-10-20 22:14 ` Thomas Petazzoni
  2018-10-21 10:46   ` Valentin Korenblit
  2018-10-21 14:29   ` Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support Thomas Petazzoni
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/opengl/Config.in              | 1 +
 package/opengl/libopencl/Config.in    | 6 ++++++
 package/opengl/libopencl/libopencl.mk | 7 +++++++
 3 files changed, 14 insertions(+)
 create mode 100644 package/opengl/libopencl/Config.in
 create mode 100644 package/opengl/libopencl/libopencl.mk

diff --git a/package/opengl/Config.in b/package/opengl/Config.in
index 20ee28b06e..cbc001427d 100644
--- a/package/opengl/Config.in
+++ b/package/opengl/Config.in
@@ -1,5 +1,6 @@
 source "package/opengl/libgl/Config.in"
 source "package/opengl/libegl/Config.in"
 source "package/opengl/libgles/Config.in"
+source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
 source "package/opengl/libopenmax/Config.in"
diff --git a/package/opengl/libopencl/Config.in b/package/opengl/libopencl/Config.in
new file mode 100644
index 0000000000..57a3ad7d0d
--- /dev/null
+++ b/package/opengl/libopencl/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBOPENCL
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBOPENCL
+	string
+	depends on BR2_PACKAGE_HAS_LIBOPENCL
diff --git a/package/opengl/libopencl/libopencl.mk b/package/opengl/libopencl/libopencl.mk
new file mode 100644
index 0000000000..e1c71f82d1
--- /dev/null
+++ b/package/opengl/libopencl/libopencl.mk
@@ -0,0 +1,7 @@
+################################################################################
+#
+# libopencl
+#
+################################################################################
+
+$(eval $(virtual-package))
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package Thomas Petazzoni
@ 2018-10-20 22:14 ` Thomas Petazzoni
  2018-10-21 10:53   ` Valentin Korenblit
  2018-10-20 22:14 ` [Buildroot] [PATCH 3/6] package/mesa3d-headers: install OpenCL headers when needed Thomas Petazzoni
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

From: Valentin Korenblit <valentinkorenblit@gmail.com>

This patch provides Clover, the OpenCL 1.1 API implementation by Mesa
for AMD GPUs. It generates libOpenCL.so.

Add --disable-opencl-icd because in Mesa 18 it defaults to on.  When
disabled, the shared library is named libOpenCL instead of
libMesaOpenCL and CL headers are installed.

Given that clc headers are being installed to a non-standard location,
it is necessary to specify this path in configure.ac. Otherwise,
pkg-config will output the absolute path to these headers located in
STAGING_DIR, which will cause a runtime error when calling
clBuildProgram.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
[Thomas:
 - improve the description of the patch, based on input from Romain
 - register as a libopencl provider]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch | 37 +++++++++++++++++++++++++
 package/mesa3d/Config.in                        | 14 ++++++++++
 package/mesa3d/mesa3d.mk                        | 12 +++++++-
 3 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch

diff --git a/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch b/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
new file mode 100644
index 0000000000..42ae826a36
--- /dev/null
+++ b/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
@@ -0,0 +1,37 @@
+From 94bceeb621e36f3188c6246a763def8695526578 Mon Sep 17 00:00:00 2001
+From: Valentin Korenblit <valentinkorenblit@gmail.com>
+Date: Sat, 20 Oct 2018 10:56:23 +0200
+Subject: [PATCH] Set proper value for LIBCLC_INCLUDEDIR
+
+LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
+will look for OpenCL "headers" on the target, when building the OpenCL
+kernels.
+
+The value returned by pkg-config for includedir is relevant when
+cross-compiling, on the build machine. But in this specific case, we
+really need a value that is valid on the target.
+
+Those headers are installed by the libclc package in /usr/share so
+that they are not removed by Buildroot target-finalize logic.
+
+Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 864dcae..cc2390b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2429,7 +2429,7 @@ if test "x$enable_opencl" = xyes; then
+                     PKG_CONFIG_PATH environment variable.
+                     By default libclc.pc is installed to /usr/local/share/pkgconfig/])
+     else
+-        LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
++        LIBCLC_INCLUDEDIR="/usr/share"
+         LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
+         AC_SUBST([LIBCLC_INCLUDEDIR])
+         AC_SUBST([LIBCLC_LIBEXECDIR])
+-- 
+2.7.4
+
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index 872859b693..345f5a28ea 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -50,6 +50,17 @@ comment "llvm support needs a toolchain not affected by GCC bug 64735"
 	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
 
+# clang and libclc dependencies are satisfied by
+# BR2_PACKAGE_MESA3D_LLVM
+config BR2_PACKAGE_MESA3D_OPENCL
+	bool "OpenCL support"
+	depends on BR2_PACKAGE_MESA3D_LLVM
+	depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 || \
+		BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
+	select BR2_PACKAGE_CLANG
+	select BR2_PACKAGE_LIBCLC
+	select BR2_PACKAGE_HAS_LIBOPENCL
+
 # inform the .mk file of gallium, dri or vulkan driver selection
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	bool
@@ -270,6 +281,9 @@ config BR2_PACKAGE_PROVIDES_LIBEGL
 config BR2_PACKAGE_PROVIDES_LIBGLES
 	default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_ES
 
+config BR2_PACKAGE_PROVIDES_LIBOPENCL
+	default "mesa3d" if BR2_PACKAGE_MESA3D_OPENCL
+
 endif # BR2_PACKAGE_MESA3D
 
 comment "mesa3d needs a toolchain w/ C++, NPTL, dynamic library"
diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index d0f231792e..00d025d450 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -11,6 +11,7 @@ MESA3D_SITE = https://mesa.freedesktop.org/archive
 MESA3D_LICENSE = MIT, SGI, Khronos
 MESA3D_LICENSE_FILES = docs/license.html
 # 0002-configure.ac-invert-order-for-wayland-scanner-check.patch
+# 0003-set-LIBCLC_INCLUDEDIR.patch
 MESA3D_AUTORECONF = YES
 
 MESA3D_INSTALL_STAGING = YES
@@ -44,8 +45,17 @@ else
 MESA3D_CONF_OPTS += --disable-llvm
 endif
 
-# Disable opencl in case libclc is detected
+# Disable opencl-icd: OpenCL lib will be named libOpenCL instead of
+# libMesaOpenCL and CL headers are installed
+ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
+MESA3D_PROVIDES += libopencl
+MESA3D_DEPENDENCIES += clang libclc
+MESA3D_CONF_OPTS += --enable-opencl \
+	--disable-opencl-icd \
+	--with-clang-libdir=$(STAGING_DIR)/usr/lib
+else
 MESA3D_CONF_OPTS += --disable-opencl
+endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y)
 MESA3D_DEPENDENCIES += elfutils
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 3/6] package/mesa3d-headers: install OpenCL headers when needed
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support Thomas Petazzoni
@ 2018-10-20 22:14 ` Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 4/6] package/nvidia-driver: use += where appropriate Thomas Petazzoni
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/mesa3d-headers/mesa3d-headers.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/mesa3d-headers/mesa3d-headers.mk b/package/mesa3d-headers/mesa3d-headers.mk
index c3eaaac3d8..a337e76cea 100644
--- a/package/mesa3d-headers/mesa3d-headers.mk
+++ b/package/mesa3d-headers/mesa3d-headers.mk
@@ -63,6 +63,10 @@ ifeq ($(BR2_PACKAGE_HAS_LIBGLES),y)
 MESA3D_HEADERS_DIRS += GLES GLES2
 endif
 
+ifeq ($(BR2_PACKAGE_HAS_LIBOPENCL),y)
+MESA3D_HEADERS_DIRS += CL
+endif
+
 define MESA3D_HEADERS_BUILD_CMDS
 	$(MESA3D_HEADERS_BUILD_DRI_PC)
 endef
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 4/6] package/nvidia-driver: use += where appropriate
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2018-10-20 22:14 ` [Buildroot] [PATCH 3/6] package/mesa3d-headers: install OpenCL headers when needed Thomas Petazzoni
@ 2018-10-20 22:14 ` Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 5/6] package/nvidia-driver: become an OpenCL provider Thomas Petazzoni
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

Within the BR2_PACKAGE_NVIDIA_DRIVER_XORG condition, some "="
assignements are used for various variables, which are also appended
in other conditions below in nvidia-driver.mk.

It works fine because those assignements appear earlier in the .mk,
but it is a bit error-prone, so let's use += when adding values to
those variables.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/nvidia-driver/nvidia-driver.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/nvidia-driver/nvidia-driver.mk b/package/nvidia-driver/nvidia-driver.mk
index a595aed4f7..0d051fcaa4 100644
--- a/package/nvidia-driver/nvidia-driver.mk
+++ b/package/nvidia-driver/nvidia-driver.mk
@@ -20,8 +20,8 @@ ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_XORG),y)
 # are build dependencies of packages that depend on nvidia-driver, so
 # they should be built prior to those packages, and the only simple
 # way to do so is to make nvidia-driver depend on them.
-NVIDIA_DRIVER_DEPENDENCIES = mesa3d-headers xlib_libX11 xlib_libXext
-NVIDIA_DRIVER_PROVIDES = libgl libegl libgles
+NVIDIA_DRIVER_DEPENDENCIES += mesa3d-headers xlib_libX11 xlib_libXext
+NVIDIA_DRIVER_PROVIDES += libgl libegl libgles
 
 # libGL.so.$(NVIDIA_DRIVER_VERSION) is the legacy libGL.so library; it
 # has been replaced with libGL.so.1.0.0. Installing both is technically
@@ -65,7 +65,7 @@ NVIDIA_DRIVER_LIBS_MISC = \
 	libvdpau_nvidia.so.$(NVIDIA_DRIVER_VERSION) \
 	libnvidia-ml.so.$(NVIDIA_DRIVER_VERSION)
 
-NVIDIA_DRIVER_LIBS = \
+NVIDIA_DRIVER_LIBS += \
 	$(NVIDIA_DRIVER_LIBS_GL) \
 	$(NVIDIA_DRIVER_LIBS_EGL) \
 	$(NVIDIA_DRIVER_LIBS_GLES) \
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 5/6] package/nvidia-driver: become an OpenCL provider
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2018-10-20 22:14 ` [Buildroot] [PATCH 4/6] package/nvidia-driver: use += where appropriate Thomas Petazzoni
@ 2018-10-20 22:14 ` Thomas Petazzoni
  2018-10-20 22:14 ` [Buildroot] [PATCH 6/6] package/clinfo: new package Thomas Petazzoni
  2018-12-03 22:09 ` [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
  6 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

We need to install the mesa3d-headers, because the CL headers are not
provided by nvidia-driver (just like it didn't provide the OpenGL
headers).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/nvidia-driver/Config.in        | 5 +++++
 package/nvidia-driver/nvidia-driver.mk | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/package/nvidia-driver/Config.in b/package/nvidia-driver/Config.in
index 732d9255c7..9631b3e70c 100644
--- a/package/nvidia-driver/Config.in
+++ b/package/nvidia-driver/Config.in
@@ -60,6 +60,11 @@ if BR2_PACKAGE_NVIDIA_DRIVER_CUDA
 
 config BR2_PACKAGE_NVIDIA_DRIVER_OPENCL
 	bool "OpenCL support"
+	select BR2_PACKAGE_MESA3D_HEADERS
+	select BR2_PACKAGE_HAS_LIBOPENCL
+
+config BR2_PACKAGE_PROVIDES_LIBOPENCL
+	default "nvidia-driver" if BR2_PACKAGE_NVIDIA_DRIVER_OPENCL
 
 config BR2_PACKAGE_NVIDIA_DRIVER_CUDA_PROGS
 	bool "CUDA MPS server and control"
diff --git a/package/nvidia-driver/nvidia-driver.mk b/package/nvidia-driver/nvidia-driver.mk
index 0d051fcaa4..baf2ba2be5 100644
--- a/package/nvidia-driver/nvidia-driver.mk
+++ b/package/nvidia-driver/nvidia-driver.mk
@@ -116,6 +116,8 @@ ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_OPENCL),y)
 NVIDIA_DRIVER_LIBS += \
 	libOpenCL.so.1.0.0 \
 	libnvidia-opencl.so.$(NVIDIA_DRIVER_VERSION)
+NVIDIA_DRIVER_DEPENDENCIES += mesa3d-headers
+NVIDIA_DRIVER_PROVIDES += libopencl
 endif
 
 # Build and install the kernel modules if needed
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 6/6] package/clinfo: new package
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2018-10-20 22:14 ` [Buildroot] [PATCH 5/6] package/nvidia-driver: become an OpenCL provider Thomas Petazzoni
@ 2018-10-20 22:14 ` Thomas Petazzoni
  2018-12-03 22:09 ` [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
  6 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 22:14 UTC (permalink / raw)
  To: buildroot

From: Valentin Korenblit <valentinkorenblit@gmail.com>

This tool allows to verify if the OpenCL environment is set up correctly
and provides information related to the supported OpenCL platforms.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
[Thomas:
 - use the libopencl virtual package
 - add LICENSE to the license files]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/clinfo/Config.in   | 12 ++++++++++++
 package/clinfo/clinfo.hash |  4 ++++
 package/clinfo/clinfo.mk   | 21 +++++++++++++++++++++
 5 files changed, 39 insertions(+)
 create mode 100644 package/clinfo/Config.in
 create mode 100644 package/clinfo/clinfo.hash
 create mode 100644 package/clinfo/clinfo.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 61f3cac9e4..3827489321 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2120,6 +2120,7 @@ F:	package/tstools/
 
 N:	Valentin Korenblit <valentinkorenblit@gmail.com>
 F:	package/clang/
+F:	package/clinfo/
 F:	package/libclc/
 F:	package/llvm/
 
diff --git a/package/Config.in b/package/Config.in
index 8d53c72138..18b6421e30 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -83,6 +83,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/blktrace/Config.in"
 	source "package/bonnie/Config.in"
 	source "package/cache-calibrator/Config.in"
+	source "package/clinfo/Config.in"
 	source "package/dhrystone/Config.in"
 	source "package/dieharder/Config.in"
 	source "package/dmalloc/Config.in"
diff --git a/package/clinfo/Config.in b/package/clinfo/Config.in
new file mode 100644
index 0000000000..3df4feeca2
--- /dev/null
+++ b/package/clinfo/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_CLINFO
+	bool "clinfo"
+	depends on BR2_PACKAGE_HAS_LIBOPENCL
+	help
+	  clinfo is a simple command-line application that enumerates
+	  all possible (known) properties of the OpenCL platform and
+	  devices available on the system.
+
+	  https://github.com/Oblomov/clinfo
+
+comment "clinfo needs an OpenCL provider"
+	depends on !BR2_PACKAGE_HAS_LIBOPENCL
diff --git a/package/clinfo/clinfo.hash b/package/clinfo/clinfo.hash
new file mode 100644
index 0000000000..d5766e6322
--- /dev/null
+++ b/package/clinfo/clinfo.hash
@@ -0,0 +1,4 @@
+# locally calculated
+sha256 64b02e68ccff3b95437bd0bd70dcb88438c58adec16a7145a5d4e5c26a898ccf clinfo-2.2.18.03.26.tar.gz
+sha256 a2010f343487d3f7618affe54f789f5487602331c0a8d03f49e9a7c547cf0499 legalcode.txt
+sha256 2a7a9321be169ea6edbc6b1010e8f7bb0f4c1482a2f65c34a49e9719f129b79a LICENSE
diff --git a/package/clinfo/clinfo.mk b/package/clinfo/clinfo.mk
new file mode 100644
index 0000000000..cf08692316
--- /dev/null
+++ b/package/clinfo/clinfo.mk
@@ -0,0 +1,21 @@
+################################################################################
+#
+# clinfo
+#
+################################################################################
+
+CLINFO_VERSION = 2.2.18.03.26
+CLINFO_SITE = $(call github,Oblomov,clinfo,$(CLINFO_VERSION))
+CLINFO_LICENSE = CC0-1.0
+CLINFO_LICENSE_FILES = legalcode.txt LICENSE
+CLINFO_DEPENDENCIES = libopencl
+
+define CLINFO_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
+endef
+
+define CLINFO_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(@D)/clinfo $(TARGET_DIR)/usr/bin/clinfo
+endef
+
+$(eval $(generic-package))
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package
  2018-10-20 22:14 ` [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package Thomas Petazzoni
@ 2018-10-21 10:46   ` Valentin Korenblit
  2018-10-21 14:29   ` Thomas Petazzoni
  1 sibling, 0 replies; 12+ messages in thread
From: Valentin Korenblit @ 2018-10-21 10:46 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reviewed-by: Valentin Korenblit<valentinkorenblit@gmail.com>

> ---
>   package/opengl/Config.in              | 1 +
>   package/opengl/libopencl/Config.in    | 6 ++++++
>   package/opengl/libopencl/libopencl.mk | 7 +++++++
>   3 files changed, 14 insertions(+)
>   create mode 100644 package/opengl/libopencl/Config.in
>   create mode 100644 package/opengl/libopencl/libopencl.mk
>
> diff --git a/package/opengl/Config.in b/package/opengl/Config.in
> index 20ee28b06e..cbc001427d 100644
> --- a/package/opengl/Config.in
> +++ b/package/opengl/Config.in
> @@ -1,5 +1,6 @@
>   source "package/opengl/libgl/Config.in"
>   source "package/opengl/libegl/Config.in"
>   source "package/opengl/libgles/Config.in"
> +source "package/opengl/libopencl/Config.in"
>   source "package/opengl/libopenvg/Config.in"
>   source "package/opengl/libopenmax/Config.in"
> diff --git a/package/opengl/libopencl/Config.in b/package/opengl/libopencl/Config.in
> new file mode 100644
> index 0000000000..57a3ad7d0d
> --- /dev/null
> +++ b/package/opengl/libopencl/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_HAS_LIBOPENCL
> +	bool
> +
> +config BR2_PACKAGE_PROVIDES_LIBOPENCL
> +	string
> +	depends on BR2_PACKAGE_HAS_LIBOPENCL
> diff --git a/package/opengl/libopencl/libopencl.mk b/package/opengl/libopencl/libopencl.mk
> new file mode 100644
> index 0000000000..e1c71f82d1
> --- /dev/null
> +++ b/package/opengl/libopencl/libopencl.mk
> @@ -0,0 +1,7 @@
> +################################################################################
> +#
> +# libopencl
> +#
> +################################################################################
> +
> +$(eval $(virtual-package))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20181021/ab120b2b/attachment.html>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support
  2018-10-20 22:14 ` [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support Thomas Petazzoni
@ 2018-10-21 10:53   ` Valentin Korenblit
  2018-10-21 11:10     ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Valentin Korenblit @ 2018-10-21 10:53 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

> From: Valentin Korenblit <valentinkorenblit@gmail.com>
>
> This patch provides Clover, the OpenCL 1.1 API implementation by Mesa
> for AMD GPUs. It generates libOpenCL.so.
>
> Add --disable-opencl-icd because in Mesa 18 it defaults to on.  When
> disabled, the shared library is named libOpenCL instead of
> libMesaOpenCL and CL headers are installed.
>
> Given that clc headers are being installed to a non-standard location,
> it is necessary to specify this path in configure.ac. Otherwise,
> pkg-config will output the absolute path to these headers located in
> STAGING_DIR, which will cause a runtime error when calling
> clBuildProgram.
>
> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
> Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
> [Thomas:
>   - improve the description of the patch, based on input from Romain
>   - register as a libopencl provider]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>   package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch | 37 +++++++++++++++++++++++++
>   package/mesa3d/Config.in                        | 14 ++++++++++
>   package/mesa3d/mesa3d.mk                        | 12 +++++++-
>   3 files changed, 62 insertions(+), 1 deletion(-)
>   create mode 100644 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
>
> diff --git a/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch b/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
> new file mode 100644
> index 0000000000..42ae826a36
> --- /dev/null
> +++ b/package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
> @@ -0,0 +1,37 @@
> +From 94bceeb621e36f3188c6246a763def8695526578 Mon Sep 17 00:00:00 2001
> +From: Valentin Korenblit <valentinkorenblit@gmail.com>
> +Date: Sat, 20 Oct 2018 10:56:23 +0200
> +Subject: [PATCH] Set proper value for LIBCLC_INCLUDEDIR
> +
> +LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
> +will look for OpenCL "headers" on the target, when building the OpenCL
> +kernels.

Maybe it is clearer to write "OpenCL library headers", so we don't get confused
with Khronos OpenCL-Headers.

Valentin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20181021/079a66b8/attachment.html>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support
  2018-10-21 10:53   ` Valentin Korenblit
@ 2018-10-21 11:10     ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-21 11:10 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 21 Oct 2018 12:53:45 +0200, Valentin Korenblit wrote:

> > +LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
> > +will look for OpenCL "headers" on the target, when building the OpenCL
> > +kernels.  
> 
> Maybe it is clearer to write "OpenCL library headers", so we don't get confused
> with Khronos OpenCL-Headers.

I understand the confusion, but "OpenCL library headers" actually make
me think about the Khronos headers, i.e the headers that describe the
API of the OpenCL.so library.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package
  2018-10-20 22:14 ` [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package Thomas Petazzoni
  2018-10-21 10:46   ` Valentin Korenblit
@ 2018-10-21 14:29   ` Thomas Petazzoni
  1 sibling, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-10-21 14:29 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 21 Oct 2018 00:14:32 +0200, Thomas Petazzoni wrote:
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/opengl/Config.in              | 1 +
>  package/opengl/libopencl/Config.in    | 6 ++++++
>  package/opengl/libopencl/libopencl.mk | 7 +++++++
>  3 files changed, 14 insertions(+)
>  create mode 100644 package/opengl/libopencl/Config.in
>  create mode 100644 package/opengl/libopencl/libopencl.mk

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 0/6] OpenCL support
  2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2018-10-20 22:14 ` [Buildroot] [PATCH 6/6] package/clinfo: new package Thomas Petazzoni
@ 2018-12-03 22:09 ` Thomas Petazzoni
  6 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2018-12-03 22:09 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 21 Oct 2018 00:14:31 +0200, Thomas Petazzoni wrote:

> Thomas Petazzoni (4):
>   package/opengl/opencl: new virtual package
>   package/mesa3d-headers: install OpenCL headers when needed
>   package/nvidia-driver: use += where appropriate
>   package/nvidia-driver: become an OpenCL provider
> 
> Valentin Korenblit (2):
>   package/mesa3d: enable OpenCL support
>   package/clinfo: new package

I've applied patches 2-6 in this series, since PATCH 1/6 was already
applied since a long time, and no further comments were received.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-03 22:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-20 22:14 [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni
2018-10-20 22:14 ` [Buildroot] [PATCH 1/6] package/opengl/opencl: new virtual package Thomas Petazzoni
2018-10-21 10:46   ` Valentin Korenblit
2018-10-21 14:29   ` Thomas Petazzoni
2018-10-20 22:14 ` [Buildroot] [PATCH 2/6] package/mesa3d: enable OpenCL support Thomas Petazzoni
2018-10-21 10:53   ` Valentin Korenblit
2018-10-21 11:10     ` Thomas Petazzoni
2018-10-20 22:14 ` [Buildroot] [PATCH 3/6] package/mesa3d-headers: install OpenCL headers when needed Thomas Petazzoni
2018-10-20 22:14 ` [Buildroot] [PATCH 4/6] package/nvidia-driver: use += where appropriate Thomas Petazzoni
2018-10-20 22:14 ` [Buildroot] [PATCH 5/6] package/nvidia-driver: become an OpenCL provider Thomas Petazzoni
2018-10-20 22:14 ` [Buildroot] [PATCH 6/6] package/clinfo: new package Thomas Petazzoni
2018-12-03 22:09 ` [Buildroot] [PATCH 0/6] OpenCL support Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.