From patchwork Wed Apr 4 16:31:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895065 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgw12vpz9s0p for ; Thu, 5 Apr 2018 02:31:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 77BA786709; Wed, 4 Apr 2018 16:31:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rrSZRoNVgN3k; Wed, 4 Apr 2018 16:31:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E0F9486895; Wed, 4 Apr 2018 16:31:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 464301C1599 for ; Wed, 4 Apr 2018 16:31:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 43B96307D4 for ; Wed, 4 Apr 2018 16:31:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DrSwYWs0JkdB for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by silver.osuosl.org (Postfix) with ESMTPS id 5B612307D0 for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 2DC881EE278B; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mjgAkiWj6+5H; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id F28841EE1954; Wed, 4 Apr 2018 18:31:40 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:23 +0200 Message-Id: <20180404163124.27934-7-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> Subject: [Buildroot] [PATCH v5 6/7] package/mesa3d: enable OpenCL support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch provides Clover, the OpenCL 1.1 API implementation by Mesa for AMD GPUs. It generates libOpenCL.so. Add --disable-opencl-icd because int Mesa 18 defaults to on. When disabled, the shared library is named libOpenCL instead of libMesaOpenCL and CL headers are installed. Signed-off-by: Valentin Korenblit --- Tested with AMD Radeon Dual (AMD SUMO + AMD CAICOS) using Gallium r600: Piglit taken from Romain Naour's patch, setting -DPIGLIT_BUILD_CL_TESTS=ON: http://lists.busybox.net/pipermail/buildroot/2018-February/213601.html Results from 704 tests: skip 94 pass 541 fail 60 crash 9 Opencl-example (100% pass): https://cgit.freedesktop.org/~tstellar/opencl-example/ package/mesa3d/Config.in | 17 +++++++++++++++++ package/mesa3d/mesa3d.mk | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in index ffe0287ac5..600f9ffdda 100644 --- a/package/mesa3d/Config.in +++ b/package/mesa3d/Config.in @@ -30,6 +30,23 @@ config BR2_PACKAGE_MESA3D_LLVM depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS select BR2_PACKAGE_LLVM +config BR2_PACKAGE_MESA3D_OPENCL + bool "opencl support" + depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 + depends on BR2_PACKAGE_MESA3D_LLVM + depends on BR2_USE_WCHAR # elfutils + depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC + depends on !BR2_bfin # elfutils + select BR2_PACKAGE_CLANG + select BR2_PACKAGE_ELFUTILS + select BR2_PACKAGE_LIBCLC + +comment "mesa3d OpenCL needs a uClibc or glibc toolchain w/ wchar" + depends on BR2_PACKAGE_MESA3D_LLVM + depends on !BR2_bfin + depends on !BR2_USE_WCHAR \ + || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) + # inform the .mk file of gallium, dri or vulkan driver selection config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER bool diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk index 506f84274f..0d00b3f1b9 100644 --- a/package/mesa3d/mesa3d.mk +++ b/package/mesa3d/mesa3d.mk @@ -230,4 +230,14 @@ else MESA3D_CONF_OPTS += --disable-lmsensors endif +# Clover requires libelf +ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y) +MESA3D_DEPENDENCIES += clang elfutils libclc +MESA3D_CONF_OPTS += --enable-opencl \ + --disable-opencl-icd \ + --with-clang-libdir=$(STAGING_DIR)/usr/lib +else +MESA3D_CONF_OPTS += --disable-opencl +endif + $(eval $(autotools-package))