Better environment switching for CUDA

This commit is contained in:
Adam Washington 2023-04-04 11:00:18 +01:00
parent cae02d752c
commit 8e26ccbdb4
No known key found for this signature in database
GPG Key ID: 0D2B93AB0C87BAF1

View File

@ -1,7 +1,6 @@
{ pkgs, isCUDA ? true, ... }:
let
cuda_path = if isCUDA then pkgs.cudatoolkit else "";
hardware_deps = with pkgs;
if isCUDA then [
cudatoolkit
@ -36,6 +35,6 @@ pkgs.mkShell rec {
glib
];
LD_LIBRARY_PATH=pkgs.lib.makeLibraryPath buildInputs;
CUDA_PATH=pkgs.cudatoolkit;
EXTRA_LDFLAGS="-L${pkgs.linuxPackages.nvidia_x11}/lib";
CUDA_PATH = pkgs.lib.optionalString isCUDA pkgs.cudatoolkit;
EXTRA_LDFLAGS = pkgs.lib.optionalString isCUDA "-L${pkgs.linuxPackages.nvidia_x11}/lib";
}