10.nixos-hardware/framework/16-inch/amd-ai-300-series
2025-12-30 11:34:29 +00:00
..
nvidia framework-16-amd-ai-300-series: add nvidia submodule 2025-11-28 11:57:31 +01:00
default.nix framework-16-amd-ai-300-series: mitigate various graphics issues 2025-12-25 20:45:22 -04:00
README.md Update README for nix-shell command usage 2025-12-30 11:34:29 +00:00

Framework Laptop 16 — AMD Ryzen AI 300 Series

Base (no NVIDIA dGPU module)

Use the base module:

{
  imports = [
    nixos-hardware.nixosModules.framework-16-amd-ai-300-series
  ];
}

NVIDIA dGPU module (RTX 5070 etc.)

If you have the Framework 16 NVIDIA dGPU module (GeForce RTX 5070 or similar), use the NVIDIA submodule:

{
  imports = [
    nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
  ];
}

This enables hybrid graphics with PRIME offload: the AMD iGPU runs by default for better battery life, and the NVIDIA dGPU can be used on demand with nvidia-offload <command>.

IMPORTANT: You MUST override the PCI bus IDs for your specific system!

The default values are examples only and will likely not match your hardware. Due to Framework 16's modular design, bus IDs vary depending on installed expansion cards and NVMe drives:

{
  hardware.nvidia.prime = {
    amdgpuBusId = "PCI:195:0:0";   # Adjust to your system
    nvidiaBusId = "PCI:194:0:0";   # Adjust to your system
  };
}

Find your bus IDs with:

$ nix-shell -p pciutils --run 'lspci | grep -E "VGA|3D|Display"'
c2:00.0 VGA compatible controller: NVIDIA Corporation ...
c3:00.0 Display controller: Advanced Micro Devices ...

Convert the hex bus ID to decimal (e.g., c2:00.0PCI:194:0:0, c3:00.0PCI:195:0:0).

Helper:

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

Validate hybrid / offload behavior

# Default should use AMD
nix-shell -p mesa-demos --run 'glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"'

# Offload should use NVIDIA
nix-shell -p mesa-demos --run 'nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"'

To check whether the NVIDIA GPU is runtime-suspending at idle:

# Replace with your NVIDIA PCI address (from `nix-shell -p pciutils --run 'lspci -D'`)
cat /sys/bus/pci/devices/0000:??:??.?/power/runtime_status

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

Optional: Battery-saver boot entry

If you want an easy “iGPU-only” boot entry (to maximize battery life and avoid loading NVIDIA at all), you can enable the PRIME battery saver specialisation:

{
  hardware.nvidia.primeBatterySaverSpecialisation = true;
}

This creates an additional boot entry tagged battery-saver.

Troubleshooting notes

Firmware updates (fwupd)

Firmware is updatable via fwupd (enabled by default). To get the latest firmware:

$ fwupdmgr refresh
$ fwupdmgr update