---
title: AI Runtime Notebook quickstart
description: "Run your first workload on AI Runtime serverless GPU compute in minutes: attach a notebook to a GPU and run a short PyTorch training step."
canonical_url: https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/notebooks
---

# AI Runtime Notebook quickstart

Use AI Runtime to go from an empty notebook to PyTorch on a GPU in a few clicks. Attach a notebook to **Serverless GPU** with no cluster to set up, and get GPU monitoring, a terminal on the GPU node, and Genie Code built in.

To scale the same notebook across multiple GPUs, see [Distributed training in notebooks](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/distributed-training.md).

![An AI Runtime notebook attached to Serverless GPU, with callouts for selecting the GPU type, configuring the environment, monitoring utilization, using the agent to code, and opening a terminal.](https://docs.databricks.com/aws/en/images/machine-learning/ai-runtime/air-notebook-overview.png)

## Requirements

Your workspace must have AI Runtime enabled and be in a supported region. See [ Requirements](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/overview.md#requirements).

## <a id="gpu-compute" /> Step 1: Attach a notebook to a GPU

1. Create or open a notebook.
2. From the compute drop-down at the top of the notebook, hover **Serverless GPU** and select **1xA10**.

The notebook attaches to the GPU. If no base environment is selected, the notebook also switches to the [Databricks AI environment](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/develop-workloads/environment.md#ai-env), which includes PyTorch.

To change the accelerator or the base environment later, open the **Environment** panel, make the change, and click **Apply** and then **Confirm**, which restarts the Python process and clears variables.

> [!TIP]
>
> Start with **1xA10** for development and small workloads. Move to **1xH100**, **8xH100**, or **8xB300** when you need more GPU memory or multi-GPU distributed training. See [ Hardware](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/overview.md#hardware-options).

## Step 2: Run your first GPU code

The default **Databricks AI environment** comes with PyTorch, Transformers, vLLM, pandas, and many more packages preinstalled. For the full list, see the [Databricks AI environment](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/develop-workloads/environment.md#ai-env).

Run the following notebook to confirm the GPU is attached and run one training step:

#### AI Runtime quickstart notebook

[Get notebook](https://docs.databricks.com/notebooks/source/getting-started/ai-runtime-quickstart.html)

You are now training on AI Runtime.

## Explore the GPU notebook

The notebook comes with tooling to help you work on the GPU. You can switch base environments, monitor GPU utilization, open a terminal on the GPU node, and use Genie Code to write and debug your code.

### Switch environments

Click **Environment** in the right panel to pick a different base environment or accelerator. See [Set up your AI Runtime environment](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/develop-workloads/environment.md).

![The Environment side panel with the Base environment drop-down open, showing Standard and AI environment versions.](https://docs.databricks.com/aws/en/images/machine-learning/ai-runtime/air-notebook-env.png)

### Watch GPU utilization

Click **GPU resources** in the right panel to see live GPU utilization and memory while your code runs. See [Monitor live GPU resources](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/monitor-deploy/tracking-observability.md#monitor-gpu-resources).

![The GPU resources pane showing GPU utilization and memory usage charts over time.](https://docs.databricks.com/aws/en/images/machine-learning/ai-runtime/air-notebook-resource.png)

### Open a terminal on the GPU node

Click **Terminal** at the bottom right to get a shell on the GPU node. Run `nvidia-smi`, inspect files, or debug processes directly. See [Run shell commands in Databricks web terminal](https://docs.databricks.com/aws/en/compute/web-terminal.md).

![A web terminal running nvidia-smi on an H100 GPU node.](https://docs.databricks.com/aws/en/images/machine-learning/ai-runtime/air-notebook-terminal.png)

### Let Genie Code write and debug for you

Click **Genie Code** in the right panel and describe what you want. The agent can write training code, fix dependency conflicts, and debug GPU failures. See [Use Genie Code with AI Runtime](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/develop-workloads/coding-agents/genie-code.md).

![The Genie Code pane with a prompt asking the agent to fix a torchao library conflict.](https://docs.databricks.com/aws/en/images/machine-learning/ai-runtime/air-notebook-genie.png)

## Next steps

* Scale across multiple GPUs with [Distributed training in notebooks](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/distributed-training.md).
* Run the notebook on a schedule with [Schedule notebook jobs on AI Runtime](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/notebook-jobs.md).
* Clone an end-to-end notebook from [AI Runtime examples](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/examples/index.md).
