Skip to content

Instantly share code, notes, and snippets.

@Zhen-hao
Created August 30, 2019 07:18
Show Gist options
  • Save Zhen-hao/af5c120aa5b8fe7da81cbb54a244f78b to your computer and use it in GitHub Desktop.
Save Zhen-hao/af5c120aa5b8fe7da81cbb54a244f78b to your computer and use it in GitHub Desktop.
an example of reproducible data science environment
{ pkgs ? import <nixpkgs> {config = { allowUnfree = true; }; } }:
pkgs.stdenv.mkDerivation {
name = "cuda-env-shell";
buildInputs = with pkgs;
[ git gitRepo gnupg autoconf curl
procps gnumake utillinux m4 gperf unzip
cudatoolkit linuxPackages.nvidia_x11
libGLU_combined
xorg.libXi xorg.libXmu freeglut
xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib
ncurses5 stdenv.cc binutils
python37Packages.jupyterlab_server
python37Packages.jupyterlab_launcher
python37Packages.jupyterlab
];
shellHook = ''
export CUDA_PATH=${pkgs.cudatoolkit}
# export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib:${pkgs.ncurses5}/lib
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
export EXTRA_CCFLAGS="-I/usr/include"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment