powerapi-ng / pyJoules

A Python library to capture the energy consumption of code snippets
MIT License
70 stars 10 forks source link

Energy consumption for GPU does not seem to be in microJoules? #23

Open johannabar opened 2 years ago

johannabar commented 2 years ago

Hi, thanks for building this library!

I see in the docs and from the issue #6 that the energy consumption is supposed to be in uJ (1e-6J), but this doesn't seem to match for the GPU output. It seems that I am getting the output in mJ (1e-3J) instead.

With an NVidia Titan RTX machine that consumes 16Watt when idle and 280Watt when fully active, we should use for 60seconds respectively 16*60=960 Joules (idle) and 280*60=16,800 Joules (active). But PyJoules is measuring 952,494 uJ = 0.95 Joules (idle) and 16,522,288 uJ = 16.52 Joules (active).

Could you confirm the metrics used for nvidia_gpu outputs?

Thanks in advance, Johanna

Xyfuture commented 2 years ago

I think you are right,I use RTX2080 get the same result. Use nvidia-msi I saw power about 200w, runing 6 seconds , pyJoules tells energy:1245978

rvandernoort commented 1 year ago

According to the nvml docs it is indeed mJ instead of uJ image

Maybe a good idea to add to the docs since I had to search in pyRAPL and pyNVML docs and this is nowhere mentioned.