feat: UMA carveout daemon option

This commit is contained in:
Ilya Zlobintsev committed 2026-09-27 19:11:42 +03:00
1 parent c55a6ebe13
commit 3154da7eef
12 files changed
+85 -23

No files matched your search

Generated
+1 -2
View File
@@ -31,8 +31,7 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]]
name = "amdgpu-sysfs"
version = "0.21.0"
source = "git+https://github.com/ilya-zlobintsev/amdgpu-sysfs-rs.git?rev=215eafbcbca0fe28f66f8ba0cbcec0f547baaba1#215eafbcbca0fe28f66f8ba0cbcec0f547baaba1"
version = "0.21.1"
dependencies = [
"enum_dispatch",
"serde",
+2 -1
View File
@@ -13,7 +13,8 @@ members = [
edition = "2024"
[workspace.dependencies]
amdgpu-sysfs = { git = "https://github.com/ilya-zlobintsev/amdgpu-sysfs-rs.git", rev = "215eafbcbca0fe28f66f8ba0cbcec0f547baaba1", features = ["serde"] }
#amdgpu-sysfs = { git = "https://github.com/ilya-zlobintsev/amdgpu-sysfs-rs.git", rev = "215eafbcbca0fe28f66f8ba0cbcec0f547baaba1", features = ["serde"] }
amdgpu-sysfs = { path = "../amdgpu-sysfs-rs", features = ["serde"] }
nvml-wrapper = { git = "https://github.com/rust-nvml/nvml-wrapper.git", rev = "eb47417eede43443f139053479618e96ad32893d" }
serde = { version = "1.0", features = ["derive"] }
serde_with = { version = "3.21.0", default-features = false, features = [
+4
View File
@@ -213,6 +213,10 @@ gpus:
mem_clock_offsets:
0: 200
# Index of the UMA (dedicated VRAM) configuration that should be used.
# Needs a reboot to actually take effect. Applicable to certain AMD iGPUs.
uma_carveout: 1
# Settings profiles
profiles:
# Name of the profile
+2 -15
View File
@@ -495,7 +495,7 @@ mod tests {
use indexmap::IndexMap;
use insta::assert_yaml_snapshot;
use lact_schema::{
FanControlMode, NvidiaThermalOptions, NvidiaVfPoint, PmfwOptions,
FanControlMode, NvidiaVfPoint, PmfwOptions,
config::{
ClocksConfiguration, CurvePoint, FanControlSettings, FanCurve, GpuConfig,
NvidiaCurvePoint,
@@ -601,20 +601,7 @@ mod tests {
#[test]
fn clocks_configuration_applied() {
let mut gpu = GpuConfig {
fan_control_enabled: false,
fan_control_settings: None,
pmfw_options: PmfwOptions::default(),
nvidia_thermal_options: NvidiaThermalOptions::default(),
power_mizer_mode: None,
power_cap: None,
performance_level: None,
clocks_configuration: ClocksConfiguration::default(),
power_profile_mode_index: None,
custom_power_profile_mode_hueristics: vec![],
power_states: IndexMap::new(),
};
let mut gpu = GpuConfig::default();
assert!(!gpu.is_core_clocks_used());
gpu.clocks_configuration.voltage_offset = Some(10);
assert!(gpu.is_core_clocks_used());
+17 -4
View File
@@ -23,10 +23,10 @@ use drm::{DrmProvider, amdgpu::AmdGpuDrmProvider};
use futures::{FutureExt, future::LocalBoxFuture};
use indexmap::IndexMap;
use lact_schema::{
ActivePowerStates, AmdCacheInstance, CacheInfo, CacheType, ClocksInfo, ClockspeedStats,
DeviceApiInfo, DeviceFlag, DeviceInfo, DeviceStats, DeviceType, DrmInfo, FanControlMode,
FanStats, LinkInfo, NvidiaThermalInfo, PmfwInfo, PowerState, PowerStates, PowerStats,
ProcessList, ProcessUtilizationType, TemperatureEntry, VoltageStats, VramStats,
ActivePowerStates, AmdCacheInstance, AmdUmaCarveout, CacheInfo, CacheType, ClocksInfo,
ClockspeedStats, DeviceApiInfo, DeviceFlag, DeviceInfo, DeviceStats, DeviceType, DrmInfo,
FanControlMode, FanStats, LinkInfo, NvidiaThermalInfo, PmfwInfo, PowerState, PowerStates,
PowerStats, ProcessList, ProcessUtilizationType, TemperatureEntry, VoltageStats, VramStats,
config::{ClocksConfiguration, FanControlSettings, FanCurve, GpuConfig},
};
#[cfg(feature = "display-info")]
@@ -567,6 +567,18 @@ impl AmdGpuController {
.ok()
});
let amd_uma_carveout = self
.handle
.get_uma_carveout_options()
.and_then(|options| {
let current = self.handle.get_current_uma_carveout()?;
Ok(AmdUmaCarveout {
options: options.options,
current,
})
})
.ok();
trace!("Reading DRM info");
let drm_handle = self.drm_handle.as_ref();
@@ -575,6 +587,7 @@ impl AmdGpuController {
None => Some(DrmInfo {
cache_info,
vram_clock_ratio: 1.0,
amd_uma_carveout,
..Default::default()
}),
}
@@ -855,6 +855,7 @@ impl GpuController for NvidiaGpuController {
.ok(),
amd_ip_info: vec![],
intel: IntelDrmInfo::default(),
..Default::default()
}),
flags: vec![
DeviceFlag::ConfigurableFanControl,
@@ -103,6 +103,7 @@ gpus:
memory_clock:
- 0
- 1
uma_carveout: 1
profiles:
vkcube:
rule:
@@ -39,6 +39,43 @@ expression: device_info
"info": {
"driver": "amdgpu",
"drm_info": {
"amd_uma_carveout": {
"current": 0,
"options": [
{
"name": "Minimum",
"size_bytes": 536870912
},
{
"name": null,
"size_bytes": 1073741824
},
{
"name": null,
"size_bytes": 2147483648
},
{
"name": null,
"size_bytes": 4294967296
},
{
"name": null,
"size_bytes": 6442450944
},
{
"name": "Medium",
"size_bytes": 8589934592
},
{
"name": null,
"size_bytes": 12884901888
},
{
"name": "High",
"size_bytes": 17179869184
}
]
},
"cache_info": {
"Amd": [
[
+1
View File
@@ -53,6 +53,7 @@ pub struct GpuConfig {
pub custom_power_profile_mode_hueristics: Vec<Vec<Option<i32>>>,
#[serde(default, skip_serializing_if = "IndexMap::is_empty")]
pub power_states: IndexMap<PowerLevelKind, Vec<u8>>,
pub uma_carveout: Option<usize>,
}
#[skip_serializing_none]
+10 -1
View File
@@ -15,7 +15,7 @@ pub use response::Response;
use amdgpu_sysfs::{
gpu_handle::{
PerformanceLevel, PowerLevelId,
PerformanceLevel, PowerLevelId, UmaCarveoutOption,
fan_control::FanInfo,
overdrive::{ClocksTable as _, ClocksTableGen as AmdClocksTableGen},
},
@@ -415,10 +415,19 @@ pub struct DrmInfo {
pub memory_info: Option<DrmMemoryInfo>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub amd_ip_info: Vec<AmdIpInfo>,
pub amd_uma_carveout: Option<AmdUmaCarveout>,
#[serde(flatten)]
pub intel: IntelDrmInfo,
}
/// Options for iGPU UMA allocation
#[skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct AmdUmaCarveout {
pub options: Vec<UmaCarveoutOption>,
pub current: usize,
}
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct AmdIpInfo {
pub ip_type: String,
@@ -0,0 +1 @@
0
@@ -0,0 +1,8 @@
0: Minimum (512 MB)
1: (1 GB)
2: (2 GB)
3: (4 GB)
4: (6 GB)
5: Medium (8 GB)
6: (12 GB)
7: High (16 GB)