-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
33 lines (28 loc) · 1.35 KB
/
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
# Helpful when fixing this recipe
#
# https://github.com/cdepillabout/course-v3/blob/6ecf90f640f327dc05b167f45fb7ba88bc265281/default.nix
let
nixpkgs = import ./nix/nixpkgs_version.nix;
in
nixpkgs.stdenv.mkDerivation rec {
name = "fastai-build";
env = nixpkgs.buildEnv { name=name; paths=buildInputs; };
buildInputs = ( import ./nix/build.nix { inherit nixpkgs; });
src = null;
shellHook = ''
SOURCE_DATE_EPOCH=$(date +%s)
export PYTHONUSERBASE=$PWD/.local
export USER_SITE=`python -c "import site; print(site.USER_SITE)"`
export PYTHONPATH=$PYTHONPATH:$USER_SITE
export PATH=$PATH:$PYTHONUSERBASE/bin
jupyter nbextension install --py widgetsnbextension --user > /dev/null 2>&1
jupyter nbextension enable widgetsnbextension --user --py > /dev/null 2>&1
pip install jupyter_contrib_nbextensions --user > /dev/null 2>&1
jupyter contrib nbextension install --user > /dev/null 2>&1
jupyter nbextension enable spellchecker/main > /dev/null 2>&1
export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libcuda.so.418.39 /usr/lib/nvidia-418/libnvidia-fatbinaryloader.so.418.39 /usr/lib/nvidia-418/libnvidia-ptxjitcompiler.so.418.39 /usr/lib/nvidia-418/libnvidia-ml.so.418.39"
export ZONE="us-east1-c"
export INSTANCE_NAME="my-fastai-instance"
export INSTANCE_TYPE="n1-highmem-8"
'';
}