diff --git a/Cargo.lock b/Cargo.lock index 1af78fe..3876f7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "amdfand" -version = "1.0.6" +version = "1.0.7" dependencies = [ "amdgpu", "gumdrop", @@ -26,7 +26,7 @@ dependencies = [ [[package]] name = "amdgpu" -version = "1.0.6" +version = "1.0.7" dependencies = [ "gumdrop", "log", @@ -38,7 +38,7 @@ dependencies = [ [[package]] name = "amdvold" -version = "1.0.6" +version = "1.0.7" dependencies = [ "amdgpu", "gumdrop", diff --git a/README.md b/README.md index 932ba06..a9b48f2 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,17 @@ temp = 80.0 speed = 100.0 ``` +## Roadmap + +* [ ] Write metrics +* [ ] Add support for multiple cards + * Multiple services must recognize card even if there's multiple same version cards is installed + * Support should be by using `--config` option +* [ ] CLI for fan config edit +* [ ] CLI for voltage edit +* [ ] GUI application using native Rust framework (ex. egui, druid) + ## :bookmark: License This work is dual-licensed under Apache 2.0 and MIT. You can choose between one of them if you use this work. - -`SPDX-License-Identifier: Apache-2.0 OR MIT` diff --git a/amdfand/Cargo.toml b/amdfand/Cargo.toml index 37854dd..8ad1431 100644 --- a/amdfand/Cargo.toml +++ b/amdfand/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "amdfand" -version = "1.0.6" +version = "1.0.7" edition = "2018" description = "AMDGPU fan control service" license = "MIT OR Apache-2.0" @@ -9,7 +9,7 @@ categories = ["hardware-support"] repository = "https://github.com/Eraden/amdgpud" [dependencies] -amdgpu = { path = "../amdgpu", version = "1.0.6" } +amdgpu = { path = "../amdgpu", version = "1.0.7" } serde = { version = "1.0.126", features = ["derive"] } toml = { version = "0.5.8" } diff --git a/amdfand/src/main.rs b/amdfand/src/main.rs index b5f4098..9cb5d73 100644 --- a/amdfand/src/main.rs +++ b/amdfand/src/main.rs @@ -86,6 +86,7 @@ fn setup() -> Result<(String, Config)> { .config .unwrap_or_else(|| DEFAULT_CONFIG_PATH.to_string()); let config = load_config(&config_path)?; + log::info!("{:?}", config); log::set_max_level(config.log_level().as_str().parse().unwrap()); Ok((config_path, config)) } diff --git a/amdgpu/Cargo.toml b/amdgpu/Cargo.toml index b2523ad..4028b93 100644 --- a/amdgpu/Cargo.toml +++ b/amdgpu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "amdgpu" -version = "1.0.6" +version = "1.0.7" edition = "2018" description = "Subcomponent of AMDGPU fan control service" license = "MIT OR Apache-2.0" diff --git a/amdgpu/src/hw_mon.rs b/amdgpu/src/hw_mon.rs index b1fb5a7..b730902 100644 --- a/amdgpu/src/hw_mon.rs +++ b/amdgpu/src/hw_mon.rs @@ -59,7 +59,7 @@ impl HwMon { } pub fn mon_dir(&self) -> std::path::PathBuf { - self.device_dir().join(&*self.name) + self.device_dir().join("hwmon").join(&*self.name) } #[inline] diff --git a/amdgpu/src/utils.rs b/amdgpu/src/utils.rs index 03785ba..7398c91 100644 --- a/amdgpu/src/utils.rs +++ b/amdgpu/src/utils.rs @@ -22,8 +22,22 @@ pub fn read_cards() -> std::io::Result> { pub fn hw_mons(filter: bool) -> std::io::Result> { Ok(read_cards()? .into_iter() - .filter_map(|card| hw_mon::open_hw_mon(card).ok()) - .filter(|hw_mon| !filter || { hw_mon.is_amd() }) - .filter(|hw_mon| !filter || hw_mon.name_is_amd()) + .map(|card| { + log::info!("opening hw mon for {:?}", card); + hw_mon::open_hw_mon(card) + }) + .flatten() + .filter(|hw_mon| { + !filter || { + log::info!("is vendor ok? {}", hw_mon.is_amd()); + hw_mon.is_amd() + } + }) + .filter(|hw_mon| { + !filter || { + log::info!("is hwmon name ok? {}", hw_mon.name_is_amd()); + hw_mon.name_is_amd() + } + }) .collect()) } diff --git a/amdvold/Cargo.toml b/amdvold/Cargo.toml index 726e51d..1ae32e1 100644 --- a/amdvold/Cargo.toml +++ b/amdvold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "amdvold" -version = "1.0.6" +version = "1.0.7" edition = "2018" description = "AMDGPU fan control service" license = "MIT OR Apache-2.0" @@ -9,7 +9,7 @@ categories = ["hardware-support"] repository = "https://github.com/Eraden/amdgpud" [dependencies] -amdgpu = { path = "../amdgpu", version = "1.0.6" } +amdgpu = { path = "../amdgpu", version = "1.0.7" } serde = { version = "1.0.126", features = ["derive"] } toml = { version = "0.5.8" } diff --git a/examples/verbose_config.toml b/examples/verbose_config.toml new file mode 100644 index 0000000..b5f1a1d --- /dev/null +++ b/examples/verbose_config.toml @@ -0,0 +1,34 @@ +log_level = "Info" +temp_input = "temp1_input" + +[[speed_matrix]] +temp = 4.0 +speed = 4.0 + +[[speed_matrix]] +temp = 30.0 +speed = 33.0 + +[[speed_matrix]] +temp = 45.0 +speed = 50.0 + +[[speed_matrix]] +temp = 60.0 +speed = 66.0 + +[[speed_matrix]] +temp = 65.0 +speed = 69.0 + +[[speed_matrix]] +temp = 70.0 +speed = 75.0 + +[[speed_matrix]] +temp = 75.0 +speed = 89.0 + +[[speed_matrix]] +temp = 80.0 +speed = 100.0 \ No newline at end of file