Skip to content

Commit

Permalink
Fix GPU usage data obtained from the GPU itself being divided by 100 …
Browse files Browse the repository at this point in the history
…once too often
  • Loading branch information
nokyan committed Dec 4, 2024
1 parent 131369f commit 58c3d85
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/utils/gpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,11 @@ impl GpuData {
pub fn new(gpu: &Gpu) -> Self {
let pci_slot = gpu.pci_slot();

let usage_fraction = gpu
.usage()
.map(|usage| (usage / 100.0).clamp(0.0, 1.0))
.ok();

let encode_fraction = gpu
.encode_usage()
.map(|usage| (usage / 100.0).clamp(0.0, 1.0))
.ok();

let decode_fraction = gpu
.decode_usage()
.map(|usage| (usage / 100.0).clamp(0.0, 1.0))
.ok();
let usage_fraction = gpu.usage().map(|usage| usage.clamp(0.0, 1.0)).ok();

let encode_fraction = gpu.encode_usage().map(|usage| usage.clamp(0.0, 1.0)).ok();

let decode_fraction = gpu.decode_usage().map(|usage| usage.clamp(0.0, 1.0)).ok();

let total_vram = gpu.total_vram().ok();
let used_vram = gpu.used_vram().ok();
Expand Down

0 comments on commit 58c3d85

Please sign in to comment.