Hardware/Framework/Laptop 16: Difference between revisions
Mention systemd bug resulting in idle-suspend loop |
m style fixes |
||
| (One intermediate revision by one other user not shown) | |||
| Line 55: | Line 55: | ||
Add this snippet to configuration.nix: | Add this snippet to configuration.nix: | ||
{{file|configuration.nix|nix|3= | |||
systemd.services.inhibit-sleep-after-resume = { | systemd.services.inhibit-sleep-after-resume = { | ||
description = "Temporary sleep inhibitor after resume (workaround for double-suspend)"; | description = "Temporary sleep inhibitor after resume (workaround for double-suspend)"; | ||
| Line 69: | Line 69: | ||
''; | ''; | ||
}; | }; | ||
}} | |||
==== Workaround 2: disable GNOME idle-suspend (low risk; lid-close suspend still works) ==== | ==== Workaround 2: disable GNOME idle-suspend (low risk; lid-close suspend still works) ==== | ||
| Line 77: | Line 77: | ||
Disable idle suspend on AC power: | Disable idle suspend on AC power: | ||
<syntaxhighlight lang= | <syntaxhighlight lang=console> | ||
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' | $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' | ||
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0 | $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Optionally also disable it on battery: | Optionally also disable it on battery: | ||
<syntaxhighlight lang= | <syntaxhighlight lang=console> | ||
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing' | $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing' | ||
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0 | $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 154: | Line 154: | ||
Example override: | Example override: | ||
{{file|configuration.nix|nix|3= | |||
{ | { | ||
hardware.nvidia.prime = { | hardware.nvidia.prime = { | ||
# Replace these values with your own system's IDs: | # Replace these values with your own system's IDs: | ||
| Line 163: | Line 162: | ||
}; | }; | ||
} | } | ||
}} | |||
Find PCI IDs: | Find PCI IDs: | ||
<syntaxhighlight lang= | <syntaxhighlight lang=console> | ||
$ nix-shell -p pciutils --run 'lspci | grep -E "VGA|3D|Display"' | $ nix-shell -p pciutils --run 'lspci | grep -E "VGA|3D|Display"' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 186: | Line 185: | ||
Validation (hybrid/offload): | Validation (hybrid/offload): | ||
<syntaxhighlight lang= | <syntaxhighlight lang=console> | ||
# Default: should show AMD iGPU | $ # Default: should show AMD iGPU | ||
nix-shell -p mesa-demos --run 'glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"' | $ nix-shell -p mesa-demos --run 'glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"' | ||
# Offload: should show NVIDIA dGPU | $ # Offload: should show NVIDIA dGPU | ||
nix-shell -p mesa-demos --run 'nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"' | $ nix-shell -p mesa-demos --run 'nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"' | ||
# Idle power check: should become "suspended" when idle | $ # Idle power check: should become "suspended" when idle | ||
cat /sys/bus/pci/devices/0000:??:??.?/power/runtime_status | $ cat /sys/bus/pci/devices/0000:??:??.?/power/runtime_status | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 258: | Line 257: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
inputmodule.enable = true; | hardware.inputmodule.enable = true; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Example (LED matrix clock): | Example (LED matrix clock): | ||
<syntaxhighlight lang= | <syntaxhighlight lang=console> | ||
# Serial device is often /dev/ttyACM0 (or ttyACM1 if you have two modules) | $ # Serial device is often /dev/ttyACM0 (or ttyACM1 if you have two modules) | ||
inputmodule-control --serial-dev /dev/ttyACM0 led-matrix --clock | $ inputmodule-control --serial-dev /dev/ttyACM0 led-matrix --clock | ||
</syntaxhighlight> | </syntaxhighlight> | ||