In short. Use nvidia-smi for a one-off snapshot of GPU utilization, VRAM, temperature, and power. Use nvtop for a live, per-process view in the terminal. For history and alerts, run DCGM Exporter with Prometheus and Grafana in Docker and import Grafana dashboard 12239. All three work on any Linux GPU VPS with the NVIDIA driver installed, and the exporter stack needs the NVIDIA Container Toolkit.
GPU monitoring on a VPS answers three questions: is the GPU busy, is VRAM about to run out, and is the card running hot. The tools below answer them at three levels of effort, from a single command to a dashboard with alerts.
You need a GPU VPS or other GPU server with the NVIDIA driver and, for the Docker parts, the NVIDIA Container Toolkit. On a Contabo GPU VPS both come preinstalled. The NVIDIA Container Toolkit guide covers installing and verifying both, so this article starts where that one ends.
nvidia-smi command: how to read the output
The nvidia-smi command prints a snapshot of every NVIDIA GPU in the system: utilization, memory, temperature, power, performance state, and the processes using it. nvidia-smi ships with the NVIDIA driver, so there is nothing extra to install. Run it with no arguments:
nvidia-smi
The output is a table with one block per GPU and a process list underneath. These are the fields to read first:
| Field | What it shows | Normal | Worth a look |
|---|---|---|---|
| GPU-Util | Share of the last sample period with a kernel running | High during inference or training | Near 0% while a job should be running |
| Memory-Usage | VRAM used and total | Stable after a model loads | Creeping toward the total |
| Temp | Current GPU temperature in °C | Steady under load | Close to the slowdown temperature |
| Pwr:Usage/Cap | Current power draw and the power limit | Rises with load | Pinned at the cap with falling clocks |
| Perf | Performance state, P0 (maximum) to P12 (minimum) | P0 under load, a high P-state at idle | High P-state while a job runs |
| Processes | PID, process name, and VRAM per process | Your workload listed | Empty while the GPU shows memory in use |
GPU-Util is the most misread field. NVIDIA defines it as the percent of time during the sample period that one or more kernels was executing, so 100% means “always busy”, not “fully saturated”. To see the slowdown and shutdown temperatures for your card, run nvidia-smi -q -d TEMPERATURE.
Watch GPU usage live with nvidia-smi watch and dmon
For a live view, wrap the command in watch or use the built-in loop and monitoring modes. watch -n 1 nvidia-smi refreshes the full table every second, which is the quickest nvidia-smi watch setup:
watch -n 1 nvidia-smi
nvidia-smi dmon -s pu -d 5
nvidia-smi --query-gpu=timestamp,utilization.gpu,memory.used,memory.total,temperature.gpu,power.draw --format=csv -l 10
The second line runs dmon, which prints one compact row per GPU every 5 seconds with power and temperature (p) plus utilization (u). The third line is the nvidia-smi command for scripting: --query-gpu picks the fields, --format=csv makes the output machine-readable, and -l 10 repeats every 10 seconds. Add noheader,nounits to the format string when you pipe the output into another tool, and redirect it to a file for a quick log.
Install and use nvtop on Ubuntu
nvtop is an interactive, htop-style monitor that shows GPU utilization, VRAM, temperature, and power as charts, with a process list underneath. On Ubuntu 20.04 and newer it is one package away:
sudo apt install nvtop
nvtop
The top half graphs each GPU over time, and the bottom half lists the processes using it with their GPU and VRAM share. Press F2 to choose which metrics appear in the charts and F12 to save the layout. nvtop also supports AMD and Intel GPUs, which helps on mixed fleets.
nvtop beats nvidia-smi when you are watching a running workload and want trends rather than a single reading. For example, a model that loads, spikes to full utilization, and then drops to idle every few seconds is obvious in nvtop and easy to miss in a snapshot. For GPU monitoring over hours or days, move to the exporter stack below.
Monitor GPU usage inside Docker containers
Run nvidia-smi on the host for GPU monitoring of containers. Inside a container, nvidia-smi shows the GPU and its memory use but usually lists no processes, because NVIDIA notes that nvidia-smi and NVML do not support PID namespaces. The fix is to monitor from the host or start the container with --pid=host.
To match a host PID to a container, list the per-process VRAM and then look up which container owns the PID:
nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv
cat /proc/<PID>/cgroup
docker ps --no-trunc
The cgroup path contains the full container ID, which you match against docker ps --no-trunc. As a quick check, docker top <container> lists the host PIDs of every process in that container. GPU monitoring in Docker only works when the container was started with GPU access (--gpus all or a Compose deploy reservation), which the Container Toolkit guide sets up.
DCGM Exporter, Prometheus and Grafana for GPU monitoring
DCGM Exporter is NVIDIA’s Prometheus exporter for GPU metrics, and with Prometheus and Grafana it gives you GPU monitoring with history, dashboards, and alerts. DCGM Exporter reads metrics through NVIDIA DCGM and serves them on port 9400. Prometheus scrapes them, and Grafana graphs them. NVIDIA supports DCGM on data center GPUs from Kepler onward and classes the RTX PRO 6000 Blackwell Server Edition, the GPU in every Contabo GPU VPS, as a data center GPU.
Create a folder with a docker-compose.yml:
services:
dcgm-exporter:
image: nvcr.io/nvidia/k8s/dcgm-exporter:4.6.1-4.8.4
restart: unless-stopped
cap_add:
- SYS_ADMIN
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
ports:
- "127.0.0.1:9400:9400"
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./alerts.yml:/etc/prometheus/alerts.yml:ro
- prometheus_data:/prometheus
ports:
- "127.0.0.1:9090:9090"
grafana:
image: grafana/grafana:latest
restart: unless-stopped
volumes:
- grafana_data:/var/lib/grafana
ports:
- "127.0.0.1:3000:3000"
volumes:
prometheus_data:
grafana_data:
Then add prometheus.yml next to it:
global:
scrape_interval: 15s
rule_files:
- /etc/prometheus/alerts.yml
scrape_configs:
- job_name: dcgm
static_configs:
- targets: ["dcgm-exporter:9400"]
Create alerts.yml from the alerts section below before you start the stack. If you start it first, Docker creates a directory named alerts.yml and Prometheus will not start, so delete that directory and create the file. Then run docker compose up -d and check the exporter with curl -s localhost:9400/metrics | grep DCGM_FI_DEV_GPU_UTIL. Open Grafana through an SSH tunnel (ssh -L 3000:127.0.0.1:3000 user@your-server), add Prometheus as a data source at http://prometheus:9090, and import dashboard 12239 (NVIDIA DCGM Exporter Dashboard).
Graph these four default metrics first:
DCGM_FI_DEV_GPU_UTILfor GPU utilization in percentDCGM_FI_DEV_FB_USEDandDCGM_FI_DEV_FB_FREEfor VRAM used and freeDCGM_FI_DEV_GPU_TEMPfor GPU temperatureDCGM_FI_DEV_POWER_USAGEfor power draw in watts
For the generic Prometheus and Grafana setup, including users and retention, see the Prometheus and Grafana server monitoring guide. Pin the exporter tag as shown rather than using latest, since metric names can change between releases, and pin Prometheus and Grafana to release tags once the stack is stable.
A lightweight option: nvidia_gpu_exporter
nvidia_gpu_exporter is a single-binary NVIDIA GPU exporter that wraps nvidia-smi, and it is enough when you only need the basics in Prometheus. It needs no DCGM and no SYS_ADMIN capability, which makes it simpler to run on one server:
docker run -d --name nvidia_gpu_exporter --restart unless-stopped \
--gpus all -e NVIDIA_DRIVER_CAPABILITIES=utility \
-p 127.0.0.1:9835:9835 utkuozdemir/nvidia_gpu_exporter:latest
It serves metrics such as nvidia_smi_utilization_gpu_ratio, nvidia_smi_memory_used_bytes, and nvidia_smi_power_draw_watts on port 9835, and Grafana dashboard 14574 visualizes them. To scrape it from the Compose Prometheus above, run it as a service in the same Compose file and add nvidia_gpu_exporter:9835 as a scrape target. For Prometheus GPU monitoring on a single GPU VPS, either exporter works. Choose DCGM Exporter when you want NVIDIA-maintained metrics with profiling fields, or plan to move to Kubernetes later.
Set up alerts for GPU temperature, VRAM and idle GPUs
Prometheus alert rules turn GPU monitoring into notifications for the three failures that cost money: overheating, out-of-memory crashes, and a GPU that sits idle while you pay for it. Save these rules as alerts.yml:
groups:
- name: gpu
rules:
- alert: GpuHot
expr: DCGM_FI_DEV_GPU_TEMP > 85
for: 5m
- alert: GpuVramNearlyFull
expr: DCGM_FI_DEV_FB_USED / (DCGM_FI_DEV_FB_USED + DCGM_FI_DEV_FB_FREE) > 0.95
for: 10m
- alert: GpuIdle
expr: max_over_time(DCGM_FI_DEV_GPU_UTIL[3h]) < 5
- alert: GpuExporterDown
expr: up{job="dcgm"} == 0
for: 5m
- Temperature: 85 °C is an example value. Set it a few degrees below the slowdown temperature from
nvidia-smi -q -d TEMPERATURE. - VRAM: above 95% for 10 minutes usually means the next request or batch will fail with an out-of-memory error.
- Idle GPU: no reading above 5% for 3 hours flags a forgotten server or a crashed job.
- Exporter down: without this rule, a dead exporter looks like a quiet GPU.
Prometheus evaluates the rules but does not send messages itself. Route them through Alertmanager, or build the same queries as alerts in Grafana with email or chat notifications.
Troubleshooting low GPU utilization on Linux
Low GPU utilization on Linux usually has one of four causes, and the GPU monitoring tools above confirm each one.
Is the workload running on the CPU instead? Check the Processes list in nvidia-smi on the host. If your process is missing and VRAM is empty, the job never reached the GPU. In Docker, the usual cause is a container started without --gpus all. For Ollama, ollama ps shows a CPU/GPU split in its processor column.
Is the CPU the bottleneck? Run nvtop next to htop. If CPU cores sit at 100% while GPU utilization jumps up and down, data loading or tokenization is starving the GPU. More loader workers or preprocessing ahead of time usually fixes it.
Are the batches too small? Low utilization with little VRAM in use points to batches or concurrent requests that are too small to fill the GPU. Raise the batch size or the server concurrency setting and watch dmon while you do.
Is the GPU throttling? Run nvidia-smi -q -d PERFORMANCE to see the active clock-limiting reasons, such as a power cap or thermal slowdown. Compare the power draw against the cap in the main nvidia-smi table.
Why run GPU workloads on a Contabo GPU VPS
A Contabo GPU VPS gives you a whole data center GPU at a flat monthly price, which makes GPU monitoring about utilization rather than metered cost. Each GPU VPS has a dedicated NVIDIA RTX PRO 6000 Blackwell Server Edition with 96 GB GDDR7 ECC VRAM, 18 vCPU, 96 GB RAM, and 900 GB NVMe storage.
The GPU VPS ships on Ubuntu 24.04 with the CUDA drivers, the CUDA toolkit, and the NVIDIA Container Toolkit installed, so nvidia-smi and GPU-enabled Docker work on first login. Because the price is flat, the idle-GPU alert above is the one that protects your budget: an idle card costs the same as a busy one. Read what a GPU VPS is or the GPU VPS pricing comparison for context, and the vLLM with Docker guide for a workload to monitor.
FAQ: Monitoring a GPU VPS
How do I check GPU usage on Linux with the nvidia-smi command?
Run nvidia-smi in a terminal. The GPU-Util column shows how much of the last sample period the GPU spent running kernels, and Memory-Usage shows VRAM used against the total. For GPU utilization on Linux in a script, use nvidia-smi –query-gpu=utilization.gpu,memory.used –format=csv. The command ships with the NVIDIA driver, so it needs no separate install.
What is the difference between nvidia-smi and nvtop?
nvidia-smi is NVIDIA’s command-line tool that prints a snapshot of GPU utilization, memory, temperature, power, and processes, and it ships with the driver. nvtop is a separate open-source monitor with live charts and a process list, similar to htop. Use nvidia-smi for quick checks and scripts, and nvtop when you want to watch a running workload over time.
How do I monitor a GPU with DCGM Exporter, Prometheus and Grafana?
Run DCGM Exporter in Docker with GPU access and the SYS_ADMIN capability, and it serves GPU metrics on port 9400. Point Prometheus at that endpoint as a scrape target, add Prometheus as a data source in Grafana, and import dashboard 12239. You then get history for utilization, VRAM, temperature, and power, plus Prometheus alert rules for each.
Can I see GPU usage per Docker container?
Yes, from the host machine. Inside a container, nvidia-smi usually lists no processes because it does not support PID namespaces. On the host, nvidia-smi –query-compute-apps=pid,used_memory –format=csv lists VRAM per process ID. Match each PID to its container through /proc/<PID>/cgroup or docker top, or start the container with –pid=host to see processes inside it.
How do I keep nvidia-smi running continuously?
Use watch -n 1 nvidia-smi to refresh the full table every second, or nvidia-smi -l 5 to repeat the output every 5 seconds. For a compact scrolling view, nvidia-smi dmon prints one line per GPU per interval. To keep it running after you log out, run the query form with -l inside tmux, or use an exporter with Prometheus instead.
