Launch Linux( ubuntu14.04) GPU Acc machine in AWS

TL; DR

In order to deploy network to train Deep Learning Network, a GPU Enabled machine is required. Fortunately, AWS provides GPU Accelerated Machine.

https://aws.amazon.com/blogs/aws/new-g2-instance-type-with-4x-more-gpu-power/

Installation scripts:
Install Nvidia Drivers, CUDNn, Python, TensorFlow on Ubuntu 16.04

Provision Machine

  • AMI

    Ubuntu Server 14.04 LTS (HVM), SSD Volume Type

  • Select Instance Type

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html

  • Deploy it

About CUDA Cores (2560)

Nvidia GPU Product Matrix

Install TensorFlow with pip

manual

使用python3

# ubuntu @ dagama in ~ [2:54:27] C:1
$ cd /usr/local/bin
# ubuntu @ dagama in /usr/local/bin [2:54:46]
$ ls -l|grep pip
-rwxr-xr-x 1 root root 204 Nov  7 11:08 pip
-rwxr-xr-x 1 root root 204 Nov  7 11:08 pip2
-rwxr-xr-x 1 root root 204 Nov  7 11:08 pip2.7
$ sudo mv pip2 ~/bakup1
$ sudo mv pip2.7 ~/bakup1
# ubuntu @ dagama in /usr/local/bin [2:57:46]
$ ls -l|grep pip
-rwxr-xr-x 1 root root 204 Nov  7 11:08 pip
###尝试用pip安装模块,以查看pip是否安装成功###
$ pip install wheel
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip import main
ImportError: No module named 'pip
###应该是安装python3的pip? 并更新pip###
$ sudo apt-get install python3-pip
$sudo pip install --upgrade pip
$ pip --version
pip 9.0.1 from /usr/local/lib/python3.4/dist-packages (python 3.4)

Install required packages

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
# 直接利用"pip install -U scikit-learn "安装scikit-learn,会提示"UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 52: ordinal not in range(128)"的错误,可以先升级一下setuptools,如下
sudo pip install --upgrade setuptools
sudo pip install -U scikit-learn  # 安装成功

Install tensorflow0.9.0(python3.4)

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl
# Python3
$ sudo pip3 install --upgrade $TF_BINARY_UR

But there is no 'configure'script at the root of the tree (in the tensorflow), so I clone the tensorflow repository, as follows:

Clone the TensorFlow repository
$ git clone https://github.com/tensorflow/tensorflow

Install Drivers

https://aws.amazon.com/blogs/aws/new-g2-instance-type-with-4x-more-gpu-power/

Install utilities

 sudo apt-get install wget zsh git curl ack-grep -yy

Installing NVIDIA Driver

manual

CUDA Driver

manual

sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

Setup CUDA_HOME in PATH

edit /etc/profile

export CUDA_HOME=/usr/local/cuda
export PATH=$PATH:$CUDA_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64

CUDNN

Install cuDNN v5.

Uncompress and copy the cuDNN files into the toolkit directory. Assuming the toolkit is installed in /usr/local/cuda, run the following commands (edited to reflect the cuDNN version you downloaded):

tar xvzf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
cd /usr/local/cuda/lib64/
sudo rm -rf libcudnn.so libcudnn.so.5
sudo ln -s libcudnn.so.5.0.5 libcudnn.so.5
sudo ln -s libcudnn.so.5 libcudnn.so

Install bazel

manual

For Ubuntu Trusty (14.04 LTS) users, since OpenJDK 8 is not available on Trusty, please install Oracle JDK 8:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Note: You might need to sudo apt-get install software-properties-common if you don't have the add-apt-repository command. See here.

$ sudo apt-get update && sudo apt-get install bazel
#Once installed, you can upgrade to newer version of Bazel with:
$ sudo apt-get upgrade bazel

Launch tensorflow

相关推荐
cooldream20095 分钟前
Microsoft Azure Cosmos DB:全球分布式、多模型数据库服务
数据库·人工智能·microsoft·知识图谱·azure
mgwzz6 分钟前
nfs开机自动挂载
linux·服务器·网络
CSJK-9 分钟前
模式识别与机器学习 | 第九章 降维
人工智能·机器学习·pca
神经美学_茂森11 分钟前
【通俗理解】AI的两次寒冬:从感知机困局到深度学习前夜
人工智能·深度学习
勤劳的进取家11 分钟前
支持向量机(SVM)算法
人工智能·机器学习·支持向量机
Chatopera 研发团队12 分钟前
Deep learning for NLP around 2017
人工智能·深度学习·自然语言处理
studying_mmr17 分钟前
Estimator (Statistic for Machine Learning)
人工智能·机器学习·big data·data·統計學
green5+117 分钟前
机器学习期末复习知识点
人工智能·机器学习
Schwertlilien18 分钟前
模式识别-Ch3-极大似然估计
人工智能·机器学习·概率论
一只小爪子43 分钟前
通过 ulimit 和 sysctl 调整Linux系统性能
linux·运维·前端