-
Notifications
You must be signed in to change notification settings - Fork 0
/
cuda.nix
40 lines (39 loc) · 974 Bytes
/
cuda.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs ? import <nixpkgs> {} }:
let
fhs = pkgs.buildFHSUserEnv {
name = "cuda-env";
targetPkgs = pkgs: with pkgs; [
git
gitRepo
gnupg
autoconf
curl
procps
gnumake
utillinux
m4
gperf
unzip
cudnn_cudatoolkit_11_2
linuxPackages.nvidia_x11
libGLU libGL
xorg.libXi xorg.libXmu freeglut
xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib
ncurses5
stdenv.cc
binutils
];
multiPkgs = pkgs: with pkgs; [ zlib ];
runScript = "bash";
profile = ''
export CUDA_PATH=${pkgs.cudnn_cudatoolkit_11_2}
# export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
export EXTRA_CCFLAGS="-I/usr/include"
'';
};
in pkgs.stdenv.mkDerivation {
name = "cuda-env-shell";
nativeBuildInputs = [ fhs ];
shellHook = "exec cuda-env";
}