Skip to content

Commit

Permalink
Merge pull request #275 from nokyan/amd-gpu-fix
Browse files Browse the repository at this point in the history
Try power1_input if power1_average doesn't work
  • Loading branch information
nokyan authored Jul 3, 2024
2 parents d548650 + 60694a1 commit 90d7131
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/gpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ pub trait GpuImpl {
}

fn hwmon_power_usage(&self) -> Result<f64> {
Ok(self.read_hwmon_int("power1_average")? as f64 / 1_000_000.0)
Ok(self
.read_hwmon_int("power1_average")
.or_else(|_| self.read_hwmon_int("power1_input"))? as f64
/ 1_000_000.0)
}

fn hwmon_core_frequency(&self) -> Result<f64> {
Expand Down

0 comments on commit 90d7131

Please sign in to comment.