远程连接GPU服务器上的jupyter notebook?韩国gpu服务器使用教程?
远程连接GPU服务器上的jupyter notebook?
涉及到需要在自己的笔记本上远程连接服务器上的jupyter notebook来使用GPU服务器上的算力。以下分为单用户和多用户的解决方案。
单用户就是1个账号上运行1个jupyter notebook服务,只需要分配一个端口;多用户就是你一个账号要开n个jupyter notebook服务,需要分配多个端口。
单用户连接jupyter notebook解决方案
以下操作均在GPU服务器上进行。
安装jupyter notebook
安装Anaconda3
bash Anaconda3-2019.10-Linux-x86_64.sh(需要去官网下载)
创建虚拟环境
conda create -n xxx python=3.7
激活虚拟环境
conda actiavte xxx
安装jupyter notebook
配置jupyter notebook远程
生成配置文件
jupyter notebook --generate-config(在虚拟环境里运行)
上述代码会在~/.jupyter下生成一个jupyter_notebook_config.py文件。
修改配置文件
vi ~/.jupyter/jupyter_notebook_config.py
修改内容:(记得去掉每行前面的’#’)
c.NotebookApp.ip='*' #表示同一网络的主机都可访问
c.NotebookApp.password = u'sha密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口(这个需要看是不是冲突)
sha密文生成方式。
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]:'sha1:xxxxxxxxx:xxxxxxxxxxxxxxxxxxxxx'
运行jupyter notebook
jupyter notebook(在虚拟环境内输入)
运行效果如下:
可见图中jupyter notebook是GPU服务器IP:8800
在浏览器输入GPU服务器IP:8800
多用户连接jupyter notebook解决方案
问题
多用户是在配置好上述单用户的情况下,比如我们还有另一个虚拟环境xxx2,这个环境我们也需要使用jupyter notebook,而且在很多情况下我们需要同时使用,因为有些代码是需要跑很长时间的。多个jupyter notebook意味着需要多个端口,也同时意味着需要多个配置文件。但是,我们上面只生成了一个配置文件,这该怎么办?
解决方案
复制单用户时的jupyter_notebook_config.py文件,并且命名为jpconfig.py,同时修改端口号,保证不冲突。
cp ~/.jupyter/jupyter_notebook_config.py ~/.jupyter/jpconfig.py
在另一个虚拟环境内启动jupyter notebook时手动指定配置文件,否则会默认使用~/.jupyter/jupyter_notebook_config.py作为配置文件
jupyter notebook --config ~/.jupyter/jpconfig.py
在浏览器同时访问GPU服务器上的多个虚拟环境下的jupyter notebook.
GPU服务器IP:8800
GPU服务器IP:8900
韩国gpu服务器使用教程?
韩国GPU服务器Ⅰ型
CPU E5-2450L*2
内存 32GB
硬盘 250G 固态硬盘
显卡 GT 710 2G显存
IP 独立IP
带宽 10M
机房 韩国机房
韩国GPU服务器Ⅱ型
CPU E5-2630V3*2
内存 32GB
硬盘 250G 固态硬盘
显卡 GT 1030 2G显存
IP 独立IP
带宽 10M
机房 韩国机房
韩国GPU服务器Ⅲ型
CPU E5-2660V3*2
内存 32GB
硬盘 250G 固态硬盘
显卡 GT 1030 2G显存
IP 独立IP
带宽 10M
机房 韩国机房
纵横数据专业提供GPU服务器租用,厦门GPU服务器租用、泉州GPU服务器租用、成都GPU服务器租用、江西GPU服务器租用、香港GPU服务器租用、美国GPU服务器租用、韩国GPU服务器租用、新加坡GPU服务器租用等,有需要的朋友可以咨询我们,官网:https://www.zndata.com/,QQ:3494196421,微信:19906048603。