Skip to content

Commit 2a0ed4f

Browse files
committed
gpu_fdinfo: fix abnormally high power usage value at first launch
1 parent bc451e0 commit 2a0ed4f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/gpu_fdinfo.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ void GPU_fdinfo::find_intel_hwmon()
144144

145145
if (!energy_stream.good())
146146
SPDLOG_DEBUG("Intel hwmon: failed to open {}", hwmon);
147+
148+
// Initialize value for the first time, otherwise delta will be very large
149+
// and your gpu power usage will be like 1 million watts for a second.
150+
this->last_power = get_current_power();
147151
}
148152

149153
float GPU_fdinfo::get_current_power()

0 commit comments

Comments
 (0)