From a4e0278fcd8c6bd98b4e003fa273c4cd63d7b383 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 3 Mar 2015 20:15:38 +0100 Subject: [PATCH] Create /dev/nvidia-uvm for CUDA support --- nixos/modules/hardware/video/nvidia.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index 2b20dc7395a..209310bec99 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -47,6 +47,15 @@ in boot.extraModulePackages = [ nvidia_x11 ]; + # nvidia-uvm is required by CUDA applications. + boot.kernelModules = [ "nvidia-uvm" ]; + + # Create /dev/nvidia-uvm when the nvidia-uvm module is loaded. + services.udev.extraRules = + '' + KERNEL=="nvidia_uvm", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'" + ''; + boot.blacklistedKernelModules = [ "nouveau" "nvidiafb" ]; services.acpid.enable = true;