fix: make trying to apply missing hardware options on intel non-fatal

This commit is contained in:
Ilya Zlobintsev
2025-09-14 10:34:58 +03:00
parent ff17f68419
commit 59c2e4b183
380 changed files with 548 additions and 6 deletions
+27 -6
View File
@@ -13,7 +13,7 @@ use crate::{
},
};
use amdgpu_sysfs::{gpu_handle::power_profile_mode::PowerProfileModesTable, hw_mon::Temperature};
use anyhow::{anyhow, Context};
use anyhow::{anyhow, bail, Context};
use futures::future::LocalBoxFuture;
use lact_schema::{
config::GpuConfig, ClocksInfo, ClocksTable, ClockspeedStats, DeviceInfo, DeviceStats,
@@ -628,18 +628,39 @@ impl GpuController for IntelGpuController {
fn apply_config<'a>(&'a self, config: &'a GpuConfig) -> LocalBoxFuture<'a, anyhow::Result<()>> {
Box::pin(async {
if let Some(max_clock) = config.clocks_configuration.max_core_clock {
self.write_freq(FrequencyType::Max, max_clock)
.context("Could not set max clock")?;
if self.read_freq(FrequencyType::Max).is_some() {
self.write_freq(FrequencyType::Max, max_clock)
.context("Could not set max clock")?;
} else {
error!("could not apply configured maximum frequency {max_clock}, no maximum frequency file is present");
}
}
if let Some(min_clock) = config.clocks_configuration.min_core_clock {
self.write_freq(FrequencyType::Min, min_clock)
.context("Could not set min clock")?;
if self.read_freq(FrequencyType::Min).is_some() {
self.write_freq(FrequencyType::Min, min_clock)
.context("Could not set min clock")?;
} else {
error!("could not apply configured minimum frequency {min_clock}, no minimum frequency file is present");
}
}
if let Some(cap) = config.power_cap {
self.write_hwmon_file(POWER_CAP_NAMES, &((cap * 1_000_000.0) as u64).to_string())
if self.get_power_cap().is_some() {
if let Some(max_cap) = self.get_power_cap_max() {
if cap > max_cap {
bail!("Specified cap {cap} is greated than maximum allowed {max_cap}");
}
}
self.write_hwmon_file(
POWER_CAP_NAMES,
&((cap * 1_000_000.0) as u64).to_string(),
)
.context("Could not set power cap")?;
} else {
error!("could not apply power cap, no power limit functionality available");
}
}
Ok(())
@@ -0,0 +1 @@
226:1
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
0x030000
@@ -0,0 +1 @@
2.5 GT/s PCIe
@@ -0,0 +1 @@
0xe20b
@@ -0,0 +1 @@
(null)
@@ -0,0 +1 @@
1
@@ -0,0 +1,2 @@
DRIVER=pmt_crashlog
MODALIAS=auxiliary:intel_vsec.crashlog
@@ -0,0 +1,2 @@
DRIVER=pmt_telemetry
MODALIAS=auxiliary:intel_vsec.telemetry
@@ -0,0 +1 @@
74
@@ -0,0 +1 @@
ffff
@@ -0,0 +1 @@
2.5 GT/s PCIe
@@ -0,0 +1 @@
pci:v00008086d0000E20Bsv00008086sd00001100bc03sc00i00
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
-1
@@ -0,0 +1 @@
enabled

Some files were not shown because too many files have changed in this diff Show More