通信云平台环境搭建

apt-get update 失败?

root@c-z2twl:~# apt-get update 
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease                                          
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease                                
  Temporary failure resolving 'ppa.launchpad.net'
Err:3 http://archive.ubuntu.com/ubuntu xenial InRelease                
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done        
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

vim  /etc/resolv.conf

修改为

nameserver 172.1.0.200
search 10011016-name.svc.cluster.local. svc.cluster.local. cluster.local.
options ndots:5
nameserver 8.8.8.8
nameserver 223.5.5.5
nameserver 223.6.6.6                        

之后 apt-get update成功

升级pytorch

下载anaconda

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.02-Linux-x86_64.sh

开始安装

bash Anaconda3-2020.02-Linux-x86_64.sh

安装完成后,加入环境变量

export PATH=$PATH:/root/anaconda3/bin
source ~/.bashrc

之后安装pytorch

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
(base) root@c-z2twl:~# python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.4.0'
>>> 

撒花✿✿ヽ(°▽°)ノ✿

复制文件到指定端口

(base) root@c-b7fg2:~# scp -P 31176 /data/software/cuda_10.0.130_410.48_linux.run root@10.0.3.41:/data/environment/

=2021/1/8 更新离线版升级pytorch===

离线升级pytorch

网上下载离线包,目前已经下载到

/data/environment
在这里插入图片描述

cd到/data/environment

安装anaconda

sh Anaconda3-2020.02-Linux-x86_64.sh
  • 安装完成后,加入环境变量
export PATH=$PATH:/root/anaconda3/bin
source ~/.bashrc

运行cuda文件

  • 首先给cuda可执行权限
  • 然后运行cuda文件
chmod a+x cuda_10.0.130_410.48_linux.run
./cuda_10.0.130_410.48_linux.run 

将cuda的bin文件和lib导出到系统环境中。
如果安装的版本不是一样的,更换路径中的cuda-10.0

 export PATH="/usr/local/cuda-10.0/bin:$PATH" 
 export LD_LIBRARY_PATH="/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH"

输入

 nvcc -V 

如果有CUDA的版本信息代表正常。

安装cuDNN

  • 驱动、CUDA已经装好
  • 下载(注意与CUDA配套)
  • 解压
tar xvf cudnn-10.0-linux-x64-v7.6.1.34.tgz
  • 复制到cuda目录
cp cuda/include/* /usr/local/cuda/include
cp cuda/lib64/*   /usr/local/cuda/lib64

离线安装pytorch

conda install pytorch-1.4.0-py3.7_cuda10.0.130_cudnn7.6.3_0.tar.bz2 

test

(base) root@tl-bd4bp:/data/environment# python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.4.0'
>>> 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值