Reputation: 68
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:
--query-gpu=timestamp,power.draw
Specifies that I want to probe the timestamp and the instant power--format=csv
Specifies that the output will be formatted as a .csv file-lms 1
Specifies that the GPU will be queried periodically at a 1ms interval (for such a small period sometimes it misses a beat)--filename=trace.csv
Specifies the name of the output logAnd 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:
-P
Specifies that I want to probe the instant power--csv
Specifies that the output will be formatted as a .csv fileThat 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
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