Skip to content

Dynamically pin Qubes domains to vCPUs based on the focused window

License

Notifications You must be signed in to change notification settings

Atrate/qubes-window-boost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Qubes Window Boost

License: AGPL v3

Description

This script is designed for QubesOS. It automatically reads the current focused window's parent VM and pins the VM to all CPU cores (or to performance cores, this only needs one line's worth of changes). The default assumption is that all VMs are by default pinned to E-cores on asymmetrical CPUs and they get given access to all cores when in focus for additional snappiness and performance. See https://forum.qubes-os.org/t/cpu-pinning-alder-lake/17949 for information on how to set up the prerequisite core pinning required for this script to run well.

When the USR1 signal is received by the script, it resets all dynamic pins, that is it reset the pinning state to whatever it was before running the script. This does not make the script exit.

Usage

  1. Set up automatic CPU pinning based on information in this Qubes forum thread
  2. Decide on the cores you want to pin focused windows' VMs to (TARGET_CORES variable)
  3. Decide on the VMs you want to ignore based on their current pins (IGNORE_PIN variable)
  4. Download window_boost.sh and move it to dom0 (e.g. to /usr/local/bin/window_boost.sh
  5. Make it executable (sudo chmod +x /usr/local/bin/window_boost.sh)
  6. Launch the script (/usr/local/bin/window_boost.sh)
  7. Optional: launch the script automatically (example for autostart on i3: exec_always --no-startup-id /usr/local/bin/window_boost.sh)
  8. Optional: configure keybind to clear all dynamic pins (e.g. before locking screen) (example for i3: bindsym $mod+l exec --no-startup-id "pkill -USR1 window_boost.sh")

Limitations

  1. The script only supports the i3 window manager.
  2. If you have more specific pins defined for a VM (such as "vCPU 1 to CPUs 2, 3 and 4, vCPU 2 to CPUs 4, 6, 7), the script will probably not work well.
  3. dom0 does not get its pinnings modified. This is by design, but a commandline switch to change that behavior could be implemented.

PRs to fix those issues are welcome :).

License

This project is licensed under the AGPL-3.0-or-later.

License: AGPLv3

About

Dynamically pin Qubes domains to vCPUs based on the focused window

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages