VMware虚拟机
参考:
https://blog.csdn.net/weixin_43314579/article/details/88368245
遇到的问题:此主机支持Intel VT-x,但Intel VT-x处于禁用状态
解决:
https://www.cnblogs.com/st666/p/11642033.html
进入BIOS方法:
http://www.xitongcheng.com/jiaocheng/xtazjc_article_52400.html
singularity
参考:
https://blog.csdn.net/u014687517/article/details/91411837
git clone https://github.com/sylabs/singularity.git
sudo apt-get update && sudo apt-get install python dh-autoreconf build-essential
sudo apt-get install libarchive-dev
cd singularity
git fetch --all
git checkout 2.5.0
./autogen.sh
./configure --prefix=/usr/local --sysconfdir=/etc
make
sudo make install
遇到的问题1:
./autogen.sh之后报错
解决办法:
cd ..
sudo apt-get update && sudo apt-get install python dh-autoreconf build-essential
遇到的问题2:
./configure --prefix=/usr/local之后显示need package libarchive-devel
解决办法:
cd ..
sudo apt-get install libarchive-dev
注意:使用
./configure --prefix=/usr/local --sysconfdir=/etc**
切换到超级用户命令
sudo su
anaconda+pytorch 镜像制作
参考:https://blog.csdn.net/weixin_41270857/article/details/83478301?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase
1.写清单
首先写一个Singularity清单文件
mkdir test
cd test
vim dl.def
dl.def内容
原博内容通常会由于pip和torch下载时间过长导致失败,所以加入镜像源及增加超时时限,具体修改之后如下:
Bootstrap: docker
From:nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
%post
apt-get update
apt-get install -y wget \
vim
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh -O /home/anaconda3.sh
bash /home/anaconda3.sh -b -p /home/anaconda3
rm /home/anaconda3.sh
/home/anaconda3/bin/pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple/ pip
/home/anaconda3/bin/pip install --default-timeout=1000 -i https://pypi.tuna.tsinghua.edu.cn/simple/ torch torchvision
%environment
export PATH=/home/anaconda3/bin:$PATH
国内镜像源参考:
https://blog.csdn.net/king_super123/article/details/104722533
其中,使用阿里云链接会出现找不到合适的torch版本导致出错。
2.建立镜像
sudo singularity build dl.simg dl.def
3.执行
执行时,由于是gpu环境,需要加上命令–nv,例如:
singularity shell --nv dl.simg
其他问题
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE
解决办法:
pip install --upgrade --default-timeout=1000 torch
distributed 1.21.8 requires msgpack, which is not installed.
解决办法:
pip install msgpack-python
pip install msgpack
3.memory error
解决办法:
1.扩展虚拟机内存
2.
sudo singularity build centos.simg dl.def
之前先
singularity create --size 10240 centos.img
更新(指定pytorch版本)
将dl文件修改如下:
Bootstrap: docker
From:nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
%post
apt-get update
apt-get install -y wget \
vim
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh -O /home/anaconda3.sh
bash /home/anaconda3.sh -b -p /home/anaconda3
rm /home/anaconda3.sh
/home/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
/home/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
/home/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
/home/anaconda3/bin/conda config --set remote_read_timeout_secs 1000.0
/home/anaconda3/bin/conda config --set show_channel_urls yes
/home/anaconda3/bin/pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple/ pip
/home/anaconda3/bin/pip install --default-timeout=1000 -i https://pypi.tuna.tsinghua.edu.cn/simple/ msgpack-python
/home/anaconda3/bin/pip install --default-timeout=1000 -i https://pypi.tuna.tsinghua.edu.cn/simple/ msgpack
/home/anaconda3/bin/pip install --default-timeout=1000 -i https://pypi.tuna.tsinghua.edu.cn/simple/ scipy
/home/anaconda3/bin/conda install pytorch==1.2.0 torchvision==0.4.0
%environment
export PATH=/home/anaconda3/bin:$PATH
参考:
[1]https://blog.csdn.net/weixin_34110749/article/details/92694799
[2]https://blog.csdn.net/weixin_39513374/article/details/81051466