# How to Create DigitalOcean Gradient™ AI GPU Droplets DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure. GPU Droplets have GPUs in a single or 8 GPU configuration. They also come with two different kinds of storage: a boot disk for persistent data and a scratch disk for non-persistent data. [Learn more about GPU Droplet plans and features](https://docs.digitalocean.com/products/droplets/details/features/index.html.md#gpu-droplets). We provide AI/ML-ready images for GPU Droplets that have drivers and software from AMD and NVIDIA preinstalled, as well as preconfigured [1-Click Models powered by Hugging Face](https://docs.digitalocean.com/products/marketplace/1-click-models/index.html.md). You can also create GPU Droplets with existing Droplet images, but you need to manually install drivers and other software to use the GPUs. **Note**: If you are a newer DigitalOcean customer, we may charge your team’s primary payment method partway through the monthly billing cycle when you create GPU Droplets, but your total cost is not increased. This is a precautionary measure to prevent abuse of our platform. ## Create a GPU Droplet in the Control Panel After you [log in to the control panel](https://cloud.digitalocean.com/login), click the green **Create** button in the top right to open the **Create** menu, then click **GPU Droplets** to go to the GPU Droplet creation page. [GPU Droplet Creation Page — DigitalOcean Control Panel](https://cloud.digitalocean.com/gpus/new): Create a GPU Droplet with the resources you choose. This page has similar sections as the [regular Droplet creation page](https://docs.digitalocean.com/products/droplets/how-to/create/index.html.md), like choosing a datacenter region and SSH keys, and some different options: - **Choose an image**. We provide [AI/ML-ready images for AMD and NVIDIA GPU Droplets](https://docs.digitalocean.com/products/droplets/getting-started/recommended-gpu-setup/index.html.md#aiml-ready-image) which have drivers and software pre-installed. You can also use [1-Click Models](https://docs.digitalocean.com/products/marketplace/1-click-models/index.html.md) which let you deploy popular third-party models directly to GPU Droplets. GPU Droplets also work with existing Droplet images, but you need to [manually install GPU drivers](https://docs.digitalocean.com/products/droplets/getting-started/recommended-gpu-setup/index.html.md). - **Choose a GPU plan**. We offer a single GPU plan and an 8 GPU plan. GPU Droplets also come with a [scratch disk](https://docs.digitalocean.com/products/droplets/how-to/gpu/use-scratch-disk/index.html.md), which is a non-persistent disk to store data for staging purposes. - **Enable Metrics.** Select **Improved Metrics and Monitoring** to enable [**GPU Observability** in **Insights**](https://docs.digitalocean.com/products/monitoring/details/features/index.html.md#gpu-observability) automatically, allowing `do-agent` to detect the GPU type and integrate with the appropriate exporter (DGCM for NVIDIA or ROCm for AMD) to collect and send GPU metrics securely. For details about available GPU metrics, see the [Monitoring Metrics page](https://docs.digitalocean.com/products/monitoring/concepts/metrics/index.html.md). **Note**: The power throttling GPU metric is currently available only for AMD GPUs. NVIDIA support is planned but not yet available. To use AMD GPUs, [contact support to request access](https://cloudsupport.digitalocean.com). For **Basic Images**, you can enable GPU metrics by [manually installing the exporter](https://docs.digitalocean.com/products/droplets/how-to/gpu/enable-metrics/index.html.md), binding it to `127.0.0.1`, reconfiguring `do-agent` to scrape it, and restarting `do-agent`. - If you want to [enable jumbo frames](https://docs.digitalocean.com/products/droplets/how-to/gpu/enable-jumbo-frames/index.html.md), you can do so with user data during creation. Once you finish selecting your options, click **Create GPU Droplet**. GPU Droplets generally take longer than non-GPU Droplets to initialize, particularly for 8 GPU Droplets, so allow some time for this process to finish. ## Create a GPU Droplet Using the DigitalOcean API or CLI When creating a GPU Droplet using the DigitalOcean API or CLI, you need to provide values for: - The `region`, the string for the desired datacenter. - The `size`, the slug that specifies the Droplet plan. - The `image`, the slug that specifies the base image. You can view [slugs for all GPU Droplet plans](https://docs.digitalocean.com/products/droplets/details/features/index.html.md#gpu-droplets) and [more information on AI/ML-ready and inference-optimized images](https://docs.digitalocean.com/products/droplets/getting-started/recommended-gpu-setup/index.html.md). ## How to Create a New Droplet Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl compute droplet create`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/droplet/create/index.html.md) for more details: ```shell doctl compute droplet create ... [flags] ``` The following example creates a Droplet named `example-droplet` with a two vCPUs, two GiB of RAM, and 20 GBs of disk space. The Droplet is created in the `nyc1` region and is based on the `ubuntu-20-04-x64` image. Additionally, the command uses the `--user-data` flag to run a Bash script the first time the Droplet boots up: doctl compute droplet create example-droplet –size s-2vcpu-2gb –image ubuntu-20-04-x64 –region nyc1 –user-data $’#!/bin/bash\\n touch /root/example.txt; sudo apt update;sudo snap install doctl' Please note: In Windows Powershell, the example command would be the following instead: ```` ```shell doctl compute droplet create example-droplet --size s-2vcpu-2gb --image ubuntu-20-04-x64 --region nyc1 --user-data "#!/bin/bash`n touch /root/example.txt; sudo apt update;sudo snap install doctl" ``` ```` ## How to Create a New Droplet Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a POST request to [`https://api.digitalocean.com/v2/droplets`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/droplets_create). ### cURL Using cURL: ```shell curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -d '{"name":"example.com","region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-20-04-x64","ssh_keys":[289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],"backups":true,"ipv6":true,"monitoring":true,"tags":["env:prod","web"],"user_data":"#cloud-config\nruncmd:\n - touch /test.txt\n","vpc_uuid":"760e09ef-dc84-11e8-981e-3cfdfeaae000"}' \ "https://api.digitalocean.com/v2/droplets" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "os" "github.com/digitalocean/godo" ) func main() { token := os.Getenv("DIGITALOCEAN_TOKEN") client := godo.NewFromToken(token) ctx := context.TODO() createRequest := &godo.DropletCreateRequest{ Name: "example.com", Region: "nyc3", Size: "s-1vcpu-1gb", Image: godo.DropletCreateImage{ Slug: "ubuntu-20-04-x64", }, SSHKeys: []godo.DropletCreateSSHKey{ godo.DropletCreateSSHKey{ID: 289794}, godo.DropletCreateSSHKey{Fingerprint: "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"} }, Backups: true, IPv6: true, Monitoring: true, Tags: []string{"env:prod","web"}, UserData: "#cloud-config\nruncmd:\n - touch /test.txt\n", VPCUUID: "760e09ef-dc84-11e8-981e-3cfdfeaae000", } ``` ### Ruby Using [DropletKit](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby: ```ruby require 'droplet_kit' token = ENV['DIGITALOCEAN_TOKEN'] client = DropletKit::Client.new(access_token: token) droplet = DropletKit::Droplet.new( name: 'example.com', region: 'nyc3', size: 's-1vcpu-1gb', image: 'ubuntu-20-04-x64', ssh_keys: [289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"], backups: true, ipv6: true, monitoring: true, tags: ["env:prod","web"], user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n", vpc_uuid: "760e09ef-dc84-11e8-981e-3cfdfeaae000", ) client.droplets.create(droplet) ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) req = { "name": "example.com", "region": "nyc3", "size": "s-1vcpu-1gb", "image": "ubuntu-20-04-x64", "ssh_keys": [ 289794, "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45" ], "backups": True, "ipv6": True, "monitoring": True, "tags": [ "env:prod", "web" ], "user_data": "#cloud-config\nruncmd:\n - touch /test.txt\n", "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000" } resp = client.droplets.create(body=req) ```