Skip to content

Commit

Permalink
revise imgs
Browse files Browse the repository at this point in the history
  • Loading branch information
astonzhang committed Jun 18, 2018
1 parent 28471fd commit b5e34f8
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions chapter_appendix/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ EC2提供大量的有着不同配置的实例。这里我们选择了`p2.xlarge`

![](../img/ssh.png)

##安装依赖包
## 安装依赖包

成功登陆后我们先更新并安装编译需要的包。

```{.python .input}
```
sudo apt-get update && sudo apt-get install -y build-essential git libgfortran3
```

Expand All @@ -74,14 +74,14 @@ sudo apt-get update && sudo apt-get install -y build-essential git libgfortran3

然后使用`wget`下载并且安装

```{.python .input}
```
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run
sudo sh cuda_8.0.61_375.26_linux-run
```

这里需要回答几个问题。

```{.python .input}
```
accept/decline/quit: accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
(y)es/(n)o/(q)uit: y
Expand All @@ -101,28 +101,28 @@ Install the CUDA 8.0 Samples?

安装完成后运行

```{.python .input}
```
nvidia-smi
```

就可以看到这个实例的GPU了。最后将CUDA加入到library path方便之后安装的库找到它。

```{.python .input}
```
echo "export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/usr/local/cuda-8.0/lib64" >>.bashrc
```

### 安装MXNet

先安装Miniconda

```{.python .input}
```
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
```

需要回答下面几个问题

```{.python .input}
```
Do you accept the license terms? [yes|no]
[no] >>> yes
Do you wish the installer to prepend the Miniconda3 install location
Expand All @@ -134,7 +134,7 @@ to PATH in your /home/ubuntu/.bashrc ? [yes|no]

下载本教程,安装并激活conda环境

```{.python .input}
```
git clone https://github.com/mli/gluon-tutorials-zh
cd gluon-tutorials-zh
conda env create -f environment.yml
Expand All @@ -143,15 +143,15 @@ source activate gluon

默认环境里安装了只有CPU的版本。现在我们替换成GPU版本。

```{.python .input}
```
pip uninstall -y mxnet
pip install --pre mxnet-cu80
```

同时安装notedown插件来让jupter读写markdown文件。

```{.python .input}
```
pip install https://github.com/mli/notedown/tarball/master
jupyter notebook --generate-config
echo "c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'" >>~/.jupyter/jupyter_notebook_config.py
Expand All @@ -162,7 +162,7 @@ echo "c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'"

并运行Jupyter notebook。

```{.python .input}
```
jupyter notebook
```

Expand All @@ -172,15 +172,15 @@ jupyter notebook

因为我们的实例没有暴露8888端口,所以我们可以在本地启动ssh从实例映射到本地

```{.python .input}
```
ssh -i "XXX.pem" -L8888:locallhost:8888 [email protected]
```

然后把jupyter log里的URL复制到本地浏览器就行了。

【注意】如果本地运行了Jupyter notebook,那么8888端口就可能被占用了。要么关掉本地jupyter,要么把端口映射改成别的。例如,假设aws使用默认8888端口,我们可以在本地启动ssh从实例映射到本地8889端口:

```{.python .input}
```
ssh -i "XXX.pem" -N -f -L localhost:8889:localhost:8888 [email protected]
```

Expand All @@ -196,14 +196,14 @@ ssh -i "XXX.pem" -N -f -L localhost:8889:localhost:8888 [email protected]

每次重新开始后,我们建议升级下教程(记得保存自己的改动)

```{.python .input}
```
cd gluon-tutorials-zh
git pull
```

和MXNet版本

```{.python .input}
```
source activate gluon
pip install -U --pre mxnet-cu80
```
Expand Down
Binary file modified img/ami.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/ec2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/jupyter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/keypair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/launching.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/ssh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b5e34f8

Please sign in to comment.