X

The latest cloud infrastructure announcements, technical solutions, and enterprise cloud insights.

GPU-Enabled Remote Workstation for VS Code

Justin Blau
Senior Technical Product Manager

Accessing GPU-enabled workstations can present challenges for data scientists in their day-to-day work. If an organization provides laptops with GPUs, maintenance costs can be higher, and the hardware might be comparatively underpowered for the workloads that need to be run during development. Desktop workstations are another option, but they aren’t as convenient, portable, or available wherever the data scientist needs to work.

To provide data scientists with the power they need for their daily development tasks, an ideal solution includes the ability to run a GPU-enabled environment on-demand in the cloud while still maintaining the Integrated Development Environment (IDE) workflow. We can achieve this solution by combining a GPU-enabled instance deployed in Oracle Cloud Infrastructure with the Visual Studio Code Remote Development extension.

Building Blocks of a Cloud Workstation

Visual Studio Code (VS Code) is growing in popularity because of its extensibility through single-click-downloadable extensions. The Remote Development extension seamlessly integrates a cloud-hosted development environment with the entire feature-set of the IDE. When this extension is combined with the Python extension, data scientists can use a familiar set of tools with a cloud-hosted GPU workstation from any device.

Oracle Cloud Infrastructure was designed to match or improve on the performance that can be achieved with on-premises or private data center solutions, while removing the burden of maintenance and capital expenditure for such hardware. Teams working in data science, artificial intelligence (AI), or other compute-intensive research can use a suite of tools that allow for the design and implementation of a cloud-centralized, end-to-end workflow.

  • Oracle Cloud Infrastructure’s GPU instances are powered by NVIDIA’s Tesla systems with both Pascal (GPU2) and Volta (GPU3) architectures (at time of writing).

  • Performant access to data, which is the basis of most GPU workloads, can be achieved through file systems like BeeGFS, Spectrum Scale, and Lustre, as well as through structured data solutions with Autonomous Database.

  • Instances are equipped with network interface cards that are capable of up to 25 GB/s throughput and connected through highly secure virtual cloud networks (VCNs) that aren’t virtualized and shared with other tenants.

After a team configures an environment, it can be saved as a custom image that’s quickly deployable. Custom images can help save on the costs associated with workstation downtime and speed up the onboarding of new team members.

Implementing cloud workstations enables teams with remote employees or globally dispersed offices access to the same performant infrastructure on demand. The rest of this post describes deploying a remote workstation from an image on the Oracle Cloud Marketplace and connecting to it.

Getting Started

Before you can deploy and connect to the remote workstation, you need to have VS Code and the Remote Development extension installed.

If you haven’t explored the Oracle Cloud and our documentation, follow this set of instructions to familiarize yourself with VCNs and Compute instances.

Deploying the Remote Workstation

Deploy a Compute instance on Oracle Cloud Infrastructure from the Visual Studio Code Remote Workstation image that’s available on the Oracle Cloud Marketplace. Deploy the instance in a subnet with public internet access that allows ingress connections on port 22.

The GPU-enabled VS Code remote workstation image includes all the common packages and drivers required to get started.

After the instance is deployed, copy its public IP address. You will need that to connect to the remote workstation.

Connecting to the Remote Workstation

After the instance is running, open VS Code. If the Remote Development extension is installed correctly, there is a green icon in the bottom-left corner of the window. If you don’t see the green icon, click the link in the “Getting Started” section and install the extension.

  1. Click the green remote connection icon on the bottom-left corner of the window to open the Command Palette.

  2. Select Remote-SSH: Connect to Host and then Add New SSH Host.

  3. In the input box, enter ssh ubuntu@<public-ip-address>, using the public IP address of the instance you created. Be sure to use the correct SSH private key that is paired with the public key provided when creating the instance. Add -i /path/to/key after ssh if the key used differs from the default private key.

    After you are successfully connected, the green remote connection button displays SSH: <public-ip-address>. The VS Code terminal now runs commands on the remote system, and the file browser also operates on the remote system. Extensions from the Marketplace are also installed on the remote system.

  4. Select the Python interpreter: Open the Command Palette by clicking View and then Command Palette. Then, enter Python: Select Interpreter.

  5. The image is set up with a basic installation of Miniconda, so select the environment labeled (‘base’: conda). You can configure more environments by using the terminal.

  6. A sample from PyTorch that runs a convolutional neural network (CNN) against the CIFAR dataset is available in the samples folder in the home directory. Click File and then Open Folder, and select samples (/home/ubuntu/samples/).

  7. Click pytorch-cnn-sample.ipynb, and under the File tab, click the double arrow to run all the cells.

    This is a GPU-enabled workload, which runs through two epochs over the CIFAR dataset.

To get direct access to the instance, click Terminal and then New Terminal, or use another terminal application and connect through SSH.

Exploring the Possibilities

That’s it! You’re ready to begin developing AI workloads on an Oracle Cloud Infrastructure GPU-enabled instance.

From here, you can explore attaching more block volumes for instance-specific storage that can be detached and reattached to instances within an availability domain.

If data centralization and access is a concern, think about transitioning your datasets to Object Storage. Object Storage is a great place for zipped or otherwise nonhierarchical datasets because they are automatically backed up and capable of being moved into an archived state later in your organization’s data lifecycle.

And when you’re ready to build out team access to cloud GPU instances, custom images and parallel file systems can help achieve a truly on-demand workstation solution where datasets and access are standardized across the organization.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.