From a5c7c91e38ba853f365aea744d0983e27d1885d6 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 7 Apr 2026 19:08:08 -0400 Subject: [PATCH] Power: disable a bunch of things BROKE intel arc A380 completely because it was forced into L1.1/L1.2 pcie substates. Forcewaking the device would fail and it would never come up. So I will be more conservative on power saving tuning. --- configuration.nix | 7 +++++- modules/power.nix | 54 +---------------------------------------------- 2 files changed, 7 insertions(+), 54 deletions(-) diff --git a/configuration.nix b/configuration.nix index d2bbb2c..9c83e88 100644 --- a/configuration.nix +++ b/configuration.nix @@ -120,7 +120,12 @@ }; }; - hardware.intelgpu.driver = "xe"; + # Intel Arc A380 (DG2, 56a5) uses the i915 driver on kernel 6.12. + # The xe driver's iHD media driver integration has buffer mapping + # failures on this GPU/kernel combination. i915 works correctly for + # VAAPI transcode as long as ASPM deep states are disabled for the + # GPU (see modules/power.nix). + hardware.intelgpu.driver = "i915"; # Per-service 2MB hugepage budget calculated in service-configs.nix. boot.kernel.sysctl."vm.nr_hugepages" = service_configs.hugepages_2m.total_pages; diff --git a/modules/power.nix b/modules/power.nix index 98e6cda..4cb9469 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -1,12 +1,9 @@ { - lib, - pkgs, ... }: { powerManagement = { enable = true; - powertop.enable = true; cpuFreqGovernor = "powersave"; }; @@ -29,14 +26,6 @@ # work items -- irrelevant for a server whose latency-sensitive paths are # all in userspace (caddy, jellyfin). "workqueue.power_efficient=1" - - # Force PCIe ASPM on even if the BIOS doesn't advertise support. ASRock - # B550M Pro4 BIOS defaults are conservative; the Zen 3 root complex and - # all downstream devices (NVMe, AHCI, Intel NIC) support L1 substates. - # powertop auto-tune sets the policy to powersupersave at runtime, but - # without `force` the kernel may refuse to enable ASPM at all if the BIOS - # opted out, making the policy write a no-op. - "pcie_aspm=force" ]; boot.kernel.sysctl = { @@ -45,49 +34,8 @@ "kernel.nmi_watchdog" = 0; }; - # Server has no audio consumers. Power-gate the HDA codec at module load - # rather than waiting for powertop auto-tune to do it after boot. + # Server has no audio consumers. Power-gate the HDA codec at module load. boot.extraModprobeConfig = '' options snd_hda_intel power_save=1 power_save_controller=Y ''; - - # Apply sysfs power knobs that powertop --auto-tune cannot reach (hardened - # kernel blocks debugfs mount, so powertop silently skips ASPM policy and - # may only lower EPP to balance_power instead of power). - # - # AMD pstate EPP "power": deepest P-states, fastest core parking. Safe because: - # - xmrig runs at Nice=19 / CPUSchedulingPolicy=idle and tolerates latency - # - web services (caddy, jellyfin) are I/O-bound; the ~50 us extra C-state - # exit latency is invisible behind network RTT - # - Minecraft server benefits from single-thread boost, which pstate still - # provides on demand even in "power" mode (just with slightly slower ramp) - # - # ASPM powersupersave: deepest PCIe link power states (L1.1/L1.2). The - # pcie_aspm=force boot param enables ASPM, but the runtime policy defaults - # to "default" which only uses L0s. powersupersave adds L1 substates for - # all downstream devices (NVMe, AHCI, NIC). - systemd.services.power-tune = { - description = "Apply power-saving sysfs knobs (EPP, ASPM policy)"; - after = [ "multi-user.target" ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - ExecStart = lib.getExe ( - pkgs.writeShellApplication { - name = "power-tune"; - text = '' - # AMD pstate energy performance preference - for epp in /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference; do - [ -f "$epp" ] && echo power > "$epp" - done - - # PCIe ASPM policy - aspm=/sys/module/pcie_aspm/parameters/policy - [ -f "$aspm" ] && echo powersupersave > "$aspm" - ''; - } - ); - }; - }; }