Cloud Desktop GPUs

Overview

Cloud desktops with various GPU configurations are available from Paperspace. With Paperspace, you can access a full Linux desktop running Ubuntu 16.04 all from within a web browser. An SSH interface is also available, as is a browser based RStudio Server interface (via SSH tunnel).

Getting Started

To get started, sign up for a Paperspace account here: https://www.paperspace.com/account/signup?linux=true

After you’ve signed up and verified your account email, you will be taken to a Create Machine page. Here you’ll select various options including your compute region and machine template. You should select the Ubuntu 16.04 Machine in a Box template:

After your machine is provisioned (this can take a few minutes) you are ready to access it via a web browser. Hover over the machine in the Paperspace Console and click the “Launch” link:

After the machine is launched you’ll see your Linux desktop within the browser you launched it from. You may need to use the Scaling Settings to adjust the desktop to a comfortable resolution:

You should also change your default password using the passwd utility (your default password should have been sent to you in an email titled “Your new Paperspace Linux machine is ready”):

You now have a Linux desktop equipped with an NVIDIA GPU ready to use with TensorFlow! You’ll still need to install R, RStudio, and the TensorFlow R packages. The Software Installation section below covers how to do this.

After that we’ll describe how to configure your machine to automatically shut down when idle as well as how to use SSH and RStudio Server interfaces to your machine..

Software Installation

First, install some system package that will be needed by subsequent installation steps:

sudo apt-get install gdebi dpkg-sig libssl-dev

Installing R

To install the latest version of R, execute the following commands at a terminal:

$ sudo /bin/bash -c "echo 'deb http://cran.rstudio.com/bin/linux/ubuntu xenial/' >> /etc/apt/sources.list"
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
$ sudo apt-get update
$ sudo apt-get install r-base

Installing RStudio

To install the latest version of RStudio, execute the following commands at a terminal:

$ gpg --keyserver keys.gnupg.net --recv-keys 3F32EE77E331692F
$ wget https://www.rstudio.org/download/latest/stable/desktop/ubuntu16_64/rstudio-xenial-latest-amd64.deb
$ dpkg-sig --verify rstudio-xenial-latest-amd64.deb
Processing rstudio-xenial-latest-amd64.deb...
GOODSIG _gpgbuilder FE8564CFF1AB93F1728645193F32EE77E331692F 1515792437

The GOODSIG on the second line of output from dpkg-sig indicates that the signature has been validated. If you don’t see this output then the package is either unsigned or has the wrong signature, and you should not install it.

Once the signature has been validated, install RStudio with the following command:

$ sudo gdebi rstudio-xenial-latest-amd64.deb

You can run RStudio from a terminal with:

$ rstudio

Installing R Packages

Once you have launched the R shell or RStudio you can install the packages required for working with TensorFlow from R. For example:

> install.packages("keras")
> install.packages("tfestimators")
> install.packages("tensorflow")
> install.packages("tidyverse")

You may not need to install all of the packages above, these are merely examples of things you might choose to install (at a minimum you’ll probably want to install the keras package).

Additional Dependencies

Besides the R interfaces to Keras and TensorFlow, you’ll need to install the core libraries that they interface with. You can do this using the install_keras() function:

> library(keras)
> install_keras(tensorflow = "1.4-gpu")

Note that the version of NVIDIA CUDA pre-installed on the Paperspace Machine Learning in a Box instance is CUDA v8.0. To use this version of CUDA you need to explicitly install TensorFlow v1.4 (as shown above), since later versions of TensorFlow use CUDA v9.0 (which is not pre-installed).

Automatic Shutdown

You can set Paperspace machines to automatically shutdown when they have not been used for a set period of time (this is especially important since machine time is billed by the hour). You can access this setting from the Paperspace console for your machine:

Here the auto-shutdown time is set to 1 day, however you can also choose shorter or longer intervals.

Terminal Access

Web Terminal

You can use the Open Terminal command on the Paperspace console for your machine to open a web based terminal to your machine:

You’ll need to login using either the default password emailed to you when you created the machine or to the new password which you subsequently created.

SSH Login

You can also login to your Paperspace instance using a standard SSH client. This requires that you first Assign a public IP address to your machine (note that public IP addresses cost an additional $3/month).

Once you have your public IP address, you can SSH into your machine as follows:

$ ssh paperspace@<public IP>

You’ll need to login using either the default password emailed to you when you created the machine or to the new password which you subsequently created.

RStudio Server

You may prefer using the RStudio Server browser-based interface to the virtual Linux desktop provided by Paperspace (especially when on slower internet connections). This section describes how to install RStudio Server on your machine and access it using an SSH tunnel.

To start with, follow the instructions for SSH Login immediately above and ensure that you can login to your machine remotely via SSH.

Next, install the latest version of RStudio Server as follows:

$ gpg --keyserver keys.gnupg.net --recv-keys 3F32EE77E331692F
$ sudo apt-get install gdebi dpkg-sig
$ wget https://www.rstudio.org/download/latest/stable/server/ubuntu64/rstudio-server-latest-amd64.deb
$ dpkg-sig --verify rstudio-server-latest-amd64.deb
Processing rstudio-server-latest-amd64.deb...
GOODSIG _gpgbuilder FE8564CFF1AB93F1728645193F32EE77E331692F 1515795137

The GOODSIG on the second line of output from dpkg-sig indicates that the signature has been validated. If you don’t see this output then the package is either unsigned or has the wrong signature, and you should not install it.

Once the signature has been validated, install RStudio Server with the following command:

$ sudo gdebi rstudio-server-latest-amd64.deb

After installation completes, configure RStudio Server to only accept local connections (our SSH tunnel will use a local rather than remote HTTP connection):

$ sudo /bin/bash -c "echo 'www-address=127.0.0.1' >> /etc/rstudio/rserver.conf"
$ sudo rstudio-server restart

Now you should be able to setup an SSH tunnel to RStudio Server as follows:

$ ssh -N -L 8787:127.0.0.1:8787 paperspace@<public-ip>

You can access RStudio Server by navigating to port 8787 on your local machine and logging in using the paperspace account and either the default password emailed to you when you created the machine or to the new password which you subsequently created.

http://localhost:8787