In short
On your own machine you can measure directly: use CodeCarbon or a power tool that reads processor and GPU counters, or put a metering smart plug between the computer and the wall. Record the idle baseline first, sample for the whole job rather than taking snapshots, and repeat the run a few times before trusting the number.
Steps
- Measure the idle power of the machine before you start.
- Run the AI task with CodeCarbon, a counter-based tool or a metering smart plug recording throughout.
- Sample GPU power for the whole job and integrate it over time.
- Repeat the run several times and report the mean and range.
- Check a software meter against a wall-plug meter once per machine.
Hardware you own can be metered, which beats any estimate. It is the best way to see what a local model, a fine-tuning run or an AI coding tool really draws on your machine.
Which tools can I use?
| Option | What it reads | Good for |
|---|---|---|
| Metering smart plug | Whole machine at the wall | Anyone; checks other tools |
| CodeCarbon | Processor, GPU and memory power, plus grid carbon | Python scripts, training and local inference |
| Processor counters (RAPL on many Intel and AMD chips) | CPU and memory energy | Linux tools such as perf, Scaphandre, PowerJoular |
GPU telemetry (nvidia-smi, NVML) |
GPU power | Model training and inference on NVIDIA cards |
Why sample over time?
GPU readings are sampled, not continuous. Yang and colleagues found that on A100 and H100 GPUs, nvidia-smi
samples only about 25% of the runtime for power, which can badly mislead for short jobs. Log readings throughout
the job, run long enough to cover many sampling intervals, and add them up over time.
Common mistakes
- Forgetting the idle baseline. A desktop draws power doing nothing; subtract it to see what the AI adds.
- Measuring once. Temperature, background tasks and frequency scaling change readings. Repeat and give a range.
- Comparing only speed. Faster and lower-energy often go together, but not always. Report both.
To turn the energy into carbon, see finding grid carbon intensity. The full method is in how to measure AI energy.
Sources
- Part-time power measurements: nvidia-smi's lack of attention, Yang et al. (arXiv 2312.02741) (2023)
- CodeCarbon, CodeCarbon (2026)
- When to use CodeCarbon, CodeCarbon (2025)
Related
How do I run an AI model locally?
How to run an open AI model on your own laptop or server with tools like Ollama or llama.cpp, choose a quantised model that fits, and measure its energy.
How do I measure the carbon footprint of training a model?
Track the energy of a training run with a tool such as CodeCarbon, multiply by local grid carbon intensity, and report hardware, time and location.
How do I set a baseline to prove AI energy savings?
Show a real AI energy saving: measure before any change on the same set-up and load, repeat runs, report per unit of work, and check quality held.
How to measure the energy and carbon of AI
A practical guide to metering or estimating the energy and carbon of AI work: tools, system boundaries, per-task metrics and honest uncertainty.