Tuning kernel arguments for energy efficiency

Grub kernel arguments

Current kernel arguments:

grubby --info=0
index=0
kernel="/boot/vmlinuz-5.15.16-200.fc35.x86_64"
args="ro rootflags=subvol=root rootflags=noatime rhgb quiet i915.enable_psr=1 i915.enable_fbc=1 rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 intel_idle.no_acpi=Y
i915.enable_guc=3"
root="UUID=99cb8132-f86a-414d-8e5e-ecc4120b93b0"
initrd="/boot/initramfs-5.15.16-200.fc35.x86_64.img"
title="Fedora Linux (5.15.16-200.fc35.x86_64) 35 (Workstation Edition)"
id="f8c8a08f7ded4ca9ad99a0345de7dae9-5.15.16-200.fc35.x86_64"

i915.enable_psr=1 Enable PSR (panel self refresh)

Optional:

i915.enable_fbc=1 Enable frame buffer compression for power savings

intel_idle.no_acpi=Y  Do not use ACPI _CST for building the idle states list (bool)

i915.enable_guc=3 Enable GuC load for GuC submission and/or HuC load.


To add new parameter use grubby, for example:

grubby --update-kernel=ALL --args="i915.enable_psr=1"


Nvidia

Edit /etc/modprobe.d/mynvidia.conf:

options nvidia NVreg_TemporaryFilePath=/var/tmp
options nvidia NVreg_DynamicPowerManagement=0x02


Nvidia suspend

dnf install xorg-x11-drv-nvidia-power

Edit /usr/lib/modprobe.d/nvidia-power-management.conf , you are using s2idle (s0ix) :

options nvidia NVreg_PreserveVideoMemoryAllocations=0
options nvidia NVreg_EnableS0ixPowerManagement=1


If you're using s3 (suspend to ram):

options nvidia NVreg_PreserveVideoMemoryAllocations=1

Ref: https://download.nvidia.com/XFree86/Linux-x86_64/495.46/README/powermanagement.html


Reduce power in PCIE devices


Create this script and run from /etc/rc.d/rc.local :

#!/bin/bash

echo powersupersave > /sys/module/pcie_aspm/parameters/policy

PMC_CORE_SYSFS_PATH="/sys/kernel/debug/pmc_core"
ignore_ltr_all() {
  local ltr_ip_num
  local num
  local i=0
  ltr_ip_num=$(wc -l $PMC_CORE_SYSFS_PATH/ltr_show 2>&1 | awk '{print$1}')
  num=$((ltr_ip_num - 1))
  while [ $i -ne $num ]; do
    echo $i >$PMC_CORE_SYSFS_PATH/ltr_ignore 2>&1
    i=$((i + 1))
  done
}
ignore_ltr_all

Ref: https://github.com/intel/S0ixSelftestTool


Power consumption

Using these kernel arguments and scripts, Power Saver mode in gnome shell, my laptop's power usage when idle is 4.3 watt 😎

Comments

Popular posts from this blog

Manually clean up zimbra zmcat/zmcpustat exploit

Optimize SSD on Linux

Ports to allow for whatsapp call