feat: show if resizeable bar is enabled

This commit is contained in:
Ilya Zlobintsev
2023-10-21 17:38:32 +03:00
parent 0107065364
commit d93f134f35
11 changed files with 34 additions and 15 deletions

12
Cargo.lock generated
View File

@@ -1150,7 +1150,7 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "lact"
version = "0.4.5"
version = "0.4.6"
dependencies = [
"anyhow",
"lact-cli",
@@ -1161,7 +1161,7 @@ dependencies = [
[[package]]
name = "lact-cli"
version = "0.4.5"
version = "0.4.6"
dependencies = [
"anyhow",
"lact-client",
@@ -1170,7 +1170,7 @@ dependencies = [
[[package]]
name = "lact-client"
version = "0.4.5"
version = "0.4.6"
dependencies = [
"anyhow",
"lact-schema",
@@ -1182,7 +1182,7 @@ dependencies = [
[[package]]
name = "lact-daemon"
version = "0.4.5"
version = "0.4.6"
dependencies = [
"anyhow",
"bincode",
@@ -1204,7 +1204,7 @@ dependencies = [
[[package]]
name = "lact-gui"
version = "0.4.5"
version = "0.4.6"
dependencies = [
"anyhow",
"gtk4",
@@ -1218,7 +1218,7 @@ dependencies = [
[[package]]
name = "lact-schema"
version = "0.4.5"
version = "0.4.6"
dependencies = [
"amdgpu-sysfs",
"clap",

View File

@@ -1,6 +1,6 @@
[package]
name = "lact-cli"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
[dependencies]

View File

@@ -1,6 +1,6 @@
[package]
name = "lact-client"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
[dependencies]

View File

@@ -1,6 +1,6 @@
[package]
name = "lact-daemon"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
[features]

View File

@@ -197,6 +197,7 @@ impl GpuController {
drm_handle
.and_then(|handle| handle.memory_info().ok())
.map(|memory_info| DrmMemoryInfo {
resizeable_bar: memory_info.check_resizable_bar(),
cpu_accessible_used: memory_info.cpu_accessible_vram.heap_usage,
cpu_accessible_total: memory_info.cpu_accessible_vram.total_heap_size,
});
@@ -211,7 +212,9 @@ impl GpuController {
vram_type: drm_info.get_vram_type().to_string(),
vram_bit_width: drm_info.vram_bit_width,
vram_max_bw: drm_info.peak_memory_bw_gb().to_string(),
l1_cache_per_cu: drm_info.get_l1_cache_size(),
l2_cache: drm_info.calc_l2_cache_size(),
l3_cache_mb: drm_info.calc_l3_cache_size_mb(),
memory_info: drm_memory_info,
})
}

View File

@@ -1,6 +1,6 @@
[package]
name = "lact-gui"
version = "0.4.5"
version = "0.4.6"
authors = ["Ilya Zlobintsev <ilya.zl@protonmail.com>"]
edition = "2021"

View File

@@ -20,6 +20,7 @@ pub struct InformationPage {
vram_type_label: Label,
vram_peak_bw_label: Label,
compute_units_label: Label,
resizable_bar_enabled: Label,
cpu_accessible_vram_label: Label,
link_speed_label: Label,
vulkan_info_frame: VulkanInfoFrame,
@@ -48,9 +49,10 @@ impl InformationPage {
let vram_size_label = label_row("VRAM Size:", &values_grid, 7, 0, true);
let vram_type_label = label_row("VRAM Type:", &values_grid, 8, 0, true);
let vram_peak_bw_label = label_row("Peak VRAM Bandwidth:", &values_grid, 9, 0, true);
let resizable_bar_enabled = label_row("Resizeable BAR:", &values_grid, 10, 0, true);
let cpu_accessible_vram_label =
label_row("CPU Accessible VRAM:", &values_grid, 10, 0, true);
let link_speed_label = label_row("Link Speed:", &values_grid, 11, 0, true);
label_row("CPU Accessible VRAM:", &values_grid, 11, 0, true);
let link_speed_label = label_row("Link Speed:", &values_grid, 12, 0, true);
info_container.append(&values_grid);
vbox.append(&info_container);
@@ -88,6 +90,7 @@ impl InformationPage {
family_name,
asic_name,
vram_type_label,
resizable_bar_enabled,
cpu_accessible_vram_label,
compute_units_label,
vram_peak_bw_label,
@@ -130,6 +133,8 @@ impl InformationPage {
let mut vram_type = "Unknown";
let mut vram_max_bw = "Unknown";
let mut cpu_accessible_vram = "Unknown".to_owned();
let mut resizeable_bar_enabled = "Unknown";
if let Some(drm_info) = &gpu_info.drm_info {
family_name = &drm_info.family_name;
asic_name = &drm_info.asic_name;
@@ -138,6 +143,12 @@ impl InformationPage {
vram_max_bw = &drm_info.vram_max_bw;
if let Some(memory_info) = &drm_info.memory_info {
resizeable_bar_enabled = if memory_info.resizeable_bar {
"Enabled"
} else {
"Disabled"
};
cpu_accessible_vram = (memory_info.cpu_accessible_total / 1024 / 1024).to_string();
}
}
@@ -152,6 +163,8 @@ impl InformationPage {
self.vram_peak_bw_label
.set_markup(&format!("<b>{vram_max_bw} GiB/s</b>"));
self.resizable_bar_enabled
.set_markup(&format!("<b>{resizeable_bar_enabled}</b>"));
self.cpu_accessible_vram_label
.set_markup(&format!("<b>{cpu_accessible_vram} MiB</b>"));

View File

@@ -1,6 +1,6 @@
[package]
name = "lact-schema"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
[features]

View File

@@ -102,7 +102,9 @@ pub struct DrmInfo {
pub vram_type: String,
pub vram_bit_width: u32,
pub vram_max_bw: String,
pub l1_cache_per_cu: u32,
pub l2_cache: u32,
pub l3_cache_mb: u32,
pub memory_info: Option<DrmMemoryInfo>,
}
@@ -110,6 +112,7 @@ pub struct DrmInfo {
pub struct DrmMemoryInfo {
pub cpu_accessible_used: u64,
pub cpu_accessible_total: u64,
pub resizeable_bar: bool,
}
#[derive(Serialize, Deserialize, Default, Debug, Clone)]

View File

@@ -1,6 +1,6 @@
[package]
name = "lact"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
[features]

View File

@@ -3,7 +3,7 @@ metadata:
description: AMDGPU control utility
arch: x86_64
license: MIT
version: 0.4.5
version: 0.4.6
maintainer: ilya-zlobintsev
url: https://github.com/ilya-zlobintsev/lact
source: