How to Capture GPU Telemetry for Local AI Models
In this article
To capture GPU telemetry while running local AI models, you need a monitoring tool that samples your GPU's sensors (utilization, memory, temperature, power) at a fixed interval and writes the samples to a log or dashboard. The shortest working setup on Windows or Linux is to run nvidia-smi in a loop with its query and logging flags, or to launch a dedicated monitor such as GPU-Z, HWMonitor, or a Prometheus exporter alongside your model. The key is to start the logger before you load the model, keep the sampling interval short enough to catch spikes, and store the output somewhere you can compare runs. This guide covers the practical steps, the tools that actually expose these counters, and the mistakes that make telemetry useless.
What You'll Need
- A GPU with vendor drivers installed (NVIDIA, AMD, or Intel) and a working local AI runtime (Ollama, LM Studio, llama.cpp, PyTorch, etc.).
- Vendor monitoring utilities:
nvidia-smiships with NVIDIA drivers; AMD users can userocm-smior the Adrenalin overlay; Intel users can useintel_gpu_topon Linux. - A logging destination: a CSV file, a terminal session you can copy, or a time-series database if you want dashboards.
- Optional: a spreadsheet or plotting tool to compare runs, and a consistent test prompt so runs are comparable.
Step-by-Step
- Confirm the GPU is visible. Open a terminal (Command Prompt or PowerShell on Windows, Terminal on Linux) and run
nvidia-smifor NVIDIA,rocm-smifor AMD, or check Task Manager > Performance > GPU on Windows. You should see the adapter name, driver version, and current utilization. If the GPU is missing here, fix drivers before logging anything. - Pick the metrics that matter. For local AI workloads the useful counters are GPU utilization %, memory used vs. total, memory bandwidth (if exposed), temperature, power draw, and fan speed. Utilization alone is misleading because a model can be memory-bound; always log memory used alongside it.
- Choose a sampling interval. One sample per second is a good default. Faster than that creates huge files with little extra insight; slower than five seconds can miss short bursts during prompt processing. Keep the interval fixed across runs so comparisons are fair.
- Start logging before loading the model. Launch your logger first so you capture the load spike, then start the model, then send your test prompt. Stop logging only after the model has finished generating and the GPU has returned to idle. This gives you a clean baseline, load, inference, and cooldown phase in one file.
- Log with nvidia-smi (NVIDIA). In a terminal, run a loop that appends CSV rows. On Linux or macOS with NVIDIA, a shell loop calling
nvidia-smi --query-gpu=timestamp,utilization.gpu,memory.used,memory.total,temperature.gpu,power.draw --format=csv -l 1writes a row every second. On Windows PowerShell, you can run the same command without the shell loop; the-l 1flag handles repetition. Redirect output to a file with> telemetry.csv. - Log with a GUI tool (any vendor). Open GPU-Z (Windows) and enable its Sensors tab logging to a file; it records GPU load, memory used, temperature, and power. HWMonitor and HWiNFO also log sensors. On Linux,
nvidia-smi dmongives a compact rolling display you can tee to a file, andintel_gpu_topcovers Intel iGPUs. - Capture per-process usage. If other apps share the GPU, log per-process memory with
nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv. This tells you whether your model or a browser tab is eating VRAM. On Windows, Task Manager's Details tab sorted by GPU memory is a quick cross-check. - Run a repeatable test. Use the same prompt, the same context length, and the same quantization for every run. Record the model name, quantization, context size, and batch settings in a note next to the log file. Without these labels the numbers cannot be compared later.
- Stop and inspect the log. Open the CSV in a spreadsheet. Look for the load spike (memory jumps), steady-state inference (utilization oscillates, memory flat), and the drop when generation ends. If memory never drops, the runtime is caching the model; that is normal but should be noted.
- Store and compare runs. Keep one folder per experiment with the log, the prompt, and the settings. When you change quantization or context size, rerun and compare memory used and tokens per second side by side.
Common Mistakes
- Starting the logger after the model loads. You miss the VRAM allocation spike, which is often the most important number for deciding whether a model fits.
- Logging only utilization. A memory-bound model can show low utilization while being slow; memory used and bandwidth tell the real story.
- Changing multiple variables between runs. If you change quantization and context length at once, you cannot tell which caused the difference.
- Ignoring other GPU consumers. A browser with hardware acceleration or a game overlay can skew results. Close them or log per-process memory to prove they are idle.
- Using an interval that is too long. Five- or ten-second sampling can miss short prompt-processing bursts and make the model look idle.
Tips
- Keep a fixed test prompt of known length so tokens-per-second numbers are comparable across runs.
- Log the timestamp in ISO format so files from different sessions merge cleanly.
- If you use a dashboard, a Prometheus node exporter plus Grafana gives live graphs, but a CSV is enough for most local testing.
- Watch temperature and power alongside speed; a thermally throttled GPU can look like a slow model.
- Note the driver version in your log folder; driver updates can change reported counters.
Troubleshooting
- nvidia-smi says no devices found. Reinstall or update the NVIDIA driver, and on Linux check that the kernel module is loaded. Do not proceed until the GPU appears.
- Log file is empty. Check that you redirected output correctly and that the query flags are supported by your driver version. Run the command once without redirection to see errors.
- Memory used does not match the model size. The runtime may be using system RAM offload or a different quantization than you think. Check the runtime's logs and settings.
- Utilization spikes to 100% but tokens are slow. The model is likely memory-bandwidth-bound or spilling to system RAM. Reduce context size or use a smaller quantization.
- Numbers differ wildly between runs. Background apps, thermal throttling, or power limits are the usual causes. Close other GPU users and let the GPU cool between runs.
Frequently Asked Questions
Can I capture GPU telemetry without installing extra software?
Yes on NVIDIA: nvidia-smi ships with the driver and can log to CSV with its query and loop flags. AMD and Intel users generally need rocm-smi or intel_gpu_top, which are separate packages on Linux.
What sampling interval should I use?
One second is a good default. It captures load spikes and steady-state behavior without creating enormous files. Use the same interval for every run you plan to compare.
Why does GPU utilization stay low during inference?
Local LLM inference is often memory-bandwidth-bound, so the compute units wait on memory. Low utilization with high memory use and slow tokens is expected; check memory used and bandwidth rather than utilization alone.
Can I monitor an integrated GPU?
Yes, but tools differ. On Windows, Task Manager > Performance > GPU shows basic counters. On Linux, intel_gpu_top covers Intel iGPUs. Integrated GPUs share system RAM, so memory numbers are less precise.
Does logging telemetry slow down the model?
The overhead is small at one-second intervals, but very frequent queries or heavy dashboard exporters can add measurable load. If tokens per second matter, log at a modest interval and keep the logger lightweight.
How do I know if the model fits in VRAM?
Compare peak memory used during load and inference against total VRAM. If memory used approaches the total and the runtime reports offloading, the model is spilling to system RAM and will be slower.