Categories: BlogCanonicalUbuntu

How to launch a Deep Learning VM on Google Cloud

Setting up a local Deep Learning environment can be a headache. Between managing CUDA drivers, resolving Python library conflicts, and ensuring you have enough GPU power, you often spend more time configuring than coding.

Google Cloud and Canonical work together to solve this with Deep Learning VM Images, which use Ubuntu Accelerator Optimized OS as the base OS. These are pre-configured virtual machines optimized for data science and machine learning tasks. They come pre-installed with popular frameworks, such as PyTorch, and the necessary NVIDIA drivers.

In this guide, I’ll walk you through how to launch a Deep Learning VM on GCP using the Console, and how to verify your software stack so you can start training immediately.

Why use a Deep Learning VM?

  • Pre-installed frameworks: No need to pip install generic libraries manually.
  • GPU-ready: NVIDIA drivers are pre-installed and verified.
  • Jupyter integration: Seamless access to JupyterLab right out of the box.

How to make a Deep Learning VM in GCP

Step 1: Navigate to the GCP Marketplace

First, log in to your Google Cloud Console. Instead of creating a generic Compute Engine instance, we want to use a specialized image from the Marketplace.

  1. Open the Google Cloud Console.
  2. In the search bar at the top, type “Deep Learning VM”.
  3. Select the product named Deep Learning VM published by Google.
How to launch a deep learning vm on google cloud 6

Step 2: Configure your instance

Once you are on the Marketplace Deep Learning VM listing page, click Launch. This will take you to the deployment configuration screen. This is where you define the power behind your model.

Here are the key settings you need to pay attention to:

  • Zone: Make sure to select a zone that supports the specific GPU you want to use (in my case, I selected the us-central1-f zone).
  • Machine Type: Choose a CPU/RAM combination that meets your requirements if you don’t need a GPU.
  • GPU Type: You can add your GPU type, such as the NVIDIA T4, A100, or H100.
How to launch a deep learning vm on google cloud 7

Configuring the VM instance in the Google Cloud Console.

Once you have made your selections, click Deploy.

Step 3: Connect and verify

After a minute or two, your VM will be deployed. You can find it listed in your Compute Engine > VM Instances page.

To access the machine, click the SSH button next to your new instance. This opens a terminal window directly in your browser.

How to launch a deep learning vm on google cloud 8

Step 4: Check the software stack & drivers

Now, let’s make sure everything is working under the hood.

1. Verify NVIDIA drivers

If you have attached a GPU, the most important check is to ensure the drivers have loaded correctly. Run the following command in your SSH terminal:

nvidia-smi

You should see a table listing your GPU (e.g., A100) and the CUDA version.

How to launch a deep learning vm on google cloud 9

2. Check pre-installed software

Google’s Deep Learning VMs usually come with PyTorch pre-configured. You can check the installed packages to ensure your favorite libraries are there:

pip show torch

How to launch a deep learning vm on google cloud 10

Conclusion

And that’s it! In just a few minutes, you have built a fully configured Deep Learning environment. You can now start running training scripts directly from the terminal.

Don’t forget: Deep Learning VMs with GPUs can be expensive. Remember to stop your instance when you aren’t using it to avoid unexpected charges!

Learn  more about Canonical’s offerings on GCP

Read more

Ubuntu Server Admin

Recent Posts

Advantech AOM-2721 is now Ubuntu Certified

Canonical announces that the Advantech AOM-2721 is officially joining the list of Ubuntu Certified Hardware.…

8 hours ago

Ruby and Rails Performance Roundup: The Backlog Edition

Yet again instead of tweets, a blog post. The backlog got out of hand -…

8 hours ago

How to Deploy OpenProject on Ubuntu VPS

This article provides a guide demonstrating how to deploy OpenProject on Ubuntu VPS. What is…

8 hours ago

Canonical integrates NVIDIA Nemotron 3.5 Lightning with Ubuntu for always-on AI agents

Canonical is pleased to announce that  NVIDIA’s newly introduced NVIDIA Nemotron 3.5 Lightning, an open,…

2 days ago

Xfwl4’s Second Preview Release

I’m pleased to announce the second preview release of xfwl4, Xfce’s Wayland compositor, version 4.21.1.…

2 days ago

How to Install, Secure, and Set Up MySQL on Ubuntu 26.04 LTS

If you have been using an ecommerce store to place online orders or have been…

3 days ago