From 2eb1008ec0b704dd20f4037d69a28ba3cacaf61c Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Sat, 11 Jul 2026 22:36:01 +0400 Subject: [PATCH] power: zram swap ahead of disk swapfile for large model loads --- modules/power.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/power.nix b/modules/power.nix index de9e334..bc9411e 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -15,6 +15,17 @@ # suspend-then-hibernate so long sleeps drain to disk. boot.resumeDevice = "/dev/mapper/luks-71c97ce7-dd29-4b07-8d2a-8cc3985a65bd"; + # zram ahead of the disk swapfile: when a large LLM load pins 20-30 GiB of + # GTT, evicted app pages compress into RAM instead of contending with model + # reads on the same NVMe (this contention caused 8-minute model loads). + # Hibernate is unaffected: the image goes to resumeDevice/resume_offset + # (the swapfile), which stays available as overflow swap at priority -2. + zramSwap = { + enable = true; + memoryPercent = 50; + priority = 100; + }; + # On battery: suspend-then-hibernate (s2idle then hibernate after # HibernateDelaySec). Previously this looped suspend->wake->suspend due # to ACPI EC interrupts, but acpi.ec_no_wakeup=1 (above) plus disabling