Jump to content

Hardware/Framework/Laptop 16: Difference between revisions

From Official NixOS Wiki
0x4A6F (talk | contribs)
No edit summary
Atvor (talk | contribs)
Cleanup, mention nixos-hardware, explain validation and troubleshooting
Line 18: Line 18:
|x86_64-linux
|x86_64-linux
|-
|-
!colspan="2" class="title"|7040 Series
!colspan="2" class="title"|AMD Ryzen 7040 Series
|-
!Maintainer
|-
!colspan="2" class="title"|AMD Ryzen AI 300 Series
|-
|-
!Maintainer
!Maintainer
Line 25: Line 29:
</div>
</div>


The Framework Laptop 16 is a configurable, upgradeable, and repairable laptop made by the Framework company.
The Framework Laptop 16 is a configurable, upgradeable, and repairable laptop made by Framework.


== Status ==
== Status ==


The device boots NixOS.
The device boots NixOS and works well with a recent kernel and the appropriate nixos-hardware module for your CPU generation.


== Known issues ==
== Known issues ==


[[Category: Incomplete]]
[[Category: Incomplete]]
The device still has a couple of hardware quirks (see below).  
The device still has a couple of hardware quirks (see below).


[[Linux kernel|Using the latest kernel]] will fix some issues. Also read configuration hints in this article.
[[Linux kernel|Using the latest kernel]] will fix some issues. Also read configuration hints in this article.
Line 40: Line 44:
== Configuration ==
== Configuration ==


Framework specific NixOS hardware options are bundled within the [https://github.com/NixOS/nixos-hardware nixos-hardware] project.
Framework-specific NixOS hardware configuration is bundled within the [https://github.com/NixOS/nixos-hardware nixos-hardware] project.


=== AMD 7040 Series ===
=== AMD Ryzen 7040 Series ===


It is recommended to use [https://search.nixos.org/options?query=power-profiles-daemon power-profiles-daemon] over <code>tlp</code> for the AMD framework.
It is recommended to use [https://search.nixos.org/options?query=power-profiles-daemon power-profiles-daemon] over <code>tlp</code> for the AMD Framework.


* NixOS Hardware module for flakes: <code>nixos-hardware.nixosModules.framework-16-7040-amd</code>
* NixOS Hardware module for flakes: <code>nixos-hardware.nixosModules.framework-16-7040-amd</code>
* NixOS Hardware module for channels: <code><nixos-hardware/framework/16-inch/7040-amd></code>
* NixOS Hardware module for channels: <code><nixos-hardware/framework/16-inch/7040-amd></code>


=== Fix Color accuracy in Power Saving modes ===
=== AMD Ryzen AI 300 Series ===
[https://docs.kernel.org/gpu/amdgpu/module-parameters.html?highlight=abmlevel Active Backlight Management] is used to reduce [https://community.frame.work/t/solved-color-issues-in-linux-6-9/52158/34 battery power consumption] causing the colors of the screen to be inaccurate.
 
* NixOS Hardware module for flakes: <code>nixos-hardware.nixosModules.framework-16-amd-ai-300-series</code>
* NixOS Hardware module for channels: <code><nixos-hardware/framework/16-inch/amd-ai-300-series></code>
 
==== NVIDIA dGPU module (RTX 5070 etc.) ====
 
If you have the NVIDIA dGPU module, prefer the maintained nixos-hardware NVIDIA submodule (it enables hybrid graphics with PRIME offload and provides <code>nvidia-offload &lt;command&gt;</code>):
 
* NixOS Hardware module for flakes: <code>nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia</code>
* NixOS Hardware module for channels: <code><nixos-hardware/framework/16-inch/amd-ai-300-series/nvidia></code>
 
'''IMPORTANT:''' You MUST override the PRIME PCI bus IDs for your specific system. Framework 16’s modular design means bus IDs can vary depending on installed expansion cards and NVMe drives.
 
Example override:
 
<syntaxhighlight lang="nix">
{
  # In your system configuration:
  hardware.nvidia.prime = {
    # Replace these values with your own system's IDs:
    amdgpuBusId = "PCI:XXX:YY:Z";
    nvidiaBusId = "PCI:AAA:BB:C";
  };
}
</syntaxhighlight>
 
Find PCI IDs:
 
<syntaxhighlight lang="sh">
$ nix shell nixpkgs#pciutils -c lspci | grep -E "VGA|3D|Display"
</syntaxhighlight>
 
Convert the hex bus/device numbers to decimal and format as <code>PCI:&lt;bus&gt;:&lt;device&gt;:&lt;function&gt;</code>.
Example: <code>c1:00.0</code> → <code>PCI:193:0:0</code>.
 
Quick helper (optional):
 
<syntaxhighlight lang="sh">
# Replace BDF with the lspci value like c1:00.0
BDF="c1:00.0"
BUS="${BDF%%:*}"; REST="${BDF#*:}"
DEV="${REST%%.*}"; FUN="${REST#*.}"
printf 'PCI:%d:%d:%d\n' "$((16#$BUS))" "$((16#$DEV))" "$FUN"
</syntaxhighlight>
 
Validation (hybrid/offload):
 
<syntaxhighlight lang="sh">
# Default: should show AMD iGPU
nix shell nixpkgs#mesa-demos -c glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"
 
# Offload: should show NVIDIA dGPU
nix shell nixpkgs#mesa-demos -c nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"
 
# Idle power check: should become "suspended" when idle
cat /sys/bus/pci/devices/0000:??:??.?/power/runtime_status
</syntaxhighlight>
 
Note: <code>nvidia-smi</code> can wake the GPU, so it is not a reliable “is the GPU sleeping?” probe.
 
=== Fix color accuracy in Power Saving modes ===
 
[https://docs.kernel.org/gpu/amdgpu/module-parameters.html?highlight=abmlevel Active Backlight Management] is used to reduce [https://community.frame.work/t/solved-color-issues-in-linux-6-9/52158/34 battery power consumption], which can cause the colors of the screen to be inaccurate.


Some desktop environments may already be able to modify this setting.
Some desktop environments may already be able to modify this setting.


To disable it add the kernel parameter:
To disable it add the kernel parameter:
boot.kernelParams = [ "amdgpu.abmlevel=0" ];
 
<syntaxhighlight lang="nix">
boot.kernelParams = [ "amdgpu.abmlevel=0" ];
</syntaxhighlight>


=== Prevent wake up in backpack ===
=== Prevent wake up in backpack ===
Putting your Framework in a backpack can cause it to wake up due to the screen flexing onto the keyboard. While this is not resolved in Firmware, you can workaround this issue with a udev rule:
 
services.udev.extraRules = <nowiki>''</nowiki>
Putting your Framework in a backpack can cause it to wake up due to the screen flexing onto the keyboard. While this is not resolved in firmware, you can work around this issue with a udev rule.
<nowiki> </nowiki> SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
 
<nowiki> </nowiki>  SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
If you are also importing <code>nixos-hardware</code>, prefer merging (e.g. <code>lib.mkAfter</code>) rather than overwriting <code>services.udev.extraRules</code>, since nixos-hardware may install its own udev rules.
<nowiki>''</nowiki>;
 
<syntaxhighlight lang="nix">
{ lib, ... }:
{
  services.udev.extraRules = lib.mkAfter ''
    SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
    SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
  '';
}
</syntaxhighlight>
 
{| class="wikitable"
{| class="wikitable"
|+
|+
Line 73: Line 152:
|Backlit keyboard ISO
|Backlit keyboard ISO
|32ac 0018
|32ac 0018
|-
|Other devices
|Use <code>lsusb</code> to find Vendor/Product IDs
|}
|}
Other Product and Vendor IDs can be found using lsusb.


This does not prevent the trackpad from waking up the device. This however seems to happen less in a backpack.
This does not prevent the trackpad from waking up the device; this however seems to happen less in a backpack.
 
=== BIOS configuration ===


=== Bios Configuration ===
Enable [https://guides.frame.work/Guide/Ubuntu+22.04+LTS+Installation+on+the+Framework+Laptop+16/306?lang=en#s1974 Linux Audio Compatibility] in the BIOS to improve speaker audio quality.
[https://guides.frame.work/Guide/Ubuntu+22.04+LTS+Installation+on+the+Framework+Laptop+16/306?lang=en#s1974 Enable Linux Audio Compatibility in the bios] to improve speaker audio quality.
 
== Useful utilities ==
 
Framework provides and the community maintains utilities that help manage Framework hardware.
 
* <code>framework-tool</code> provides libraries and tools to interact with Framework-specific features.
* Input modules (LED matrix / numpad) can be controlled with tools such as <code>inputmodule-control</code>.
 
To enable input module support (if installed), set:
 
<syntaxhighlight lang="nix">
inputmodule.enable = true;
</syntaxhighlight>
 
Example (LED matrix clock):
 
<syntaxhighlight lang="sh">
# Serial device is often /dev/ttyACM0 (or ttyACM1 if you have two modules)
inputmodule-control --serial-dev /dev/ttyACM0 led-matrix --clock
</syntaxhighlight>


== Useful Utilities ==
There are also utilities, which are helping managing your framework.   
The framework-tool provides Rust libraries and tools to interact with the system.         
Also there is a tool for controlling the inputmodules like the led matrix.         
It can be enabled by specifing the following:
inputmodule.enable = true;
With the following command you can display the time on your inputmodule.   
It might be necassary to specify your device which will be usually ttyACM0 and ttyACM1, if you have two input modules.
inputmodule-control  --serial-dev /dev/ttyACM1 led-matrix --clock
== External resources ==
== External resources ==
There is [https://community.frame.work/t/nixos-on-the-framework-laptop-16/46743 a NixOS thread on the Framework forum], where you can find additional help, guidance and example configurations.
 
There is [https://community.frame.work/t/nixos-on-the-framework-laptop-16/46743 a NixOS thread on the Framework forum], where you can find additional help, guidance, and example configurations.

Revision as of 21:16, 29 December 2025

Framework Laptop 16
Laptop 16
Manufacturer Framework
Support components
Architecture x86_64-linux
AMD Ryzen 7040 Series
Maintainer
AMD Ryzen AI 300 Series
Maintainer

The Framework Laptop 16 is a configurable, upgradeable, and repairable laptop made by Framework.

Status

The device boots NixOS and works well with a recent kernel and the appropriate nixos-hardware module for your CPU generation.

Known issues

The device still has a couple of hardware quirks (see below).

Using the latest kernel will fix some issues. Also read configuration hints in this article.

Configuration

Framework-specific NixOS hardware configuration is bundled within the nixos-hardware project.

AMD Ryzen 7040 Series

It is recommended to use power-profiles-daemon over tlp for the AMD Framework.

  • NixOS Hardware module for flakes: nixos-hardware.nixosModules.framework-16-7040-amd
  • NixOS Hardware module for channels: <nixos-hardware/framework/16-inch/7040-amd>

AMD Ryzen AI 300 Series

  • NixOS Hardware module for flakes: nixos-hardware.nixosModules.framework-16-amd-ai-300-series
  • NixOS Hardware module for channels: <nixos-hardware/framework/16-inch/amd-ai-300-series>

NVIDIA dGPU module (RTX 5070 etc.)

If you have the NVIDIA dGPU module, prefer the maintained nixos-hardware NVIDIA submodule (it enables hybrid graphics with PRIME offload and provides nvidia-offload <command>):

  • NixOS Hardware module for flakes: nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
  • NixOS Hardware module for channels: <nixos-hardware/framework/16-inch/amd-ai-300-series/nvidia>

IMPORTANT: You MUST override the PRIME PCI bus IDs for your specific system. Framework 16’s modular design means bus IDs can vary depending on installed expansion cards and NVMe drives.

Example override:

{
  # In your system configuration:
  hardware.nvidia.prime = {
    # Replace these values with your own system's IDs:
    amdgpuBusId = "PCI:XXX:YY:Z";
    nvidiaBusId = "PCI:AAA:BB:C";
  };
}

Find PCI IDs:

$ nix shell nixpkgs#pciutils -c lspci | grep -E "VGA|3D|Display"

Convert the hex bus/device numbers to decimal and format as PCI:<bus>:<device>:<function>. Example: c1:00.0PCI:193:0:0.

Quick helper (optional):

# Replace BDF with the lspci value like c1:00.0
BDF="c1:00.0"
BUS="${BDF%%:*}"; REST="${BDF#*:}"
DEV="${REST%%.*}"; FUN="${REST#*.}"
printf 'PCI:%d:%d:%d\n' "$((16#$BUS))" "$((16#$DEV))" "$FUN"

Validation (hybrid/offload):

# Default: should show AMD iGPU
nix shell nixpkgs#mesa-demos -c glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"

# Offload: should show NVIDIA dGPU
nix shell nixpkgs#mesa-demos -c nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"

# Idle power check: should become "suspended" when idle
cat /sys/bus/pci/devices/0000:??:??.?/power/runtime_status

Note: nvidia-smi can wake the GPU, so it is not a reliable “is the GPU sleeping?” probe.

Fix color accuracy in Power Saving modes

Active Backlight Management is used to reduce battery power consumption, which can cause the colors of the screen to be inaccurate.

Some desktop environments may already be able to modify this setting.

To disable it add the kernel parameter:

boot.kernelParams = [ "amdgpu.abmlevel=0" ];

Prevent wake up in backpack

Putting your Framework in a backpack can cause it to wake up due to the screen flexing onto the keyboard. While this is not resolved in firmware, you can work around this issue with a udev rule.

If you are also importing nixos-hardware, prefer merging (e.g. lib.mkAfter) rather than overwriting services.udev.extraRules, since nixos-hardware may install its own udev rules.

{ lib, ... }:
{
  services.udev.extraRules = lib.mkAfter ''
    SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
    SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
  '';
}
Product Vendor and Product ID
RGB Macropad 32ac 0013
Backlit keyboard ISO 32ac 0018
Other devices Use lsusb to find Vendor/Product IDs

This does not prevent the trackpad from waking up the device; this however seems to happen less in a backpack.

BIOS configuration

Enable Linux Audio Compatibility in the BIOS to improve speaker audio quality.

Useful utilities

Framework provides and the community maintains utilities that help manage Framework hardware.

  • framework-tool provides libraries and tools to interact with Framework-specific features.
  • Input modules (LED matrix / numpad) can be controlled with tools such as inputmodule-control.

To enable input module support (if installed), set:

inputmodule.enable = true;

Example (LED matrix clock):

# Serial device is often /dev/ttyACM0 (or ttyACM1 if you have two modules)
inputmodule-control --serial-dev /dev/ttyACM0 led-matrix --clock

External resources

There is a NixOS thread on the Framework forum, where you can find additional help, guidance, and example configurations.