Skip to content

Commit aff0580

Browse files
fix: make failing to apply amd clock settings with missing clocks table a non-critical error
1 parent 1c0adf5 commit aff0580

File tree

1 file changed

+30
-27
lines changed
  • lact-daemon/src/server/gpu_controller

1 file changed

+30
-27
lines changed

lact-daemon/src/server/gpu_controller/amd.rs

+30-27
Original file line numberDiff line numberDiff line change
@@ -779,34 +779,37 @@ impl GpuController for AmdGpuController {
779779
}
780780

781781
if config.is_core_clocks_used() {
782-
let original_table = self
783-
.handle
784-
.get_clocks_table()
785-
.context("Failed to get clocks table")?;
786-
let mut table = original_table.clone();
787-
config
788-
.clocks_configuration
789-
.apply_to_table(&mut table)
790-
.context("Failed to apply clocks configuration to table")?;
791-
792-
debug!(
793-
"writing clocks commands: {:#?}",
794-
table
795-
.get_commands(&original_table)
796-
.context("Failed to get table commands")?
797-
);
782+
match self.handle.get_clocks_table() {
783+
Ok(original_table) => {
784+
let mut table = original_table.clone();
785+
config
786+
.clocks_configuration
787+
.apply_to_table(&mut table)
788+
.context("Failed to apply clocks configuration to table")?;
789+
790+
debug!(
791+
"writing clocks commands: {:#?}",
792+
table
793+
.get_commands(&original_table)
794+
.context("Failed to get table commands")?
795+
);
798796

799-
let handle = self
800-
.handle
801-
.set_clocks_table(&table)
802-
.context("Could not write clocks table")
803-
.with_context(|| {
804-
format!(
805-
"Clocks table commands: {:?}",
806-
table.get_commands(&original_table)
807-
)
808-
})?;
809-
commit_handles.push(handle);
797+
let handle = self
798+
.handle
799+
.set_clocks_table(&table)
800+
.context("Could not write clocks table")
801+
.with_context(|| {
802+
format!(
803+
"Clocks table commands: {:?}",
804+
table.get_commands(&original_table)
805+
)
806+
})?;
807+
commit_handles.push(handle);
808+
}
809+
Err(err) => {
810+
error!("custom clock settings are present but will be ignored, but could not get clocks table: {err}");
811+
}
812+
}
810813
}
811814

812815
if let Some(level) = config.performance_level {

0 commit comments

Comments
 (0)