Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove temperature smoothing
  • Loading branch information
filippor committed Nov 14, 2025
commit ef9691f6b50b3b1627c200ca2995a5970970e1a2
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ edition = "2024"
libdrm_amdgpu_sys = "0.8.8"
toml = "0.9.5"
watch = "0.2.3"
ta = "0.5.0"

12 changes: 4 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use std::{

use libdrm_amdgpu_sys::{AMDGPU::DeviceHandle, PCI::BUS_INFO};
use toml::Table;
use ta::indicators::ExponentialMovingAverage;
use ta::Next;


// cyan_skillfish.gfx1013.mmGRBM_STATUS
const GRBM_STATUS_REG: u32 = 0x2004;
Expand Down Expand Up @@ -43,7 +42,6 @@ struct GPUReader {
samples: u64,
min_freq : u16,
max_freq : u16,
thermal_sensor_ema: ExponentialMovingAverage,
}

struct GPUWriter {
Expand All @@ -60,7 +58,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {


let temp_check_period = config.adjustment_interval * 10;
let mut gpu = GPU::new(safe_points,(temp_check_period.as_micros() / config.adjustment_interval.as_micros()) as usize)?;
let mut gpu = GPU::new(safe_points)?;

let (send, mut recv) = watch::channel(gpu.reader.min_freq);

Expand Down Expand Up @@ -161,8 +159,7 @@ impl GPUReader{
let temp = self.dev_handle
.sensor_info(libdrm_amdgpu_sys::AMDGPU::SENSOR_INFO::SENSOR_TYPE::GPU_TEMP)
.map_err(IoError::from_raw_os_error)?;
let temp_c = (temp/1000) as f64;
Ok(self.thermal_sensor_ema.next(temp_c).round() as u32)
Ok((temp/1000) as u32)

}
}
Expand Down Expand Up @@ -595,7 +592,7 @@ fn parse_config(path : Result<String,std::io::Error>) -> Result<(Config, BTreeMa
}

impl GPU{
fn new (safe_points: BTreeMap<u16, u16>,temp_smoothing_period: usize) -> Result<GPU, Box<dyn std::error::Error>>{
fn new (safe_points: BTreeMap<u16, u16>) -> Result<GPU, Box<dyn std::error::Error>>{

let location = BUS_INFO {
domain: 0,
Expand Down Expand Up @@ -645,7 +642,6 @@ impl GPU{
samples: 0,
min_freq:min_freq,
max_freq:max_freq,
thermal_sensor_ema: ExponentialMovingAverage::new(temp_smoothing_period)?,
},
writer: GPUWriter {
pp_file: pp_file,
Expand Down