From ceb02c00ff88624f900fa4203745d5ce535b87b7 Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Tue, 23 Aug 2016 14:19:50 +0200 Subject: [PATCH] package/amd-catalyst: Add support for OpenCL The AMD Catalyst Linux driver includes OpenCL libraries for GPGPU computing. This commits adds support to install the binary blobs and ICD profiles. Signed-off-by: Romain Perier Reviewed-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- package/amd-catalyst/Config.in | 6 ++++++ package/amd-catalyst/amd-catalyst.mk | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/package/amd-catalyst/Config.in b/package/amd-catalyst/Config.in index 55099accf0..96e7f06481 100644 --- a/package/amd-catalyst/Config.in +++ b/package/amd-catalyst/Config.in @@ -73,4 +73,10 @@ config BR2_PACKAGE_AMD_CATALYST_MODULE help Builds and install the fglrx kernel module +config BR2_PACKAGE_AMD_CATALYST_OPENCL + bool "OpenCL support" + help + Installs the OpenCL binary blobs and the ICD profile + for GPGPU computing. + endif # BR2_PACKAGE_AMD_CATALYST diff --git a/package/amd-catalyst/amd-catalyst.mk b/package/amd-catalyst/amd-catalyst.mk index 07eb0faf7f..30973534b2 100644 --- a/package/amd-catalyst/amd-catalyst.mk +++ b/package/amd-catalyst/amd-catalyst.mk @@ -41,6 +41,29 @@ AMD_CATALYST_POST_PATCH_HOOKS += AMD_CATALYST_PREPARE_MODULE $(eval $(kernel-module)) endif +ifeq ($(BR2_PACKAGE_AMD_CATALYST_OPENCL),y) + +AMD_CATALYST_OCL_SUFFIX = $(if $(BR2_x86_64),64,32) +AMD_CATALYST_OPENCL_FILES = \ + libOpenCL.so.1 \ + libaticalcl.so \ + libamdocl$(AMD_CATALYST_OCL_SUFFIX).so \ + libamdocl12cl$(AMD_CATALYST_OCL_SUFFIX).so + +define AMD_CATALYST_INSTALL_OPENCL + $(foreach f,$(AMD_CATALYST_OPENCL_FILES), \ + $(INSTALL) -D -m 0755 $(AMD_CATALYST_ARCH_DIR)/usr/lib$(AMD_CATALYST_LIB_SUFFIX)/$(f) $(TARGET_DIR)/usr/lib/$(f) + ) + ln -sf libOpenCL.so.1 \ + $(TARGET_DIR)/usr/lib/libOpenCL.so + $(INSTALL) -m 0755 $(AMD_CATALYST_ARCH_DIR)/usr/bin/clinfo \ + $(TARGET_DIR)/usr/bin/clinfo + $(INSTALL) -D -m 0644 $(AMD_CATALYST_ARCH_DIR)/etc/OpenCL/vendors/amdocl$(AMD_CATALYST_OCL_SUFFIX).icd \ + $(TARGET_DIR)/etc/OpenCL/vendors/amdocl$(AMD_CATALYST_OCL_SUFFIX).icd +endef + +endif + ifeq ($(BR2_PACKAGE_AMD_CATALYST_XORG), y) # GL headers are needed by any package that wants to use libgl, so they need to @@ -145,6 +168,7 @@ define AMD_CATALYST_INSTALL_TARGET_CMDS $(call AMD_CATALYST_INSTALL_XORG) $(call AMD_CATALYST_INSTALL_CMDLINE_TOOLS) $(call AMD_CATALYST_INSTALL_CCCLE) + $(call AMD_CATALYST_INSTALL_OPENCL) endef $(eval $(generic-package)) -- 2.30.2