diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ca0973 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store + diff --git a/Dockerfile b/Dockerfile index e6d48a3..c2fa88a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,46 +1,57 @@ -FROM ghcr.io/ucsd-ets/datascience-notebook:2023.4-stable +#coerce build + +FROM ghcr.io/ucsd-ets/datascience-notebook:2024.4-stable LABEL maintainer="UC San Diego ITS/ETS " # # 2) change to root to install packages USER root +RUN apt-get -q update && \ + apt-get install -qy \ + p7zip-full \ + software-properties-common - -# install cuda toolkit 11-1 +# install cuda 11-1 and toolkit # https://developer.nvidia.com/cuda-11.1.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=2004&target_type=debnetwork -RUN apt-get update && \ - apt-get install -y p7zip-full software-properties-common && \ - wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \ - mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \ - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub && \ - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \ - add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /etc/apt/sources.list.d/cuda.list && \ - rm -rf /etc/apt/sources.list.d/nvidia-ml.list && \ - apt-get update && \ -#apt-get -y install cuda && \ - apt-get install -qqy cuda-11-1 cuda-nvcc-11-1 cuda-toolkit-11-1 && \ - - fix-permissions $CONDA_DIR && \ - fix-permissions /home/$NB_USER +# RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \ +# mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \ +# apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub && \ +# apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \ +# add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" && \ +# rm -rf /var/lib/apt/lists/* && \ +# rm -rf /etc/apt/sources.list.d/cuda.list && \ +# rm -rf /etc/apt/sources.list.d/nvidia-ml.list && \ +# apt-get update && \ +# #apt-get -y install cuda && \ +# apt-get install -qqy cuda-11-1 cuda-nvcc-11-1 cuda-toolkit-11-1 && \ +# wget -nv https://urldefense.com/v3/__https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/libcudnn8_8.0.5.39-1*cuda11.1_amd64.deb__;Kw!!Mih3wA!Gdyp1ukt20BXVegNBzmgDfWhJBT9wJRv0kfA_Go0MCt8kLnGgWIlIwf4enXHKWsp-Mfo5Hrl5w5FGlY-z23hZqFj$ -O /var/tmp/libcudnn8.deb && \ +# wget -nv https://urldefense.com/v3/__https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/libnccl2_2.8.4-1*cuda11.1_amd64.deb__;Kw!!Mih3wA!Gdyp1ukt20BXVegNBzmgDfWhJBT9wJRv0kfA_Go0MCt8kLnGgWIlIwf4enXHKWsp-Mfo5Hrl5w5FGlY-z9s2UILA$ -O /var/tmp/libnccl2.deb && \ +# dpkg -i /var/tmp/libcudnn8.deb /var/tmp/libnccl2.deb + COPY env.yml /tmp/env.yml -RUN conda env create --file /tmp/env.yml && \ +RUN mamba install nb_conda_kernels && \ + fix-permissions $CONDA_DIR && \ + fix-permissions /home/$NB_USER + +RUN mamba env create --file /tmp/env.yml && \ eval "$(conda shell.bash hook)" && \ conda activate ${KERNEL} && \ mkdir -p $CONDA_PREFIX/etc/conda/activate.d && \ -# CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)")) && \ -# echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh && \ - python -m ipykernel install --name=${KERNEL} && \ + # CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)")) && \ + # echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh && \ + python -m ipykernel install --name=${KERNEL} --display-name "Python (${KERNEL})" && \ + + # conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge && \ fix-permissions $CONDA_DIR && \ fix-permissions /home/$NB_USER # 3) install packages using notebook user USER jovyan + # other packages here... # From the "original" 2022 version: diff --git a/env.yml b/env.yml index 22570a5..c202053 100644 --- a/env.yml +++ b/env.yml @@ -1,34 +1,31 @@ name: vis149 channels: -- conda-forge -- pytorch-nightly -- pytorch -- defaults + - conda-forge + - pytorch + - defaults dependencies: -- python=3.7 -#- python=3.9 -#- tensorflow=2.9.1=cuda112* -#- cudatoolkit=11.8.0 -#- cudnn=8.1.0 -- jaxlib=0.1.55 -- tensorboard -- ipykernel -- matplotlib -- pip -- pip: - - gdown - - imageio-ffmpeg==0.4.3 - - jax==0.1.73 - - opencv-contrib-python-headless - - opencv-python - - opensimplex - - pillow - - pyspng==0.1.0 - - networkx - - scipy - - ninja - - torch==1.8.0+cu111 - - torchvision==0.9.0+cu111 - - torchaudio==0.8.0 -# - tensorflow==2.12.* -# - nvidia-cudnn-cu11==8.6.0.163 + - python=3.7 + - cudatoolkit=11.1 + - cudnn=8.1.0 + - jaxlib=0.1.55 + - pip + - pip: + - ipykernel + - matplotlib + - click + - requests + - tqdm + - gdown + - jax==0.1.73 + - imageio-ffmpeg==0.4.3 + - opencv-contrib-python-headless + - opencv-python + - opensimplex + - pillow + - pyspng==0.1.0 + - networkx + - scipy + - ninja + - torch==1.8.0 + - torchvision==0.9.0 + - torchaudio==0.8.0 \ No newline at end of file