# How Do You Measure GPU Utilisation?

> What GPU utilisation counts, why the headline number misleads, and which metrics show real use, explained for your AI interview.

**In short:** nvidia-smi reports GPU utilisation as the share of time at least one kernel (a small program run on the GPU) was running. It measures time, not how full the chip is, so a GPU can read 100% while most of its compute blocks sit idle. Check SM activity and memory bandwidth alongside it.

AI and LLM interview question Q341, Inference, performance and cost. Advanced, occasional (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/how-do-you-measure-gpu-utilisation

## Say it in 30 seconds

GPU utilisation is the share of time a GPU has at least one kernel running. It is a time measure, so a GPU can read 100% while most of its compute blocks sit idle. I check SM activity and memory bandwidth too, and judge the setup by tokens per second, the work it actually gets done.

## Say it in 2 minutes

The headline number comes from nvidia-smi, NVIDIA's command-line tool. It shows the percent of time, over a short sample window, in which at least one kernel was running. That is a time share. It does not tell you how many of the chip's compute blocks were working, so a GPU can show 100% while most of its compute sits idle.

Memory works the same way. Memory utilisation measures how often memory is being read or written, not how full it is. For a finer view, DCGM reads counters from the chip itself. The key number is SM activity. DCGM says a value under 0.5 likely means ineffective use, and that a value of 0.8 or more is necessary but not enough on its own.

Then I measure the outcome. In a made-up case, a summariser showed 97% GPU use but produced about half the tokens per second the load test predicted. SM activity was 31% and memory bandwidth 70%, so the compute blocks sat mostly idle while the memory was busy. Batching requests so each memory read served more users fixed it, and I judged the change by tokens per second.

For tools of my own, I would use NVML and its Python bindings, because NVIDIA says they should be the first choice for any tool kept across driver releases. So a busy reading tells you where to start checking, and the output rate tells you the rest.

## What is GPU utilisation, in plain words?

A GPU is the chip that does most of the maths when an AI model runs. GPU utilisation is the percentage a monitoring tool shows for how busy that chip is. It sounds simple, which is why people trust it more than they should.

Think of a warehouse forklift. Its engine runs whenever the key is on, even when the forklift is idling with an empty fork. A supervisor who counts engine hours would call that truck busy. A supervisor who counts pallets moved would call it idle. GPU utilisation is closer to the engine-hours count.

Take an insurance company that runs a claims summariser on a GPU. A dashboard that reads 97% looks full. Whether the chip is full is a different question, and the answer decides what the service costs and how fast it responds.

- **GPU:** The graphics chip. In AI work it does the matrix maths that models need.
- **Kernel:** A small program the GPU runs for one piece of work, such as one step of a model's answer.
- **SM:** Streaming multiprocessor. One of the compute blocks inside a GPU. A big chip has many.
- **Sample window:** The short slice of time, about a second or less, that a tool averages over.

## What does the headline number count?

nvidia-smi is NVIDIA's command-line tool for its GPUs. Its GPU figure is a time share, and NVIDIA defines it like this:

> "Percent of time over the past sample period during which one or more kernels was executing on the GPU." (NVIDIA, nvidia-smi manual)

A sample window may last between one second and one sixth of a second, depending on the product. So a reading of 100% means a kernel ran in every window. It does not say how many of the chip's compute blocks were working during that time.

*Diagram, Why 100% can still be mostly idle: One small kernel keeps the headline reading at 100%, while only one of four compute blocks is working. Both numbers come from the same GPU in the same minute. Read them together before calling the chip full.*
1. The kernel keeps the GPU counted as busy.
2. Only one of the four compute blocks has work.
3. The headline number reads 100%.
4. Full use needs the SM number high too.

Memory has the same trap. NVIDIA defines memory utilisation as the share of time device memory is being read or written. That is a different thing from how full the memory is, so check which one you are reading.

Here is the gap in a few lines of Python. The trace is made up: ten one-second windows on a chip with four compute blocks. It needs no GPU, so the output is the same every run.

```python
# A made-up trace of ten one-second windows on a GPU with 4 SMs (compute blocks).
# Each number is how many SMs had work in that window.
SMS = 4
busy = [1, 1, 1, 1, 1, 1, 4, 4, 1, 0]

# Headline style: was any kernel running in the window?
windows_with_work = sum(1 for n in busy if n > 0)
gpu_util = windows_with_work / len(busy)

# SM activity: how much of the time the compute blocks had work, on average?
sm_activity = sum(busy) / (SMS * len(busy))

print(f"Windows with any work: {windows_with_work} of {len(busy)}")
print(f"Headline GPU utilization: {gpu_util:.1%}")
print(f"SM activity: {sm_activity:.1%}")
if gpu_util > 0.8 and sm_activity < 0.5:
    print("Looks busy, but most compute blocks are idle")
```

Output:

```text
Windows with any work: 9 of 10
Headline GPU utilization: 90.0%
SM activity: 37.5%
Looks busy, but most compute blocks are idle
```

The chip counted as busy in nine of ten windows, but its compute blocks averaged 37.5%. The finer numbers in the next section show that gap.

## Which numbers show real use?

NVIDIA's DCGM tool reads counters from the chip's own hardware. Its profiling metrics include these four, under the names it uses:

- **SM activity:** The share of time at least one warp was active, averaged over all compute blocks. A warp is a small group of threads that runs together.
- **SM occupancy:** The share of the most warps a compute block can hold that are resident at once.
- **Memory BW Utilization:** How often data is sent to or received from device memory.
- **Tensor activity:** How often the part of the chip built for matrix maths is busy.

> "A value of 0.8 or greater is necessary, but not sufficient, for effective use of the GPU." (NVIDIA, DCGM user guide)

So SM activity is the number to read first. DCGM says a value under 0.5 likely means ineffective use. Even 0.8 is not enough on its own, and the tool notes that a warp waiting on memory still counts as active. That is why a high SM number can hide a memory wait.

Occupancy is easy to misread too. DCGM says higher occupancy does not necessarily mean better GPU usage. Memory bandwidth has a practical ceiling: DCGM puts the peak at about 0.8 (80%) in practice, so a reading of 70% is near that practical ceiling.

Worked example, with made-up numbers. A claims team runs a summariser on four GPUs. The dashboard shows 97% GPU utilisation, yet output is flat. Tokens per second, the small pieces of text a model writes, come in at about half of what the load test predicted. SM activity reads 31% and memory bandwidth 70%.

*Diagram, Diagnosing a busy but slow GPU: Start from the dashboard, then check the compute and memory figures. The last box is the fix, and the change is judged by tokens per second. The numbers are made up for this example.*
1. First check whether the compute blocks are really busy.
2. Then check how hard the memory is working.
3. Compute is only 31% active, so most of it sits idle.
4. Memory is busy at 70%, so sharing each read pays off.

The compute is mostly idle, and the memory is busy. The likely cause is that each step reads the model's weights from memory for only a few requests at a time. The fix is batching, where the server groups requests so one memory read serves more users. The team then judged the change by tokens per second alone.

> **Tip:** Judge a GPU by the work it finishes, such as tokens per second or requests served per hour. A percentage on its own does not show that.

## How do you collect these numbers?

1. **Look quickly with nvidia-smi:** Run it on the machine for a quick look at all the GPUs. Its manual warns that its output is not guaranteed to be backwards compatible, so do not build a long-lived parser on its text.
2. **Use NVML for your own tools:** NVML is the library under nvidia-smi. NVIDIA says NVML and its Python bindings are the first choice for any tool that must be maintained across NVIDIA driver releases.
3. **Use DCGM for a fleet:** For many GPUs at once, DCGM reads profiling counters from the hardware at low overhead. It samples once a second by default, and you can query it down to every 100 ms with its dcgmi command, such as dcgmi dmon.
4. **Read PyTorch's figure with care:** torch.cuda.utilization() returns the same nvidia-smi figure, so it has the same blind spot. Pair it with the SM number from DCGM when a result looks odd.
5. **Measure the outcome:** Log tokens per second and requests served from your own serving code. Those are the numbers your users and your bill feel.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] The headline GPU number is a time share: a kernel was running.
- [ ] It can read 100% while most compute blocks sit idle.
- [ ] Check SM activity, memory bandwidth and the work the GPU finishes.
- [ ] Use NVML in your own tools, and DCGM for a fleet, not parsed nvidia-smi text.
- [ ] Judge a change by tokens per second or requests served.

**Common traps**

- Trap: "Our GPUs are at 100%, so we need more GPUs." Better: Check SM activity and tokens per second first. Busy can mean waiting, and more GPUs can waste money.
- Trap: "High memory utilization means the memory is full." Better: Memory utilization is time spent reading or writing memory. Memory used is how full it is. Check which one you are reading.
- Trap: "The dashboard number is the truth." Better: It is an average over a short window, with a specific definition. Confirm what it counts before you act on it.

## Can you spot the gap?

**Spot the gap:** A colleague says the batch job shows 99% GPU utilization, so the GPUs are full. What should you check before agreeing?

A. Nothing. 99% means the GPUs are full.
B. SM activity, and whether the output rate matches the work.
C. Whether the fans run at full speed.
D. Whether the model is a bigger one.

**Answer:** B. The headline number only says a kernel was running in each window. SM activity shows how many compute blocks were busy, and the output rate shows whether the work got done. Check both before calling the GPUs full.

**Quick check:** Which reading tells you how busy the chip's compute blocks are, rather than whether any kernel ran?

A. GPU utilization
B. SM activity
C. Requests waiting in the queue
D. Model size on disk

**Answer:** B. SM activity counts the share of time warps were active across the compute blocks. The headline reading only asks whether a kernel ran. A queue and a model's file size say nothing about the compute blocks.

## Can you answer these from memory?

**Flash cards**

- **What does GPU utilization measure?** The share of time at least one kernel was running, over a short sample window.
- **Why can a GPU read 100% and still be mostly idle?** It counts time with any kernel running, not how many compute blocks are busy.
- **What is SM activity?** The share of time at least one warp was active, averaged over all compute blocks.
- **Memory utilization vs memory used?** Utilization is time spent reading or writing memory. Used is how full it is.
- **What does DCGM read?** Profiling counters from the chip, sampled once a second by default.
- **Which library should your own tools use?** NVML and its Python bindings, which NVIDIA says keep working across driver releases.

## Likely follow-up questions

- Q314 Static vs continuous batching? https://designervenkat.online/interview/ai/static-vs-continuous-batching
- Q316 TTFT vs tokens/sec vs total latency? https://designervenkat.online/interview/ai/ttft-vs-tokens-per-second-vs-latency
- Q317 The latency vs throughput trade-off? https://designervenkat.online/interview/ai/the-latency-vs-throughput-trade-off
- Q327 GPU basics: why does memory bandwidth limit decoding? https://designervenkat.online/interview/ai/gpu-basics-why-does-memory-bandwidth-limit-decoding
- Q344 What is a p95/p99 latency budget? https://designervenkat.online/interview/ai/what-is-a-p95-p99-latency-budget
- Q345 Design single-GPU inference batching. https://designervenkat.online/interview/ai/design-single-gpu-inference-batching
