Giter Site home page Giter Site logo

vagrant-aws-gpu-tensorflow's Introduction

vagrant-aws-gpu-tensorflow

A Vagrantfile to provision a gpu instance installed tensorflow-gpu on EC2

Description

This Vagrantfile gives you an easy way to launch a gpu instance installed tensorflow-gpu. Information for the instance which will be launched is blow.

  • CUDA: v8.0
  • cuDNN: v5.1
  • Python: 3.4
  • Tensorflow(GPU): v12.1
  • OS: Ubuntu 14.04
  • instance_type: g2.2xlarge
  • region: np-northeast-1
  • ami: ami-3995e55e

If you want to change the region, please find an appropriate ami for your region and instance_type from here. If you want to change the version of python, CUDA or cuDNN, please find an appropriate tensorflow-gpu from here.

Requirement

Vagrant and a few configurations of AWS are required.

Vagrant

Vagrant is a command line utility to manage virtual machines. You can download an appropriate installer for your platform from here.

vagrant-aws is a vagrant plugin to allow Vagrant to control and provision machines in EC2 and VPC. When Vagrant is already installed, you can install it like blow.

$ vagrant plugin install vagrant-aws

AWS Configuration

Amazon EC2 is a VPS service. This Vagrantfile needs network and security configurations, which are Amazon EC2 Key Pairs and Amazon EC2 Security Groups.

You can create a key pairs accoding to this link. You can also create a security group according to this link.

After creating them, please set them to aws.keypair_name, aes.security_groups and ssh.private_key_path in the Vagrantfile, whose roles are explained at vagrant-aws's README. Please use a security group to allow SSH access. If you want to use jupyter notebook and tensorboard, I recommend you to allow TCP 8888 and TCP 6006 ports.

Usage

$ git clone https://github.com/shotarok/vagrant-aws-gpu-tensorflow.git
$ cd vagrant-aws-gpu-tensorflow

# Configure aws environment variables
$ export AWS_ACCESS_KEY_ID=...
$ export AWS_SECRET_ACCESS_KEY=...

# Set your own aws.keypair_name, aws.security_groups and
# ssh.private_key_path by your favorite editor
$ vi Vagrantfile

# Launch and provision an gpu instance
# (it will take some time)
$ VAGRANT_LOG=info vagrant up --provider=aws

# Connect to the instance
$ vagrant ssh

# Check tensorflow-gpu on the gpu instance
(guest)$ python3 -c "import tensorflow"
> I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
> I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
> I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
> I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
> I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
> ...

# Terminate the instance
$ vagrant destroy

Contribution

  1. Fork
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Create new Pull Request

Licence

MIT

Author

Shotaro Kohama

vagrant-aws-gpu-tensorflow's People

Contributors

shotarok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.