Iago Storch
Iago Storch

Reputation: 68

How do I trace power consumption for Radeon GPUs?

I developed an OpenCL application and now I'm trying to assess the energy consumption of the same application running on two different GPUs: one NVIDIA Titan V and one Radeon RX6900 XT.

The idea is to measure the instant power of the GPU at regular intervals during the application, compute the average power at the end, and multiply the average power by the running time to obtain the energy consumption in joules.

For the NVIDIA GPU I was able to trace power using the nvidia-smi tool with the following command:

nvidia-smi --query-gpu=timestamp,power.draw --format=csv -lms 1 --filename=trace.csv

Where:

And the output log has the form of:

timestamp, power.draw [W]
2023/04/10 16:13:33.044, 40.49 W
2023/04/10 16:13:33.047, 40.49 W
2023/04/10 16:13:33.049, 40.49 W
2023/04/10 16:13:33.050, 40.49 W

Now I'm trying to obtain a similar result on the Radeon RX6900 XT. My first approach was to use the rocm-smi, and the best I could do so far is:

rocm-smi -P --csv

Where:

That produces the following output:

device,Average Graphics Package Power (W)
card0,19.0

Note that it only reports one value, which is the instant power for the moment I invoked the command. I would like rocm-smi to probe the power regularly and produce a list of timestamp,power values, but I could not find any parameters to achieve such.

Is it possible to configure rocm-smi so that it produces the desired output? Or maybe there is another way of measuring the energy consumption of Radeon GPUs?

PS: I don't have physical access to the devices to conduct any "hands-on" method directly on the boards.

Upvotes: 0

Views: 857

Answers (1)

Tommi Nieminen
Tommi Nieminen

Reputation: 1

rocm-smi has a --showenergycounter option that you should be able to use to track energy consumption. Just run the rocm-smi at the start to get the initial counter value, and then deduct it from the counter value at the end of execution.

Upvotes: 0

Related Questions