Skip to content

Commit

Permalink
feat: rescan will now look for fans too.
Browse files Browse the repository at this point in the history
  • Loading branch information
alphastrata committed Oct 10, 2023
1 parent 50e5c16 commit c0eda36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ pub fn run(
pci_sub_system_id: Some(0),
}) {
Ok(()) => {
have_fans = gpu_list
.iter()
.any(|gpu| gpu.inner.num_fans().map_or(0, |fc| fc) != 0);

lh.debug(&format!("GPU has fans = {}", have_fans));
lh.debug("Re-scanned PCI tree");
have_fans = true;
}
Err(e @ (NvmlError::OperatingSystem | NvmlError::NoPermission)) => {
lh.debug(&format!("Failed to re-scan PCI tree: {e}"));
Expand Down

0 comments on commit c0eda36

Please sign in to comment.