Skip to content

Commit

Permalink
GPU fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jul 15, 2024
1 parent 825126e commit ce3c90b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 7 deletions.
48 changes: 47 additions & 1 deletion 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 platforms/interface/ui/pages/home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
</div>
<h2>GPU Memory Usage</h2>
</div>
<h3>GPU memory: {`${$hardwareInfo.gpu.memory[0].value.toFixed(1)}/${$hardwareInfo.gpu.memory[2].value} GB`} GB</h3>
<h3>GPU memory: {`${$hardwareInfo.gpu.memory[0].value.toFixed(1)}/${$hardwareInfo.gpu.memory[2].value}`} GB</h3>
<div>
<MeterChart
readings={[$hardwareInfo.gpu.memory[0]]}
Expand Down
2 changes: 1 addition & 1 deletion platforms/interface/web/src/components/appHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
$state.message = JSON.stringify({
type: "power",
type,
data: type,
})
}
Expand Down
8 changes: 4 additions & 4 deletions platforms/unix/hardwareinfo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,21 +351,21 @@ pub fn refresh_hardware_info(data: &mut Data) {
data.hw_info.gpu.memory.push(CoresSensor::default());
data.hw_info.gpu.memory.push(CoresSensor::default());

data.hw_info.gpu.load.push(CoresSensor {
data.hw_info.gpu.memory.push(CoresSensor {
name: "GPU Memory Total".to_string(),
value: memory.total as f64 / gb,
min: memory.total as f64 / gb,
max: memory.total as f64 / gb,
});

data.hw_info.gpu.load.push(CoresSensor {
data.hw_info.gpu.memory.push(CoresSensor {
name: "GPU Memory Free".to_string(),
value: memory.free as f64 / gb,
min: memory.free as f64 / gb,
max: memory.free as f64 / gb,
});

data.hw_info.gpu.load.push(CoresSensor {
data.hw_info.gpu.memory.push(CoresSensor {
name: "GPU Memory Used".to_string(),
value: memory.used as f64 / gb,
min: memory.used as f64 / gb,
Expand All @@ -386,7 +386,7 @@ pub fn refresh_hardware_info(data: &mut Data) {
max: mem_clock as f64,
});
} else {
// TODO: Update sensors
data.hw_info.gpu.max_load = gpu_usage.gpu as f64;
}
}
Err(err) => {
Expand Down

0 comments on commit ce3c90b

Please sign in to comment.