greenai.guide

Home › How do I…? › How do I measure the energy AI uses on my own computer or GPU?

How do I…?

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

Updated · 1 min read

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. The full method is in how to measure AI energy.

Sources

  1. Part-time power measurements: nvidia-smi's lack of attention, Yang et al. (arXiv 2312.02741) (2023)
  2. CodeCarbon, CodeCarbon (2026)
  3. When to use CodeCarbon, CodeCarbon (2025)

Join us

Help cut AI's impact on the planet

Get new guides, funding calls and directory listings by email, about once a month. Or add your product, course, PhD or research to the directories.

No tracking. Unsubscribe in one click. Other ways to join · Privacy