搭建基于CUDA 10 + RTX 2070 + Ubuntu18.04 的深度学习服务器并配置Jupyter Notebook外网访问

搭建基于CUDA 10 + RTX 2070的深度学习服务器

配置:

  1. CPU:Intel i5-8500
  2. GPU:Nvidia RTX 2070
  3. MEM:8G x 2
  4. SSD: Intel 760p 256G

步骤:

  1. 安装Ubuntu 18.04
  2. 配置Ubuntu
  3. 配置CUDA 10,pytorch
  4. 配置网络映射
  5. 配置jupyter notebook远程访问

配置国内源

  1. sudo gedit /etc/apt/sources.list
  2. 开头加入
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

3.完成

 sudo apt update
 sudo apt upgrade

安装显卡驱动

这里选择直接安装CUDA 10,会自带显卡驱动

  1. 下载CUDA 10
  2. 禁用自带的 nouveau nvidia驱动
创建一个文件通过命令 sudo vim /etc/modprobe.d/blacklist-nouveau.conf
并添加如下内容:
blacklist nouveau
options nouveau modeset=0
再更新一下
sudo update-initramfs -u
修改后需要重启系统
sudo reboot

3.开机别登录,进入命令行模式,CTRL + ALT + F2,安装即可

安装pytorch

安装 git

sudo apt install git

加速 git clone 过程

  • 改DNS
vim /etc/hosts

使用[站长工具DNS查询][1]查看这两个地址的最快的dns,并修改

52.74.223.119 github.com
151.101.109.194 github.global.ssl.fastly.net
  • 使用socks5加速
sudo apt install shadowsocks
#配置文件ss.json
sudo sslocal -c ss.json -d start
  • 配置git代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
# 查看当前代理设置
# git config --global http.proxy
# 删除
# git config --global --unset http.proxy
# git config --global --unset https.proxy

安装miniconda并配置代理

$ vim ~/.condarc

加入

proxy_servers:
    http: http://localhost:8080
    https: http://localhost:8080

从source安装

#配置远程访问

jupyter notebook

pip install jupyter
python
>>> from notebook.auth import passwd
>>> passwd()
#复制密码
jupyter notebook --generate-config

#加入
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha1:121321313'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.allow_remote_access = True

路由器内网映射

DMZ或者端口转发均可

安装ssh SERVER

sudo apt install ssh

外网愉快访问

$ ssh xxx.xxx.xx.xxx
$ python -m notebook

在自己的浏览器中打开 ip:8888 即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值