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

相关推荐
资源大全免费分享7 分钟前
MacOS 的 AI Agent 新星,本地沙盒驱动,解锁 macOS 操作新体验!
人工智能·macos·策略模式
李迟23 分钟前
跨系统平台实践:在内网自建kylin服务版系统yum源
linux
跳跳糖炒酸奶24 分钟前
第四章、Isaacsim在GUI中构建机器人(2):组装一个简单的机器人
人工智能·python·算法·ubuntu·机器人
AI.NET 极客圈29 分钟前
AI与.NET技术实操系列(四):使用 Semantic Kernel 和 DeepSeek 构建AI应用
人工智能·.net
Debroon33 分钟前
应华为 AI 医疗军团之战,各方动态和反应
人工智能·华为
俊哥V34 分钟前
阿里通义千问发布全模态开源大模型Qwen2.5-Omni-7B
人工智能·ai
果冻人工智能40 分钟前
每一条广告都只为你而生: 用 人工智能 颠覆广告行业的下一步
人工智能
掘金安东尼43 分钟前
GPT-4.5 被 73% 的人误认为人类,“坏了?!我成替身了!”
人工智能·程序员
odoo-卜永1 小时前
ubuntu22.04连接爱普生打印机型号L385
linux·经验分享·ubuntu
掘金一周1 小时前
金石焕新程 >> 瓜分万元现金大奖征文活动即将回归 | 掘金一周 4.3
前端·人工智能·后端