1安装ubuntu
2安装NVIDIA Driver
参照https://zhuanlan.zhihu.com/p/36502449
https://blog.csdn.net/hhhuua/article/details/80734092
测试nvidia-smi
3安装ubuntu(因为装390版本,无法安装cuda9.2)
降低gcc版本https://blossomnoodles.github.io/cnBlogs/2018/04/30/Ubuntu18.04-Tensorlow-install.html
gcc --version # check ubuntu 18.04 gcc version, you will find it's 7.3.0
sudo apt install gcc-5 g -5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 # you will find that message that tells you the gcc-5 is set to be automatic.
sudo update-alternatives --install /usr/bin/g g /usr/bin/g -5 50 # similiar message as gcc
下载cuda 9.1的四个文件,并执行
https://blog.csdn.net/u010801439/article/details/80483036【sudo vim ~/.barshrc实际上是sudo vim ~/.bashrc】
参考下文进行测试
https://blog.csdn.net/fei_6/article/details/75305692
再次测试
nvcc -V
4cudnn7.0.5
https://blog.csdn.net/aiolia86/article/details/80342240
5Anaconda pytorch
https://blog.csdn.net/Sebastien23/article/details/80554837
创建自己的pytho2.7 pytorch环境:
https://www.jianshu.com/p/035b891b52e4
https://blog.csdn.net/acbattle/article/details/80894979
使用docker安装torch【因为18.04装不了tprch的一个安装包,所以使用docker】
deepo项目:https://blog.csdn.net/FYZ530357172/article/details/79217460
https://blog.csdn.net/qiansg123/article/details/78559085
https://www.cnblogs.com/bingmang/p/9813686.html
https://blog.csdn.net/u013066730/article/details/51526068
https://blog.csdn.net/qq_36142114/article/details/81605372
https://blog.csdn.net/zw__chen/article/details/82218774#1-下载镜像文件
https://www.jianshu.com/p/eb363da420bd
其中,安装docker请参照https://yeasy.gitbooks.io/docker_practice/install/ubuntu.html(使用了中科大的链接)
nvidia部分则参考官网可以顺利安装。
nvidia-docker run -it -v /host/data:/data -v /host/config:/config ufoym/deepo bash
nvidia-docker run -it -v /host/data:/data -v /host/config:/config ufoym/deepo:py27 bash
最新版【使用jupyter notebook】:
docker pull ufoym/deepo:all-py27-jupyter
nvidia-docker run --rm ufoym/deepo:all-py27 nvidia-smi
nvidia-docker run -it -p 8888:8888 --ipc=host -v /home/..../joy/data:/data ufoym/deepo:all-py27-jupyter jupyter notebook --no-browser --ip=0.0.0.0 --allow-root --notebook-dir='/data'(不设置密码,直接使用系统自己生成的)
运行如下图
右击打开连接即可
6pycharm
目标:使用笔记本的windows系统的pycharm,远程连接ubuntu系统(GPU),ubuntu使用步骤5docker连接学习环境
原本的
nvidia-docker run -it -v /host/data:/data -v /host/config:/config ufoym/deepo:py27 bash
改为
sudo nvidia-docker run -it -p 8022:22 -v /host/data:/data -v /host/config:/config ufoym/deepo:py27 bash
需要配置远程的电脑的sshhttps://www.jianshu.com/p/5cd9ab4aa5f5(port改为8022)
ifconfig -a(查找地址https://blog.csdn.net/u012269267/article/details/52260757)
ssh root@<你服务器的ip地址> -p 8022
配置参考
sudo docker container ls -l(查看镜像的名字,最后一列names)
关闭防火墙 ufw disable
https://my.oschina.net/u/146514/blog/512025
https://blog.csdn.net/github_33934628/article/details/80919646#commentBox