Framework Ubuntu notes
- Grub and kernel modules
- Turned off WiFi power management
- Useful commands
- Tune power usage
- USB expansion slots
- Stuttering/mini-freezes
- Firefox
- Check GPU power usage
- Reference links
Grub and kernel modules
nvme.noacpi
: longer sleep life (NVME consumes too much power while sleeping).module_blocklist=hid_sensor_hub
: brightness keys clash with the ambient light sensor. disable the ambient light sensor by blacklisting the module.i915.enable_psr
: force disables "PSR", relevant on devices experiencing mini-freezes.
Ubuntu uses /etc/default/grub
for the grub config, edit GRUB_CMDLINE_LILNUX_DEFAULT
.
Complete example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash module_blacklist=hid_sensor_hub nvme.noacpi=1 i915.enable_psr=0"
GRUB_CMDLINE_LINUX=""
Ben's config:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable nvme.noacpi=1"
And then update grub
$ sudo update-grub
Turned off WiFi power management
Did this a while ago and forgot to document it:
$ sudo cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
# https://unix.stackexchange.com/questions/595116/wi-fi-powersaving-in-networkmanager
# https://unix.stackexchange.com/questions/269661/how-to-turn-off-wireless-power-management-permanently
[connection]
wifi.powersave = 2
# NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
# NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
# NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
# NM_SETTING_WIRELESS_POWERSAVE_ENABLE (3): enable powersave
Restart network manager:
$ sudo systemctl restart NetworkManager
Check with:
$ apt-get install wireless-tools
$ iwconfig 2>&1 | grep -i "power management"
Power Management:off
Useful commands
tlp
:
$ sudo tlp-stat -h
Usage: tlp-stat [ -b | --battery | -c | --config |
-d | --disk | -e | --pcie |
-g | --graphics | -p | --processor |
-r | --rfkill | -s | --system |
-t | --temp | -u | --usb |
-w | --warn | -v | --verbose |
| --cdiff | | --pev |
-P | --psup | -T | --trace |
cpupower
:
$ sudo apt-get install linux-tools-common linux-tools-generic
$ cpupower
Usage: cpupower [-d|--debug] [-c|--cpu cpulist ] <command> [<args>]
Supported commands are:
frequency-info
frequency-set
idle-info
idle-set
set
info
monitor
help
Tune power usage
Install packages:
$ sudo apt-get install powertop tlp cpufreqd cpufrequtils
$ sudo snap install auto-cpufreq
Add intel_pstate=disable
to GRUB_CMDLINE_LINUX_DEFAULT
for
auto-cpufreq (or recommended by auto-cpufreq).
Use powertop
:
$ sudo powertop --auto-tune
Enable as service:
$ sudo systemctl enable powertop
$ sudo systemctl start powertop
Or start it with:
$ sudo tlp start
Enable ASPM in /etc/tlp.conf
:
PCIE_ASPM_ON_BAT=powersupersave
Start tlp
and enable it:
$ sudo systemctl enable tlp
$ sudo systemctl start tlp
Simpler alternative to tlp
(but they clash): power-profiles-daemon
,
available in Ubuntu repos.
USB expansion slots
HDMI and storage module appear to use ~1W at idle (from looking at powertop
).
Stuttering/mini-freezes
On kernels pre 5.14, PSR can cause stuttering.
This only seems to happen with Wayland from what i have read, and not X.org. so trying X.org might be worthwhile.
$ uname -r
5.15.0-48-generic
$ cat /etc/lsb-release | grep DESCR
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
$ sudo cat /sys/kernel/debug/dri/0/i915_edp_psr_status
Sink support: yes [0x03]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f006e6]
Source PSR status: SRDENT [0x40010000]
Busy frontbuffer bits: 0x00000000
But lets try that anyway.
Add i915.enable_psr=0
to GRUB_CMDLINE
in /etc/default/grub
.
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.enable_psr=0"
Or create the file /etc/modprobe.d/i915.conf
:
options i915 enable_psr=0
And update grub:
$ sudo update-grub
Fiddling with it directly and checking values
Install systool
:
$ sudo apt-get install sysfsutils
Check what it tells us:
$ sudo systool -v -m i915 | grep psr
enable_psr2_sel_fetch= "N"
enable_psr = "-1"
psr_safest_params = "N"
List all options for the i915
module (drop the grep
to see all):
$ sudo modprobe --showconfig i915 | grep psr
$ sudo modprobe i915 enable_psr=0
Firefox
Enable GPU rendering, install intel-gpu-tools
and possibly
intel-media-driver
(not available on Ubuntu 22.04 repos).
$ sudo apt-get install intel-gpu-tools
In Firefox, open about:config
and set:
media.rdd-ffmpeg.enabled
:true
media.ffmpeg.vaapi.enabled
:true
media.navigator.mediadatadecoder_vpx_enabled
:true
media.ffvpx.enabled
:false
(created new)media.rdd-vpx.enabled
:false
media.rdd-process.enabled
: false
Check GPU power usage
Check GPU power usage with intel_gpu_top
:
$ sudo intel_gpu_top
play a 4K video or something to to get some load
Reference links
Install and hardware
- Ubuntu 22.04 LTS Installation on the Framework Laptop
- docs: hid-sensor (
hid_sensor_hub
module) - ArchWiki: Framework Laptop
Power savings
Stuttering/minifreezes
- Periodic stuttering on fresh gnome.40 Wayland install on Arch Linux
- Fix for Intel i915 Freeze on Recent Linux Kernels
- Gist: Brainiarc7
- ArchWiki: Intel graphics
Firefox
- ArchWiki: Firefox