Singularity配置Pytorch0.4.1 + Anaconda3(Python3.5) + CUDA9.0 + CUDNN7.0

Singularity Recipe

Bootstrap: docker
From:nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
   
%post
# recipe
	echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
    apt-get update
    apt-get install -y wget vim git cmake unzip unar libsm6 libxext6 libxrender-dev

	# anaconda3
	wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.2.0-Linux-x86_64.sh -O /opt/anaconda3.sh
	bash /opt/anaconda3.sh -b -p /opt/anaconda3
	rm /opt/anaconda3.sh
	/opt/anaconda3/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple msgpack argparse
	/opt/anaconda3/bin/pip install --upgrade pip
	/opt/anaconda3/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple protobuf future tqdm sklearn pillow xmltodict dicttoxml

	/opt/anaconda3/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch torchvision
	/opt/anaconda3/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python albumentations gluoncv-torch pretrainedmodels
 
%environment
	export PATH=/opt/anaconda3/bin:$PATH
	export LC_ALL=C.UTF-8

  # 制作成只读压缩格式squashfs的容器供服务器用
  singularity build pytorchv1.simg recipe.def
  # ll -h pytorchv1.simg -> 3.0Gb
  • 使用root账户制作。

你可能感兴趣的:(Linux,pytorch,caffe)