Skip to content

tweaks: Add vram cgroup tweak#218

Open
ptr1337 wants to merge 2 commits intodevelopfrom
vram-tweak
Open

tweaks: Add vram cgroup tweak#218
ptr1337 wants to merge 2 commits intodevelopfrom
vram-tweak

Conversation

@ptr1337
Copy link
Copy Markdown
Member

@ptr1337 ptr1337 commented Apr 10, 2026

Adds new feature developed by Pixelclustr to improve the VRAM behaviour. This is optin and should be showed only on Intel and AMD GPUs

Signed-off-by: Peter Jung <admin@ptr1337.dev>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in “GPU Boosters” tweak to the app, intended to improve GPU/VRAM-related behavior by installing booster packages and only surfacing the option on Intel/AMD systems.

Changes:

  • Introduces Intel/AMD GPU detection helpers and wires them into tweak visibility.
  • Adds a new GpuBoosters tweak backed by package install/remove (instead of systemd units).
  • Updates GUI + CLI tweak handling to support “package”-type tweaks; adds tooltip string.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/window.rs Formatting-only change in locale switching element list.
src/utils.rs Adds GPU vendor/class detection and a helper to detect Intel/AMD GPUs.
src/tweak.rs Adds GpuBoosters tweak, visibility gating, and package-list helpers.
src/systemd_units.rs Minor formatting refactor in enabled-unit query.
src/pages/tweaks.rs GUI tweaks page updated to hide/show GPU tweak and to toggle package-based tweaks.
src/logger.rs Formatting-only change to env filter initialization.
src/cli_handler.rs CLI tweak enable/disable + list updated to support package-based tweaks and visibility filtering.
src/actions.rs Formatting-only change to nmcli invocation args.
i18n/en/cachyos_hello.ftl Adds tooltip text for the new GPU Boosters tweak.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to +151
if action_type == "package" {
let success = if action_enabled {
utils::run_cmd_terminal(
crate::gui::run_command,
format!("pacman -Rns {alpm_package_name}"),
true,
) && !tweak::are_any_packages_installed(&alpm_package_name)
} else {
utils::run_cmd_terminal(
crate::gui::run_command,
format!("pacman -S {alpm_package_name}"),
true,
) && tweak::are_packages_installed(&alpm_package_name)
};

let result = if success {
ToggleResult::Success(!action_enabled)
} else {
let message = if action_enabled {
format!("Failed to remove required package(s): {alpm_package_name}")
} else {
fl!("package-not-installed", package_name = alpm_package_name)
};
ToggleResult::Failed { restored_state: action_enabled, message }
};
tx.send(result).expect("Couldn't send data to channel");
return;
Comment on lines +142 to +148
} else {
let message = if action_enabled {
format!("Failed to remove required package(s): {alpm_package_name}")
} else {
fl!("package-not-installed", package_name = alpm_package_name)
};
ToggleResult::Failed { restored_state: action_enabled, message }
src/tweak.rs Outdated
Comment on lines +46 to +52
pub fn are_packages_installed(package_names: &str) -> bool {
package_names.split_whitespace().all(crate::utils::is_alpm_pkg_installed)
}

pub fn are_any_packages_installed(package_names: &str) -> bool {
package_names.split_whitespace().any(crate::utils::is_alpm_pkg_installed)
}
src/tweak.rs Outdated
Comment on lines 20 to 36
@@ -29,9 +32,25 @@ pub fn get_details(tweak: TweakName) -> (&'static str, &'static str, &'static st
TweakName::CachyUpdate => {
("user_service", "arch-update.timer arch-update-tray.service", "cachy-update")
},
TweakName::GpuBoosters => ("package", "", "dmemcg-booster plasma-foreground-booster"),
}
Comment on lines +288 to +304
if action_type == "package" {
if enable {
if !tweak::are_packages_installed(alpm_package_name) {
println!(
"Required package '{}' is not installed. Installing...",
alpm_package_name.yellow()
);
let status = crate::cli::run_command(
&format!("pacman -S --noconfirm {alpm_package_name}"),
true,
);
if !status || !tweak::are_packages_installed(alpm_package_name) {
anyhow::bail!(
"Failed to install required package '{alpm_package_name}'. Cannot enable tweak."
);
}
}
Signed-off-by: Peter Jung <admin@ptr1337.dev>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in “GPU boosters” install feature (for Intel/AMD) and improves tweak toggle error handling, integrating the new action across GUI, CLI, actions, and i18n.

Changes:

  • Add GPU detection helpers and gate the new “Install GPU Boosters” GUI button to Intel/AMD hardware.
  • Introduce InstallGpuBoosters action/CLI fix command and wire it to install dmemcg-booster + plasma-foreground-booster.
  • Improve tweak toggling feedback by returning structured success/failure results and showing error dialogs on failure.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils.rs Adds Intel/AMD GPU detection helpers + unit test.
src/pages/mod.rs Conditionally shows and wires “Install GPU Boosters” button in GUI.
src/ui.rs Adds Action::InstallGpuBoosters for dialog routing.
src/actions.rs Adds install_gpu_boosters() using existing package-install helper.
src/cli.rs Adds FixAction::InstallGpuBoosters to CLI.
src/cli_handler.rs Handles new CLI fix action by calling actions::install_gpu_boosters.
src/pages/tweaks.rs Refactors service toggle flow to report failures with messages.
src/tweak.rs Trailing newline only.
i18n/en/cachyos_hello.ftl Adds English strings for GPU boosters button/tooltip + installed message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +153 to +156
ToggleResult::Failed {
restored_state: new_state,
message: format!("Failed to update tweak state for {action_data}"),
}
Comment on lines 12 to 16
package-not-installed = Package '{$package_name}' has not been installed!
gaming-package-installed = Gaming packages already installed!
winboat-package-installed = Winboat packages already installed!
gpu-boosters-package-installed = GPU booster packages already installed!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, will do later i18n stuff when more or less approved

Comment on lines 82 to +85
install-gaming-title = Install Gaming packages
install-winboat-title = Install Winboat
install-gpu-boosters-title = Install GPU Boosters
install-gpu-boosters-tooltip = Install dmemcg-booster and plasma-foreground-booster on AMD or Intel GPUs
Comment on lines +58 to +61
FixAction::InstallGpuBoosters => {
println!("{}", "Installing GPU booster packages...".bold());
actions::install_gpu_boosters(crate::cli::run_command, tx);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants