Tutorial: Setting Up A GPU-Enabled Virtual Machine On Microsoft Azure

John Wu
McGill AI Society Blog
5 min readSep 25, 2018

This weekend (Sept 29–30, 2018), the second iteration of the ImplementAI Hackathon will be taking place at Catallaxy Blockhouse. This annual event is hosted by the McGill AI Society, and will consist of 100 students hacking on innovative projects over a 24-hour period. In addition to Catallaxy, other sponsors attending will include Automat, Wrnch, Playster, Coveo, and Microsoft.

On behalf of Microsoft, I’m happy to announce that all ImplementAI participants will have FREE access to GPUs and other cloud services for the duration of the hackathon. As a result, this tutorial will go over how to set up a GPU-Enabled VM on Microsoft Azure, the service that will be providing the resources.

Login To Microsoft Azure Portal

Begin by going to the Azure portal and logging in with an existing account or creating a new one. If you are a student, you can create an account with the student subscription. This will give you $100 worth of free credits. For those participating in the hackathon, you will be given special access to an ImplementAI subscription that will expense all your usage to a sponsored account.

Setting Up The Virtual Machine

On the left panel of the Azure portal, click on All services. Search for Virtual machines and click on it.

This should lead you to the Virtual machines dashboard. Click the +Add button located on the toolbar at the top of the dashboard.

You should now see a form with options for creating a VM, similar to the screenshot below.

Under Project Details.

  • Select the Subscription you want to use for your VM. The subscription is the account which your usages will be billed to. If you are an ImplementAI participant, select Azure Pass for the subscription.
  • Select the Resource group you want to use for your VM. Resource groups are used in Azure to keep track of permissions and the services that you are using. If you are an ImplementAI participant, select the resource group that was assigned to you at the beginning of the hackathon.

Under Instance Details.

  • For Virtual machine name, define a name for your VM.
  • For Region, select the region you want your VM to be in. If you are an ImplementAI participant, select East US.
  • For Image, choose the base operating system that you want for your VM. For machine learning purposes, Microsoft’s Data Science Virtual Machine (DSVM) is recommended, as it comes packaged with common tools and libraries such as Tensorflow, Pytorch, CUDA, Anaconda, and much more. Click on Browse all images and disks to search for the DSVM.
  • For Size, select the type of VM you want. In Azure, the GPU-enabled VMs fall under the N-Series. For ImplementAI participants, we ask that you stick with NC6 instances which include a NVIDIA Tesla K80 GPU accelerator. To select an NC6 instance, click on Change size. In the popup window, click Clear all filters and then search for NC6. Click the first instance in the results and then click on Select.

Under Administrator Accounts.

  • For Authentication type, select Password and then fill out the three remaining fields with login credentials that you would like to use for your VM.

At this point, your settings should look something like the screenshot below. Settings in other tabs should be fine in their default values for now, but feel free to configure any custom settings you may want.

Click Review + create which will take you directly to the final step tab. Review all your configurations to make sure everything is what you want.

Note: There have been some issues with validation failing for no particular reason. If this happens to you, click back to the Basics tab and repeat the previous step.

Click on Create to start provisioning your VM. This will take about 5 minutes.

Click on the notification icon on the top right to stay updated on the progress. Once it is finished provisioning, a success message will show with a Go to resource button. Click on it to go to the resource that you just created.

This should lead you to the main dashboard of the VM resource that you just created. Click on the Connect button, located on the top toolbar, to open credentials for connecting to your new instance.

A panel should have popped in from the side. Copy the text under Login using VM local account and use any SSH client to connect to the instance.

At this point you should be able to start using your GPU-Enabled VM to process your machine learning workflows!

When you are not using the VM, be sure to shut down the machine by clicking on the Stop button located in the VM resource dashboard. This will deallocate the machine and stop computing charges until you turn it back on again. When you are completely finished with the VM, be sure to click on the Deletebutton to fully dispose of the resource.

For ImplementAI participants, you can also use your credits for other Azure services such as databases, web hosting, cognitive services, and more. A reminder that all resources that you create under the ImplementAI subscription will be deleted immediately after the hackathon, so be sure to save any data or resources that are important for your project in the future.

I hope this tutorial helped and if you have any questions, feel free to reach out to me. Once again, I’d like to thank all our sponsors for their support with ImplementAI and I’m looking forward to seeing what kind of projects will be produced after this weekend!

John Wu
Co-President
McGill AI Society

--

--