AWS provides us with approachable GPU based cloud computing capability with minimal cost.
We will talk about the steps to take advantage of AWS EC2 to build GPU computing for our model training in R.
1. Register AWS account…
2. Find EC2 service
3. Click “launch instance” and go for this one labeled Free tier eligible and HVM:
4. check the default option and go for “Configure Instance Details”
5. Next page, in advanced details, input the following text:
#!/bin/bash #install R yum install -y R #install RStudio-Server wget https://download2.rstudio.org/rstudio-server-rhel-0.99.465-x86_64.rpm yum install -y --nogpgcheck rstudio-server-rhel-0.99.465-x86_64.rpm #install shiny and shiny-server R -e "install.packages('shiny', repos='http://cran.rstudio.com/')" wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-184.108.40.2068-rh5-x86_64.rpm yum install -y --nogpgcheck shiny-server-220.127.116.118-rh5-x86_64.rpm #add user(s) useradd username echo username:password | chpasswd
0.99.465 is the version of R studio, pls find the latest one to replace it.
change the username and password to your desired name and pw.
6. click “review and launch”, go to “Security Groups”. Add Rule and edit as following:
7. Review and Launch and click “launch”, and on the popped up window select create a new key pair. Name the pair and download it and save it.
7. Click” launch instances” and go to instance view page.
8. When all the lights are green as shown above, select your instance and click “Connect” above. You can see another window here.
Copy the DNS of NO.4 of “To access your instance” and paste into your browser, add “:8787” at the end of the DNS address.
9. You will see the log in page of R server. Use the user name and password set already to log in and you can see the familiar r studio.
10. install h2o package and we can train our deep learning model.
11. About the data to load.
There are two ways to load data for R studio running in instance of AWS EC2.
We can upload the data through the window at the right bottom in .zip(recommended).
Or we can use S3 service or AWS can store the data online and use the data with RCurl package with url.