From patchwork Tue Mar 31 17:45:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 456713 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 185C01400DD for ; Wed, 1 Apr 2015 04:45:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=VwzwNwxy; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 486E7A30D9; Tue, 31 Mar 2015 17:45:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4djd49Eh8UtM; Tue, 31 Mar 2015 17:45:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0DF90A1394; Tue, 31 Mar 2015 17:45:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2271C1C1600 for ; Tue, 31 Mar 2015 17:45:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1EC3C8F761 for ; Tue, 31 Mar 2015 17:45:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nQ7VB4z8whH7 for ; Tue, 31 Mar 2015 17:45:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id B7BA381156 for ; Tue, 31 Mar 2015 17:45:38 +0000 (UTC) Received: by wibgn9 with SMTP id gn9so35691206wib.1 for ; Tue, 31 Mar 2015 10:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pc4h/BpIqWHUviwBPALLvRIIu4GRJkzVAEqmS4oxX3U=; b=VwzwNwxyzC2+7wJN+mMm6bzhLPrMunaMYnjehtzDQF5g43x6KMaKWmTfp64xJEJg+9 3+46JWmNABxDP0hbSLBpOt0TdUN02KJk0skiJi0EAVBhroF2LzA7YHw+NaJC2HFZqOGM 4ENC+KM7QQ4Q6gVmdfLR6jnAOqdJ6Pe3pUoAD+t+A1Bw9pwQAsOEbfBdFt5KB3He4xvG sfY0csUDTOnOdIvCVQwuG6LIQ5gmqKrHmd2g9umMFSqktxQ1pJNFgU6/LH2kirbmqREL FyUkUa769Ix3CQVQ4Ea+/09h1F+8cxZ37o33maTb0I73mpy9bHVpoZqLSt6JH3dkbLdA JL8w== X-Received: by 10.194.173.199 with SMTP id bm7mr77715090wjc.76.1427823937433; Tue, 31 Mar 2015 10:45:37 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by mx.google.com with ESMTPSA id o10sm21878487wiy.18.2015.03.31.10.45.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Mar 2015 10:45:36 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Tue, 31 Mar 2015 19:45:34 +0200 Message-Id: <2e16677d7914c96eee67d84ad5d5192deeb9f733.1427823846.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 1/2] package/nvidia-driver: CUDA support does not require X.org X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, nvidia-driver always installs the X.org driver, assuming this is a requirement for all functionalities provided by nvidia-driver, thus pulling in quite a bunch of X.org packages. However, it is perfectly legit to be doing CUDA (and OpenCL) work without the full X.org stack, and indeed the NVidia CUDA and OpenCL libraries do not require the X.org stack. Split the configuration so that it is posible to install the different parts independently from each others, so that CUDA can be installed all on its own. Reported-by: Al West Signed-off-by: "Yann E. MORIN" Cc: Al West --- package/nvidia-driver/Config.in | 42 +++++++++++++++++++++------------- package/nvidia-driver/nvidia-driver.mk | 22 ++++++++++-------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/package/nvidia-driver/Config.in b/package/nvidia-driver/Config.in index cd7fc95..a63576c 100644 --- a/package/nvidia-driver/Config.in +++ b/package/nvidia-driver/Config.in @@ -1,12 +1,25 @@ -comment "nvidia-driver needs an (e)glibc toolchain and a modular Xorg server" +comment "nvidia-driver needs an (e)glibc toolchain" depends on BR2_i386 || BR2_x86_64 - depends on !BR2_TOOLCHAIN_USES_GLIBC \ - || !BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR + depends on !BR2_TOOLCHAIN_USES_GLIBC config BR2_PACKAGE_NVIDIA_DRIVER bool "nvidia-driver" depends on BR2_i386 || BR2_x86_64 depends on BR2_TOOLCHAIN_USES_GLIBC + help + The binary-only driver blob for NVidia cards. + This is the userland part only. + + http://www.nvidia.com/ + +if BR2_PACKAGE_NVIDIA_DRIVER + +comment "nvidia-driver X.org drivers needs a modular Xorg server" + depends on !BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR + +config BR2_PACKAGE_NVIDIA_DRIVER_XORG + bool "X.org drivers" + default y depends on BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR select BR2_PACKAGE_MESA3D_HEADERS select BR2_PACKAGE_XLIB_LIBX11 @@ -14,13 +27,8 @@ config BR2_PACKAGE_NVIDIA_DRIVER select BR2_PACKAGE_HAS_LIBGL select BR2_PACKAGE_HAS_LIBEGL select BR2_PACKAGE_HAS_LIBGLES - help - The binary-only driver blob for NVidia cards. - This is the userland part only. - http://www.nvidia.com/ - -if BR2_PACKAGE_NVIDIA_DRIVER +if BR2_PACKAGE_NVIDIA_DRIVER_XORG config BR2_PACKAGE_PROVIDES_LIBGL default "nvidia-driver" @@ -31,13 +39,6 @@ config BR2_PACKAGE_PROVIDES_LIBEGL config BR2_PACKAGE_PROVIDES_LIBGLES default "nvidia-driver" -config BR2_PACKAGE_NVIDIA_DRIVER_CUDA - bool "CUDA support" - -config BR2_PACKAGE_NVIDIA_DRIVER_OPENCL - bool "OpenCL support" - depends on BR2_PACKAGE_NVIDIA_DRIVER_CUDA - config BR2_PACKAGE_NVIDIA_DRIVER_PRIVATE_LIBS bool "Install private libraries" help @@ -49,6 +50,15 @@ config BR2_PACKAGE_NVIDIA_DRIVER_PRIVATE_LIBS Say 'y' here if you plan on running a program that uses those private libraries. +endif # BR2_PACKAGE_NVIDIA_DRIVER_XORG + +config BR2_PACKAGE_NVIDIA_DRIVER_CUDA + bool "CUDA support" + +config BR2_PACKAGE_NVIDIA_DRIVER_OPENCL + bool "OpenCL support" + depends on BR2_PACKAGE_NVIDIA_DRIVER_CUDA + comment "nvidia kernel module needs a kernel to be built" depends on !BR2_LINUX_KERNEL diff --git a/package/nvidia-driver/nvidia-driver.mk b/package/nvidia-driver/nvidia-driver.mk index 4605d02..454209a 100644 --- a/package/nvidia-driver/nvidia-driver.mk +++ b/package/nvidia-driver/nvidia-driver.mk @@ -13,6 +13,8 @@ NVIDIA_DRIVER_LICENSE_FILES = LICENSE NVIDIA_DRIVER_REDISTRIBUTE = NO NVIDIA_DRIVER_INSTALL_STAGING = YES +ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_XORG),y) + # Since nvidia-driver are binary blobs, the below dependencies are not # strictly speaking build dependencies of nvidia-driver. However, they # are build dependencies of packages that depend on nvidia-driver, so @@ -38,15 +40,6 @@ NVIDIA_DRIVER_LIBS = \ libvdpau libvdpau_nvidia \ libnvidia-ml -ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_CUDA),y) -NVIDIA_DRIVER_LIBS += libcuda libnvidia-compiler libnvcuvid libnvidia-encode -endif - -ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_OPENCL),y) -NVIDIA_DRIVER_LIBS_NO_VERSION += libOpenCL.so.1.0.0 -NVIDIA_DRIVER_LIBS += libnvidia-opencl -endif - # Those libraries are 'private' libraries requiring an agreement with # NVidia to develop code for those libs. There seems to be no restriction # on using those libraries (e.g. if the user has such an agreement, or @@ -60,6 +53,17 @@ NVIDIA_DRIVER_X_MODS = drivers/nvidia_drv.so \ extensions/libglx.so.$(NVIDIA_DRIVER_VERSION) \ libnvidia-wfb.so.$(NVIDIA_DRIVER_VERSION) +endif # X drivers + +ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_CUDA),y) +NVIDIA_DRIVER_LIBS += libcuda libnvidia-compiler libnvcuvid libnvidia-encode +endif + +ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_OPENCL),y) +NVIDIA_DRIVER_LIBS_NO_VERSION += libOpenCL.so.1.0.0 +NVIDIA_DRIVER_LIBS += libnvidia-opencl +endif + # The downloaded archive is in fact an auto-extract script. So, it can run # virtually everywhere, and it is fine enough to provide useful options. # Except it can't extract into an existing (even empty) directory.