How to run Grounding DINO on a cloud GPU

Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install Grounding DINO from the official IDEA-Research/GroundingDINO repository the way the README prints, set CUDA_HOME before that install, download the checkpoint the README wget line names, and run the text-prompt demo. Copy pred.jpg off the instance before you destroy it, because destroying the instance deletes its disk.

Promptable segmentation is a different repository: How to run SAM 2 (Segment Anything 2) on a cloud GPU. Depth maps from a different repository, whose README prints no GPU GB figure, are How to run Depth Anything V2 on a cloud GPU. Training a YOLO detector is How to train a YOLO model on a cloud GPU. The wheel index is How to install a specific PyTorch CUDA version. If the process raises no kernel image on an RTX 5090: How to fix CUDA no kernel image on an RTX 5090. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU. The tunnel for the Gradio file is How to use SSH port forwarding on a cloud GPU.

The repository LICENSE file is the Apache License, Version 2.0, January 2004. The appendix copyright line is Copyright 2023 - present, IDEA Research. The GitHub license field on 2026-11-13 was Apache-2.0. The model API for ShilongLiu/GroundingDINO, the checkpoint repository named in the README table, reported license apache-2.0 and gated false, lastModified 2023-04-11T09:20:16.000Z. Read the LICENSE file before you redistribute the program or the weights.

The commands below are copied from the upstream files named in each step. They were not run on a CloudGPU instance for this page. Anything this page adds around them is marked.

What the README says about memory

The README (commit 856dde20aee659246248e20734ef9ba5214f5e44, 2024-08-12, which is also repository HEAD), requirements.txt, environment.yaml, demo/inference_on_a_image.py, and demo/gradio_app.py print no GPU GB figure. This page does not invent one. The README checkpoint table has a column headed box AP on COCO. This page does not treat that column as VRAM.

The highlight says COCO zero-shot 52.5 AP and COCO fine-tune 63.0 AP. The table cell for GroundingDINO-T says 48.4 (zero-shot) / 57.2 (fine-tune). The table cell for GroundingDINO-B says 56.7. The COCO zero-shot evaluations section says the results should be 48.5. Those four sentences are the README’s. This page does not reconcile them.

GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from gpu-prices.json, updated_at 2026-11-13T18:00:59.357Z. GET /v1/public/gpu-catalog the same day (generated_at 2026-11-13T18:00:59.934Z) listed the same names and the same vram_gb values, plus Ascend 910B at 64, which is not in gpu-prices.json and is not listed here. The catalog response also includes an availability field. This page does not copy it. Every prices row has gpu_count 1. Every catalog row has min_gpu_count 1. There is no upstream GPU GB figure to match these values against. This page did not run Grounding DINO and does not mark a row as enough. Which listing you can start is on Deploy.

The catalog template list had no Grounding DINO template.

Catalog name vram_gb
RTX 2080 8
RTX 3080 10
RTX 2080 Ti 11
RTX 3080 Ti 12
V100 16G 16
A30 24
RTX 3090 24
RTX 4090 24
RTX 4090D 24
RTX 4080 SUPER 32G 32
RTX 5090 32
RTX 5090D 32
V100 32G 32
A100 40G 40
A800 40G 40
A40 48
RTX 4090 48G 48
RTX 4090D 48G 48
RTX A6000 48
NVIDIA RTX PRO 5000 72G 72
RTX PRO 5000 72G 72
A100 80G 80
A800 80G 80
H800 80
RTX 6000D 83
H20 96G 96
RTX PRO 6000 96G 96
RTX PRO 6000 Max-Q 96
H20-3e 141G 141

Install, including CUDA_HOME

On Deploy, choose Raw GPU. The README says that if you have a CUDA environment, CUDA_HOME must be set, and that the program compiles in CPU-only mode if no CUDA is available. It says a failed install can raise NameError: name '_C' is not defined, and that the fix it prints is to reclone and repeat the steps. The check and the example export, copied. The path /path/to/cuda-11.3 is the README’s placeholder.

echo $CUDA_HOME
export CUDA_HOME=/path/to/cuda-11.3

The same section says the CUDA version should be aligned with the CUDA runtime, and that which nvcc finds the toolkit. Its example, if which nvcc prints /usr/local/cuda/bin/nvcc, is export CUDA_HOME=/usr/local/cuda. How to install a specific PyTorch CUDA version is the separate wheel-index check. This page did not set CUDA_HOME on a rental image.

setup.py (commit 2b62f419c292ca9c518daae55512fabc3fead4a4, 2023-12-31) adds the CUDA sources when CUDA_HOME is not None and either torch.cuda.is_available() is true or TORCH_CUDA_ARCH_LIST is set. The README’s CPU-only sentence and that condition are not the same sentence. This page does not merge them.

The numbered install, copied:

git clone https://github.com/IDEA-Research/GroundingDINO.git
cd GroundingDINO/
pip install -e .

requirements.txt (commit 8b6a55f612b3328c94a5e62ea6144aedde0c4302, 2024-07-23) lists torch, torchvision, and transformers with no versions and no CUDA index. environment.yaml (commit 03198a2a7940ba91ec9db1e13c939dae6198a49b, 2023-11-13) pins pytorch=2.0.1 and pytorch-cuda=11.8. The numbered steps do not tell you to create that env. This page follows the numbered steps and did not run them. LICENSE was commit 16292e162d757fa6cbb8a46df84865fc3dc31ffe, committed 2023-06-17T09:31:07Z.

Download the weights

The README’s download block, copied:

mkdir weights
cd weights
wget -q https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
cd ..

The checkpoint table also lists GroundingDINO-B, file groundingdino_swinb_cogcoor.pth, from https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha2/groundingdino_swinb_cogcoor.pth. The same table links both files on https://huggingface.co/ShilongLiu/GroundingDINO. The demo command below uses the Swin-T file and groundingdino/config/GroundingDINO_SwinT_OGC.py. The Swin-B config in the table is groundingdino/config/GroundingDINO_SwinB_cfg.py. This page did not download either file.

Text-prompt demo

The README’s demo command, copied. The braces are the README’s placeholders.

CUDA_VISIBLE_DEVICES={GPU ID} python demo/inference_on_a_image.py \
-c groundingdino/config/GroundingDINO_SwinT_OGC.py \
-p weights/groundingdino_swint_ogc.pth \
-i image_you_want_to_detect.jpg \
-o "dir you want to save the output" \
-t "chair"
 [--cpu-only] # open it for cpu mode

A second command in the same section uses -p ./groundingdino_swint_ogc.pth, -i .asset/cat_dog.jpeg, -o logs/1111, and a --token_spans value. That -p path is not the weights/ path from the wget block. This page does not merge them.

demo/inference_on_a_image.py (commit fbb2532bb05e329c32533cf3b65aa360b574051e, 2023-11-13) writes raw_image.jpg and pred.jpg under --output_dir. The default in the argument parser is outputs, and the argument is also required=True. --box_threshold defaults to 0.3. --text_threshold defaults to 0.25. This page did not run it.

The README’s Python snippet, copied, including the variable spelling in that block:

from groundingdino.util.inference import load_model, load_image, predict, annotate
import cv2

model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.py", "weights/groundingdino_swint_ogc.pth")
IMAGE_PATH = "weights/dog-3.jpeg"
TEXT_PROMPT = "chair . person . dog ."
BOX_TRESHOLD = 0.35
TEXT_TRESHOLD = 0.25

image_source, image = load_image(IMAGE_PATH)

boxes, logits, phrases = predict(
    model=model,
    image=image,
    caption=TEXT_PROMPT,
    box_threshold=BOX_TRESHOLD,
    text_threshold=TEXT_TRESHOLD
)

annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases)
cv2.imwrite("annotated_image.jpg", annotated_frame)

cv2.imwrite writes annotated_image.jpg in the working directory. This page did not run the snippet.

Gradio file

The README says a Gradio demo is in demo/gradio_app.py and does not print a launch command. That file (commit 16e0ccdb7da40613591666abe2cb06f91f961503, 2024-04-22) sets ckpt_repo_id to ShilongLiu/GroundingDINO and the filename to groundingdino_swint_ogc.pth, then calls hf_hub_download. At import it runs python setup.py build develop --user and pip install gradio==3.50.2 through os.system. load_model_hf defaults device to cpu. predict is called with device='cpu'. block.launch is called with server_name='0.0.0.0', server_port=7579, and share=args.share. The function returns the annotated image to the page and does not call imwrite. This page did not start it and does not pass --share. Forward port 7579 with how to use SSH port forwarding on a cloud GPU.

SAM 2

The README says Grounded SAM 2 combines Grounding DINO with SAM 2, and it links https://github.com/IDEA-Research/Grounded-SAM-2 and https://github.com/facebookresearch/segment-anything-2. This page does not copy that repository’s install. The CloudGPU SAM 2 page follows facebookresearch/sam2: How to run SAM 2 (Segment Anything 2) on a cloud GPU. The README also links a separate 1.5 repository. This page follows the install in this repository only.

ComfyUI

The Grounding DINO README does not mention ComfyUI. The ComfyUI examples top-level directory list on 2026-11-13 had no Grounding DINO directory. Examples HEAD was f9431bb000ce792094ff345446e22cac1ea6cef3, committed 2025-11-26T20:33:58Z. Installing ComfyUI itself is How to install ComfyUI and ComfyUI-Manager on a cloud GPU. This page did not install a node.

When it fails

NameError: name '_C' is not defined. The README says this can follow an install that skipped a step, and that the recovery it prints is to reclone and repeat the install, with CUDA_HOME set when CUDA is available.

CUDA out of memory. The files named above print no GPU GB cutoff and no low-memory flag. If the process raises that error, use how to fix CUDA out of memory on a cloud GPU.

“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. The numbered install does not pin a torch wheel. environment.yaml pins pytorch=2.0.1 and pytorch-cuda=11.8, and the numbered steps do not tell you to use that file. The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. This page did not re-test Grounding DINO on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.

Save the images, then destroy

Copy the directory you passed to -o, which receives raw_image.jpg and pred.jpg, and copy annotated_image.jpg if you ran the Python snippet. The Gradio file does not write a project directory. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.

The pricing page FAQ states the billing rule in these words:

Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.

Frequently asked questions

How much VRAM does the Grounding DINO README publish?

The Grounding DINO README, requirements.txt, environment.yaml, demo/inference_on_a_image.py, and demo/gradio_app.py print no GPU GB figure (read 2026-11-13). This page does not invent one and does not mark a catalog vram_gb as enough. Which listing you can start is on https://cloudgpu.app/deploy.

Which license applies to the code and the checkpoint repository named in the README?

The repository LICENSE file is the Apache License, Version 2.0, January 2004. The appendix copyright line is Copyright 2023 - present, IDEA Research. The GitHub license field on 2026-11-13 was Apache-2.0. The model API for ShilongLiu/GroundingDINO reported license apache-2.0 and gated false. Read the LICENSE file before you redistribute the program or the weights.

Where does the text-prompt demo save results, and which port does the Gradio file use?

The README demo command passes -o to a directory you choose. demo/inference_on_a_image.py writes raw_image.jpg and pred.jpg in that directory. The Python snippet in the README writes annotated_image.jpg in the working directory. demo/gradio_app.py calls block.launch with server_name 0.0.0.0 and server_port 7579. Its predict call passes device cpu. It returns the image to the page and does not call imwrite. This page did not start it. Forward port 7579. The tunnel page is https://cloudgpu.app/guides/how-to-use-ssh-port-forwarding-on-a-cloud-gpu.

Does the README document combining Grounding DINO with SAM 2?

The README says Grounded SAM 2 combines Grounding DINO with SAM 2 and links the Grounded-SAM-2 repository and the segment-anything-2 repository. This page does not copy that repository’s install. The CloudGPU SAM 2 page is https://cloudgpu.app/guides/how-to-run-sam-2-on-a-cloud-gpu and follows facebookresearch/sam2. The Grounding DINO README and the ComfyUI examples list on 2026-11-13 do not document a ComfyUI route for this repository.

Sources (read 2026-11-13, Asia/Shanghai)

  • Grounding DINO README (CUDA_HOME, clone, pip install -e ., wget of groundingdino_swint_ogc.pth, demo command, Python snippet, Gradio file pointer, checkpoint table, Grounded SAM 2 links, AP sentences, no GPU GB figure): https://github.com/IDEA-Research/GroundingDINO/blob/main/README.md commit 856dde20aee659246248e20734ef9ba5214f5e44. Repository HEAD is that commit, committed 2024-08-12T08:52:02Z
  • demo/inference_on_a_image.py (raw_image.jpg, pred.jpg, --box_threshold 0.3, --text_threshold 0.25): commit fbb2532bb05e329c32533cf3b65aa360b574051e
  • demo/gradio_app.py (ShilongLiu/GroundingDINO, server_name='0.0.0.0', server_port=7579, device='cpu'): commit 16e0ccdb7da40613591666abe2cb06f91f961503
  • requirements.txt (unpinned torch): commit 8b6a55f612b3328c94a5e62ea6144aedde0c4302
  • environment.yaml (pytorch=2.0.1, pytorch-cuda=11.8; not used by the numbered install): commit 03198a2a7940ba91ec9db1e13c939dae6198a49b
  • setup.py (CUDA sources when CUDA_HOME is set and CUDA is available or TORCH_CUDA_ARCH_LIST is set): commit 2b62f419c292ca9c518daae55512fabc3fead4a4
  • LICENSE (Apache License, Version 2.0, January 2004; Copyright 2023 - present, IDEA Research.): commit 16292e162d757fa6cbb8a46df84865fc3dc31ffe. GitHub license field Apache-2.0
  • Model API ShilongLiu/GroundingDINO (apache-2.0, gated false, lastModified 2023-04-11T09:20:16.000Z), read 2026-11-13
  • ComfyUI examples (no Grounding DINO directory): https://github.com/comfyanonymous/ComfyUI_examples commit f9431bb000ce792094ff345446e22cac1ea6cef3
  • Public GPU memory: https://cloudgpu.app/gpu-prices.json (updated_at 2026-11-13T18:00:59.357Z) and https://cloudgpu.app/v1/public/gpu-catalog (generated_at 2026-11-13T18:00:59.934Z). GET /v1/public/compute-capabilities returned feature flags and no GPU list. The catalog had no Grounding DINO template

Cards you can start are on the Deploy page. Prices are on https://cloudgpu.app/pricing and are not repeated here.

Last updated: 2026-11-13 (Asia/Shanghai).