Power measurement with nvidia-smi

Hi All,

I want to measure the power consumption of an application on ubuntu which finishes in just 250 ms on Quadro P4000.
F this I start nvidia-smi in the background and run the app on forground.

Content of my power_measure.sh file:
nvidia-smi --query-gpu=power.draw --format=csv --loop-ms=10

Now I issue the command:
#./power_measure.sh & ./myapp

If I use high-resolution measurement i.e. --loop-ms is 5 to 50 ms then myapp does not gets a chance to run.
If I use lower resolution say 150 ms then I do not get prints for power between myapp print logs.

How do I use nvidia-smi for this. Thank you.


Inside your app, run your workload in a loop, over and over. This will increase the runtime. Then you should be able to use nvidia-smi with a reasonable sampling period.