Short answer
nvidia-smi (NVIDIA System Management Interface) is the command-line tool installed with NVIDIA drivers for monitoring and managing NVIDIA GPUs on Linux and Windows. Run nvidia-smi to see each GPU's memory use, utilisation, temperature, power draw and running processes. Two fields are often misread: CUDA Version shows the highest CUDA version the driver supports, not the toolkit you installed, and GPU-Util is the percentage of time a kernel was running, not the share of GPU cores in use. The most useful commands are nvidia-smi -l 1 (refresh every second), nvidia-smi --query-gpu=... --format=csv (scriptable metrics), nvidia-smi dmon (rolling device stats) and sudo nvidia-smi -pl 300 (set a 300 W power limit).
Reading the default output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.xx Driver Version: 580.xx CUDA Version: 13.0 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4090 Off | 00000000:01:00.0 Off | Off |
| 30% 45C P2 210W / 450W | 18432MiB / 24564MiB | 87% Default |
+-----------------------------------------+------------------------+----------------------+| Field | Meaning |
|---|---|
| Driver Version | Installed NVIDIA driver |
| CUDA Version | Maximum CUDA version supported by this driver, not necessarily the installed toolkit (check nvcc --version or torch.version.cuda) |
| Persistence-M | Persistence mode: keeps the driver loaded when no apps run (Linux) |
| Bus-Id | PCI address of the GPU |
| Disp.A | Whether a display is attached/initialised |
| Volatile Uncorr. ECC | Uncorrectable ECC errors since last reboot (data center/workstation GPUs) |
| Fan | Fan speed as a percentage of maximum (N/A for passively cooled GPUs) |
| Temp | GPU core temperature in °C |
| Perf | Performance state from P0 (maximum) to P12 (idle) |
| Pwr:Usage/Cap | Current power draw / power limit |
| Memory-Usage | VRAM used / total |
| GPU-Util | Percentage of time over the sample period that one or more kernels were executing |
| Compute M. | Compute mode (Default, Exclusive_Process, Prohibited) |
| MIG M. | Multi-Instance GPU mode (A100/H100/H200/B200 class) |
The processes table below lists each process's PID, type (C = compute, G = graphics) and GPU memory.
Important: 100% GPU-Util does not mean the GPU is fully used. A single small kernel running constantly shows 100%. For real efficiency, look at SM activity and tensor core usage with tools like DCGM or Nsight, and at MFU.
Monitoring commands
| Task | Command |
|---|---|
| Snapshot of all GPUs | nvidia-smi |
| Refresh every second | nvidia-smi -l 1 or watch -n 1 nvidia-smi |
| List GPUs and UUIDs | nvidia-smi -L |
| Show only GPU 0 | nvidia-smi -i 0 |
| Full details | nvidia-smi -q |
| Specific sections | nvidia-smi -q -d MEMORY,UTILIZATION,TEMPERATURE,POWER,CLOCK |
| Rolling device stats | nvidia-smi dmon (power, temp, SM %, memory %, clocks) |
| Rolling per-process stats | nvidia-smi pmon |
| Processes using GPUs (CSV) | nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv |
| List queryable fields | nvidia-smi --help-query-gpu |
Scriptable queries and logging
nvidia-smi --query-gpu=timestamp,index,name,temperature.gpu,utilization.gpu,utilization.memory,memory.used,memory.total,power.draw,power.limit,clocks.sm \
--format=csv -l 5 > gpu_log.csv| Useful field | Meaning |
|---|---|
utilization.gpu | Kernel-active time % |
utilization.memory | % of time memory was being read or written |
memory.used / memory.total | VRAM usage |
temperature.gpu / temperature.memory | Core and memory temperature (memory not on all GPUs) |
power.draw / power.limit | Watts used and allowed |
clocks.sm / clocks.mem | Current clocks |
pstate | Performance state |
fan.speed | Fan % |
pcie.link.gen.current / pcie.link.width.current | PCIe link status |
clocks_event_reasons.active | Why clocks are reduced (throttling) |
Add ,noheader,nounits to --format=csv for clean output in scripts.
Power, clocks and performance
| Task | Command |
|---|---|
| Set power limit to 300 W | sudo nvidia-smi -pl 300 |
| Set limit on GPU 1 only | sudo nvidia-smi -i 1 -pl 250 |
| Show allowed power range | nvidia-smi -q -d POWER |
| Enable persistence mode | sudo nvidia-smi -pm 1 |
| Lock GPU clocks (min,max MHz) | sudo nvidia-smi -lgc 1500,1800 |
| Reset locked clocks | sudo nvidia-smi -rgc |
| See throttling reasons | nvidia-smi -q -d PERFORMANCE |
Why power-limit for AI? Many AI workloads lose only a little speed at 70–85% of maximum power while running cooler and quieter. Settings reset on reboot unless applied by a startup script. See GPU power consumption for AI.
Multi-GPU, NVLink and topology
| Task | Command |
|---|---|
| Show GPU interconnect topology | nvidia-smi topo -m |
| NVLink status | nvidia-smi nvlink -s |
| NVLink capabilities | nvidia-smi nvlink -c |
| Choose GPUs for a program | CUDA_VISIBLE_DEVICES=0,1 python train.py (environment variable, not an nvidia-smi command) |
The topology matrix shows whether GPUs connect via NVLink (NV#), the same PCIe switch (PIX), or across CPU sockets (SYS), which affects multi-GPU performance. See NVLink and NVSwitch explained and multi-GPU LLM setup.
MIG (Multi-Instance GPU)
On supported data center GPUs (A100, H100, H200, B200):
| Task | Command |
|---|---|
| Enable MIG on GPU 0 | sudo nvidia-smi -i 0 -mig 1 |
| List available profiles | nvidia-smi mig -lgip |
| Create GPU and compute instances | sudo nvidia-smi mig -cgi <profile-ids> -C |
| List instances | nvidia-smi mig -lgi |
| Destroy instances | sudo nvidia-smi mig -dci && sudo nvidia-smi mig -dgi |
See NVIDIA H100 specs for MIG sizes.
Troubleshooting
| Problem | Command / action |
|---|---|
| Check ECC errors | nvidia-smi -q -d ECC |
| Check retired / remapped memory rows | nvidia-smi -q -d ROW_REMAPPER (newer GPUs) or -d PAGE_RETIREMENT |
| Reset a hung GPU (no processes running) | sudo nvidia-smi -r -i 0 |
| Kill a process holding memory | Find PID with nvidia-smi, then kill <PID> |
| "No devices were found" | Driver not loaded; check that the nvidia kernel module is loaded (lsmod), reinstall driver, check BIOS/PCIe |
| "Failed to initialize NVML: Driver/library version mismatch" | Driver updated but kernel module not reloaded: reboot |
| Memory used but no processes listed | Containers or other namespaces may hide PIDs; check from the host |
Also check kernel logs for Xid errors (sudo dmesg | grep -i xid), which indicate driver or hardware faults. For memory errors in your code, see CUDA out of memory.
Windows, WSL and containers
- Windows:
nvidia-smiis installed with the driver (inC:\Windows\System32); run it from Command Prompt or PowerShell. Some fields and settings (like persistence mode) are Linux-only. - WSL 2:
nvidia-smiworks inside WSL with Windows NVIDIA drivers; don't install Linux display drivers inside WSL. - Docker: with the NVIDIA Container Toolkit, run
docker run --gpus all nvidia/cuda:<tag> nvidia-smito verify GPU access.
Beyond nvidia-smi
| Tool | Use |
|---|---|
| nvtop | Interactive htop-style GPU monitor |
| gpustat | Compact one-line-per-GPU status |
| NVIDIA DCGM / dcgm-exporter | Cluster monitoring with Prometheus/Grafana, detailed SM and tensor activity |
| Nsight Systems / Nsight Compute | Profiling kernels and timelines |
torch.cuda.memory_summary() | PyTorch memory breakdown |
Frequently asked questions
What does nvidia-smi stand for?
NVIDIA System Management Interface, built on the NVIDIA Management Library (NVML).
Why does nvidia-smi show a different CUDA version than nvcc?
nvidia-smi shows the highest CUDA version the driver supports; nvcc shows the installed CUDA toolkit. They are often different, and that's normal as long as the toolkit isn't newer than the driver supports.
What does GPU-Util mean in nvidia-smi?
The percentage of time during the sample period that at least one kernel was running. It doesn't measure how many cores were busy.
How do I monitor GPU usage continuously?
Use nvidia-smi -l 1, watch -n 1 nvidia-smi, nvidia-smi dmon, or log metrics with --query-gpu ... --format=csv -l 5.
How do I limit GPU power with nvidia-smi?
Run sudo nvidia-smi -pl <watts>; check allowed values with nvidia-smi -q -d POWER.




Leave a Reply