-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-shell.nix
40 lines (31 loc) · 1.14 KB
/
python-shell.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
with import <nixpkgs> { };
let
# unstablePkgs = import <unstable> {};
# Import the unstable channel with allowUnfree configuration
unstable = import (builtins.fetchTarball "https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz") {
config = {
allowUnfree = true;
};
};
in
mkShell {
buildInputs = [
# cuda # this is unstable.cudatoolkit
# cudaPackages.cudatoolkit # using stable instead so we can use same versio of libcuda from nvidia drivers
# nodejs_22
gcc-unwrapped
python311Packages.python
python311Packages.pip
cudaPackages.cudatoolkit
];
shellHook = ''
export CUDA_ROOT="${cudaPackages.cudatoolkit}";
export CUDA_LIB_DIR="${cudaPackages.cudatoolkit}/lib"; # Updated path
export PATH="$CUDA_ROOT/bin:$PATH"; # this seems to be done automatically when installing the cudatoolkit
export LD_LIBRARY_PATH="$CUDA_LIB_DIR:$LD_LIBRARY_PATH";
export LD_LIBRARY_PATH="/run/opengl-driver/lib:$LD_LIBRARY_PATH";
export LD_LIBRARY_PATH=${gcc-unwrapped.lib}/lib:$LD_LIBRARY_PATH
source ./venv/bin/activate;
export HF_HOME="/home/dev/Sd/HuggingFace/cache"
'';
}