forked from NG-SD-Plugins/PowerTools
Unset slow memory properly, if the kernel behaved as documented
This commit is contained in:
parent
5f6370e778
commit
33c41c3e3d
1 changed files with 16 additions and 6 deletions
|
@ -182,12 +182,22 @@ impl Gpu {
|
||||||
|
|
||||||
fn set_slow_memory(&self, slow: bool) -> Result<(), SettingError> {
|
fn set_slow_memory(&self, slow: bool) -> Result<(), SettingError> {
|
||||||
let path = GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.path(&self.sysfs_card);
|
let path = GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.path(&self.sysfs_card);
|
||||||
|
if slow {
|
||||||
self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), slow as u8).map_err(|e| {
|
self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), slow as u8).map_err(|e| {
|
||||||
SettingError {
|
SettingError {
|
||||||
msg: format!("Failed to write to `{}`: {}", path.display(), e),
|
msg: format!("Failed to write to `{}`: {}", path.display(), e),
|
||||||
setting: crate::settings::SettingVariant::Gpu,
|
setting: crate::settings::SettingVariant::Gpu,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
// NOTE: there is a GPU driver/hardware bug that prevents this from working
|
||||||
|
self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), "0 1\n").map_err(|e| {
|
||||||
|
SettingError {
|
||||||
|
msg: format!("Failed to write to `{}`: {}", path.display(), e),
|
||||||
|
setting: crate::settings::SettingVariant::Gpu,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_force_performance_related(&mut self) -> Result<(), Vec<SettingError>> {
|
fn set_force_performance_related(&mut self) -> Result<(), Vec<SettingError>> {
|
||||||
|
|
Loading…
Reference in a new issue