# How do I measure the energy AI uses on my own computer or GPU?

> Measure local AI energy with hardware counters, GPU telemetry or a plug-in meter, sample over the whole job, and subtract the idle baseline.

Source: https://greenai.guide/how-do-i/measure-energy-of-ai-on-my-own-computer/  
Updated: 2026-11-19

## 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

1. Measure the idle power of the machine before you start.
2. Run the AI task with CodeCarbon, a counter-based tool or a metering smart plug recording throughout.
3. Sample GPU power for the whole job and integrate it over time.
4. Repeat the run several times and report the mean and range.
5. 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](/how-do-i/find-grid-carbon-intensity-data/). The
full method is in [how to measure AI energy](/practice/measure-ai-energy/).

## Sources

- [Part-time power measurements: nvidia-smi's lack of attention](https://arxiv.org/abs/2312.02741), Yang et al. (arXiv 2312.02741) (2023)
- [CodeCarbon](https://codecarbon.io/), CodeCarbon (2026)
- [When to use CodeCarbon](https://docs.codecarbon.io/latest/explanation/when-to-use/), CodeCarbon (2025)
