mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
fix: gracefully handle transient fan control errors
This commit is contained in:
12
Cargo.lock
generated
12
Cargo.lock
generated
@@ -1585,7 +1585,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lact-cli",
|
||||
@@ -1596,7 +1596,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-cli"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lact-client",
|
||||
@@ -1605,7 +1605,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-client"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
@@ -1618,7 +1618,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-daemon"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
@@ -1646,7 +1646,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-gui"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
@@ -1668,7 +1668,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-schema"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-cli"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-client"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-daemon"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -35,7 +35,7 @@ use tokio::{
|
||||
task::JoinHandle,
|
||||
time::{sleep, timeout},
|
||||
};
|
||||
use tracing::{debug, error, trace, warn};
|
||||
use tracing::{debug, error, info, trace, warn};
|
||||
#[cfg(feature = "libdrm_amdgpu_sys")]
|
||||
use {
|
||||
lact_schema::DrmMemoryInfo,
|
||||
@@ -470,6 +470,9 @@ impl GpuController {
|
||||
let mut last_pwm = (None, Instant::now());
|
||||
let mut last_temp = 0.0;
|
||||
|
||||
// If the fan speed could was able to be set at least once
|
||||
let mut control_available = false;
|
||||
|
||||
let temp_key = settings.temperature_key.clone();
|
||||
let interval = Duration::from_millis(settings.interval_ms);
|
||||
let spindown_delay = Duration::from_millis(settings.spindown_delay_ms.unwrap_or(0));
|
||||
@@ -513,9 +516,17 @@ impl GpuController {
|
||||
|
||||
trace!("fan control tick: setting pwm to {target_pwm}");
|
||||
|
||||
if let Err(err) = hw_mon.set_fan_pwm(target_pwm) {
|
||||
error!("could not set fan speed: {err}, disabling fan control");
|
||||
break;
|
||||
match hw_mon.set_fan_pwm(target_pwm) {
|
||||
Ok(()) => control_available = true,
|
||||
Err(err) => {
|
||||
error!("could not set fan speed: {err}");
|
||||
if control_available {
|
||||
info!("fan control was previously available, assuming the error is temporary");
|
||||
} else {
|
||||
info!("disabling fan control");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
debug!("exited fan control task");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-gui"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
authors = ["Ilya Zlobintsev <ilya.zl@protonmail.com>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-schema"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -3,7 +3,7 @@ metadata:
|
||||
description: AMDGPU control utility
|
||||
arch: x86_64
|
||||
license: MIT
|
||||
version: 0.5.4
|
||||
version: 0.5.5
|
||||
maintainer: ilya-zlobintsev
|
||||
url: https://github.com/ilya-zlobintsev/lact
|
||||
source:
|
||||
|
||||
@@ -3,7 +3,7 @@ metadata:
|
||||
description: AMDGPU control utility
|
||||
arch: x86_64
|
||||
license: MIT
|
||||
version: 0.5.4
|
||||
version: 0.5.5
|
||||
maintainer: ilya-zlobintsev
|
||||
url: https://github.com/ilya-zlobintsev/lact
|
||||
source:
|
||||
|
||||
@@ -3,7 +3,7 @@ metadata:
|
||||
description: AMDGPU control utility
|
||||
arch: x86_64
|
||||
license: MIT
|
||||
version: 0.5.4
|
||||
version: 0.5.5
|
||||
maintainer: ilya-zlobintsev
|
||||
url: https://github.com/ilya-zlobintsev/lact
|
||||
source:
|
||||
|
||||
Reference in New Issue
Block a user