package/nvidia-driver: add option to install CUDA MPS server
authorYann E. MORIN <yann.morin.1998@free.fr>
Tue, 31 Mar 2015 17:45:35 +0000 (19:45 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 1 Apr 2015 21:25:03 +0000 (23:25 +0200)
Using CUDA with NVidia requires those two programs if one wants to use
more than one program doing CUDA at the same time.

This is only available on x86_64.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Al West <al.west@v-nova.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/nvidia-driver/Config.in
package/nvidia-driver/nvidia-driver.mk

index a63576cff1552ec0ca270a2e7e6cc445fb5665d6..b50e2c353a48dca3bc8722b3c9a299c1b5708176 100644 (file)
@@ -55,9 +55,20 @@ endif # BR2_PACKAGE_NVIDIA_DRIVER_XORG
 config BR2_PACKAGE_NVIDIA_DRIVER_CUDA
        bool "CUDA support"
 
+if BR2_PACKAGE_NVIDIA_DRIVER_CUDA
+
 config BR2_PACKAGE_NVIDIA_DRIVER_OPENCL
        bool "OpenCL support"
-       depends on BR2_PACKAGE_NVIDIA_DRIVER_CUDA
+
+config BR2_PACKAGE_NVIDIA_DRIVER_CUDA_PROGS
+       bool "CUDA MPS server and control"
+       depends on BR2_x86_64
+       help
+         Say 'y' here if you need to run more than one program
+         doing CUDA at the same time. The MPS server will be
+         launched automatically when needed.
+
+endif # BR2_PACKAGE_NVIDIA_DRIVER_CUDA
 
 comment "nvidia kernel module needs a kernel to be built"
        depends on !BR2_LINUX_KERNEL
index 454209ac13e9eb733f038cd1ae3fe953b562de32..a85cc1cd1171a6e2e16eac3346e40f16cbe94be8 100644 (file)
@@ -57,6 +57,9 @@ endif # X drivers
 
 ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_CUDA),y)
 NVIDIA_DRIVER_LIBS += libcuda libnvidia-compiler libnvcuvid libnvidia-encode
+ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_CUDA_PROGS),y)
+NVIDIA_DRIVER_PROGS = nvidia-cuda-mps-control nvidia-cuda-mps-server
+endif
 endif
 
 ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_OPENCL),y)
@@ -165,6 +168,10 @@ define NVIDIA_DRIVER_INSTALL_TARGET_CMDS
                $(INSTALL) -D -m 0644 $(@D)/$${m##*/} \
                        $(TARGET_DIR)/usr/lib/xorg/modules/$${m}; \
        done
+       for p in $(NVIDIA_DRIVER_PROGS); do \
+               $(INSTALL) -D -m 0755 $(@D)/$${p} \
+                       $(TARGET_DIR)/usr/bin/$${p}; \
+       done
        $(NVIDIA_DRIVER_INSTALL_KERNEL_MODULE)
 endef