From 08948089a303cf87c10685b95098bf53731285ee Mon Sep 17 00:00:00 2001 From: Jimbo Date: Mon, 26 Aug 2024 15:40:42 -0400 Subject: [PATCH] Allow Cuda to be used by Nvidia clients --- nixos/hardware/nvidia.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/hardware/nvidia.nix b/nixos/hardware/nvidia.nix index 6a1c28c..553cf10 100644 --- a/nixos/hardware/nvidia.nix +++ b/nixos/hardware/nvidia.nix @@ -8,4 +8,15 @@ package = config.boot.kernelPackages.nvidiaPackages.beta; open = true; }; + + pkgs.stdenv.mkDerivation { + name = "cuda-env-shell"; + buildInputs = with pkgs; [ + cudatoolkit + ]; + shellHook = '' + export CUDA_PATH=${pkgs.cudatoolkit} + export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib" + export EXTRA_CCFLAGS="-I/usr/include" + ''; }