Skip to content

Instantly share code, notes, and snippets.

@lbrame
Last active April 16, 2025 18:53
Show Gist options
  • Save lbrame/f9034b1a9fe4fc2d2835c5542acb170a to your computer and use it in GitHub Desktop.
Save lbrame/f9034b1a9fe4fc2d2835c5542acb170a to your computer and use it in GitHub Desktop.
Framework Laptop 16 Linux configuration tips

⚙️🐧 Framework 16 comprehensive Linux set-up gist

DSC_3274

The Framework Laptop 16 is my new laptop of choice that I purchased to replace my dying older machine. While this laptop enjoys official Linux support, there are still a few things to take care of post-install.

Hardware configuration

This might be useful for people who stumble onto this gist to debug. My laptop is configured as such, with notes on the Linux support:

  • CPU - AMD Ryzen 7 7840HS
  • GPU - Integrated UMA graphics (AMD Radeon 780M)
  • RAM - Kingston 32 GB kit (2x16), 5600 MT/s, CL40 SODIMM memory
  • SSD - WD_Black SN850x NVMe 4x4 m.2 2280 format, 2 TB
    • I previously used a SK Hynix P41 Platinum, which I recommend against due to the buggy controller, constant crashes during write operations, and the fact that it does not report its own size correctly to udisks.

Set up proper settings in the BIOS

Before we proceed with Fedora installation, we need to get a few things done in the BIOS. While booting up the laptop, press F2. Then, select "BIOS Setup". Here, make sure to change the following settings:

  • Advanced
    • iGPU Memory --> Gaming (hardware-reserves 4 GB of memory to the iGPU)
    • Linux Audio Compatibility --> Linux
    • (optional) Battery Charge Limit -->
      • 80 (choose this if you want to preserve battery longevity, but still need to have the battery ready for use on battery)
      • 60 (choose this if you mainly use your laptop connected to a power outlet - wears the battery down even slower)
    • (optional / subjective) Power Button LED Brightness Level --> Low (now better matches the keyboard module!)

It is good practice to reset your BIOS (Load Optimal Settings) if you just upgraded to BIOS version 3.03 and re-do these settings.

-2147483648_-219203

Distro of choice: Fedora Workstation 41

I chose Fedora Workstation 41 because it's officially support and it's a sweet development environment all in all - podman and toolbox are nice to work with, dnf + gdb integration, easy-to-install debug symbols for all packages to help debug upstream, and great support for all on-board hardware as well as nice support for multi-touch gestures are a compelling package.

Setting up Flatpak and Flathub to gain access to more software

Flathub is the accepted central repository to download Flatpak applications through. Flatpak is the next-generation container-based, distro-agnostic, arbitrarily sandboxed packaging system for GUI applications. It provides a host of important advantages over traditional packaging, except for applications like software development, so I recommend using it for most software you install - especially proprietary commercial software, which benefits greatly from the stable and tested runtime target.

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Installing codecs

By default, all codecs and hardware video acceleration are not configured, although they work splendidly with the onboard AMD platform. This is easily remedied with RPMFusion. These instructions may be out of date if a lot of time has passed - refer to upstream website to double check.

First, add both the free and non-free repos:

sudo dnf -y install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
sudo dnf -y config-manager --enable fedora-cisco-openh264 && \
sudo dnf -y groupupdate core   # Entries in GNOME-Software

Next, swap ffmpeg-free for full-fledged ffmpeg:

sudo dnf -y  swap ffmpeg-free ffmpeg --allowerasing

Next, install the codecs:

sudo dnf -y groupupdate multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin && \
sudo dnf -y groupupdate sound-and-video

If you want to have hardware acceleration for codecs other than av1 and vp9, you may install the patched mesa vaapi drivers. Note that I have personally reverted this since this has caused me some issues with updates when the rpmfusion repos were not caught up to the Fedora repos, and as a troubleshooting step to try and reduce GPU crashes.

sudo dnf -y swap mesa-va-drivers mesa-va-drivers-freeworld && \
sudo dnf -y swap mesa-vdpau-drivers mesa-vdpau-drivers-freeworld && \
sudo dnf -y swap mesa-va-drivers.i686 mesa-va-drivers-freeworld.i686 && \
sudo dnf -y swap mesa-vdpau-drivers.i686 mesa-vdpau-drivers-freeworld.i686

GPU: Mitigating AMD GPU crashes

The integrated Radeon 780M in this laptop is not particularly stable and it is pretty prone to hanging, crashing and several other artifacts - common GPU-related bugs are random screen flickering, or the computer slowing down to the point where it updates the screen once every N seconds. I have, however, found some mitigations for the constant crashes.

⚠️ Under investigation.

This section is currently full of many different solutions until the community settles on an universal fix / workaround. I will remove the extra fluff as soon as a consensus is reached.

Quick version: apply the mitigations I am personally using

To apply all of the AMDGPU flags that I applied in one command:

grubby --update-kernel=ALL --args="amdgpu.abmlevel=0 amdgpu.sg_display=0 amdgpu.dcdebugmask=0x410"

Linux 6.11.3 seems to have a mitigation for the above bug. You should really run Linux 6.11.3 or more recent. In case you cannot do that or the crashes persist, try with the following troubleshooting steps. Update 28/10/2024: This problem seems resolved, but it was replaced by other artifcats. Update 08/11/2024: There seems to be a regression introduced by Panel Replay. You can try disabling all PSR, PSR-SU and PR by replacing amdgpu.dcdebugmask=0x10 (only disables PSR, leaves PSR-SU and PR) with amdgpu.dcdebugmask=410 (disables all three). When you turn off PR, you must also turn off PSR and PSR-SU to avoid problems and heavy framebuffer corruption / flickering.

Try these in order. Do not try any of these without having tried the preceding items first. The compromises to functionality and efficiency get bigger the further down this list.

Graphical artifacts and random parts of the screen get corrupted, particularly when scrolling or right clicking

Try to disable PSR, PSR-SU (both should be covered by 0x10 and PR (covered by 0x400):

grubby --update-kernel=ALL --args="amdgpu.dcdebugmask=0x410"

Laptop becomes very laggy and starts working at a very low fps --> Disable PSR (Panel Self Refresh) on AMDGPU

Panel Self Refresh is a very useful power-saving feature that limits the frequency at which the internal monitor gets refreshed according to how often the GPU actually has to draw new content. Without PSR, your panel refreshes 165 times per second, which is very battery-intensive. Unfortunately, multiple users report that this feature is currently broken on the Framework Laptop 16 AMD laptop. You can disable this feature to mitigate or reduce the times the GPU misbehaves:

sudo grubby --update-kernel=ALL --args="amdgpu.dcdebugmask=0x10"

You may check the documentation to verify for yourself that hex 10 in the DC_DEBUG_MASK enum corresponds to DC_DISABLE_PSR.

Display flickers while watching YouTube videos or previews --> disable VAAPI

VAAPI is the API that gets used on Linux for decoding video streams in hardware. Unfortunately, some AMD APU users face problems with VAAPI. The symptoms are, most often, a panel that flickers - sometimes several times in a row - when VAAPI is used.

We may prevent applications from loading the AMD VAAPI driver by overriding it.

Add this environment variable to /etc/environment using a root shell,

echo "LIBVA_DRIVER_NAME=no" >> /etc/environment

And reboot.

Other GPU issues such as flickering, particularly under high RAM use

If you have tried the above two steps and your GPU is still causing issues, you should try disabling AMD Scatter/Gather as a last-ditch solution. It is not a "free" solution, and it might cause other problems when memory pressure on the APU is high. Nevertheless, it is worth trying in desperate cases, and several Framework users have reported some degree of success with it:

sudo grubby --update-kernel=ALL --args="amdgpu.sg_display=0"

Contact Support

I really hope you, unlike me, did not reach this point. You likely have defective hardware. It's time to open a RMA ticket. Good luck.

GPU and panel: disable "AMD Vari-Bright" (ABM) to have proper colors on battery

As of Linux kernel 6.9, AMD added the equivalent of Windows feature AMD Vari-Bright to Linux. It is a power saving feature that reduces the contrast and brightness of the panel when on battery and especially when using a power-saving setting in order to preserve battery. It makes the display colours very inaccurate and unpleasant to look at when the laptop is being used on battery.

To revert this, add the amdgpu.abmlevel=0 parameter to the kernel:

grubby --update-kernel=ALL --args="amdgpu.abmlevel=0"

Apply Framework 16 udev rules from uBlue Framework images

Universal Blue is a great Linux distribution - an immutable one with several flavours, based upon Fedora Silverblue, which ships ISOs with optimized configurations for several laptop vendors. We will be stealing the set of Framework 16-specific udev rules from their configuration and copy it over to our vanilla Fedora configuration, though. These rules fix a bug that causes the laptop to wake up during sleep in a backpack when the very flexy lid presses on the keyboard, and it also works around a bug that causes the Audio Expansion Card from getting put to sleep.

The udev rules are here.

wget https://github.com/ublue-os/config/blob/main/files/etc/udev/rules.d/50-framework16.rules
sudo cp 50-framework16.rules /etc/udev/rules.d/
sudo udevadm control --reload
sudo udevadm trigger

Wi-Fi / suspend: apply workaround to erratic suspend behaviour on Linux 6.11

Linux 6.11 has introduced a regression that causes Bluetooth to interfere with wake from sleep with the default Mediatek Wi-Fi adapter.

Apply Framework's workaround to retain sleep and wake behaviour until this is fixed. Copied from this link for your comfort,

curl -s https://raw.githubusercontent.com/FrameworkComputer/linux-docs/refs/heads/main/hibernation/kernel-6-11-workarounds/rfkill-suspender.sh -o rfkill-suspender.sh && clear && bash rfkill-suspender.sh

Apply QMK udev rules

The internal keyboard has QMK + VIA, and you can use keyboard.frame.work from any Chromium-based browser to configure it and access the VIA web interface.

To be able to to this, you need to follow this guide on how to set up the QMK udev rules on Linux.

wget https://github.com/qmk/qmk_firmware/blob/master/util/udev/50-qmk.rules
sudo cp 50-qmk.rules /etc/udev/rules.d
sudo udevadm control --reload-rules
sudo udevadm trigger

Speakers: enhance speakers with EasyEffects

The internal speakers can be made sound much better after applying an EasyEffects profile. EasyEffects is an application that allows you to apply various filters and equalization to input and output devices. This is effectively the same trick that a lot of manufacturers use in their own customized audio drivers that they ship on their own OEM Windows image to make the speakers sound better. Linux does not do any of that by default, and by default, you are getting the raw output.

Simply follow Framework's guide. Unless it has changed, I will copy the same quick setup command that Framework has here:

curl https://raw.githubusercontent.com/FrameworkComputer/linux-docs/main/easy-effects/Fedora-easy-effects-16-installer.sh | bash

After that, click on "Presets" and click "Load" next to the new fw16-easy-effects profile.

image

Display: (optional) enable VRR

This panel supports VRR (Variable Refresh Rate), a way to match the refresh rate to the frame rate that is being output by a full-screen video or a game. Run this command to enable it. Do mind that this feature is still experimental, and you might want to skip this if you don't want to deal with bugs.

gsettings set org.gnome.mutter experimental-features "['variable-refresh-rate','scale-monitor-framebuffer',`xwayland-native-scaling`]"

You may then access Settings > Display and toggle both of those features on after restarting the compositor.

Ensure Fractional Scaling is properly configured if you upgraded to Feodra 41+ from a previous version

Fedora Workstation 41 finally provides working fractional scaling out of the box. However, there are cases where it does not get configured properly for users upgrading from a previous version of the OS. To ensure the fractional scaling is properly configured, run:

gsettings reset org.gnome.mutter experimental-features

And log out and back in. This will enable experimental features scale-monitor-framebuffer and xwayland-native-scaling, which are the Fedora 41 default. If you want to add something else, like VRR, after this step, query the default active options:

gsettings get org.gnome.mutter experimental-features

Then copy the array, add whatever other non-default feature you want to add, and plug it in the next command. For example, to enable VRR again on Fedora 41g, you would:

gsettings set org.gnome.mutter experimental-features ['scale-monitor-framebuffer', 'xwayland-native-scaling','variable-refresh-rate']

Fractional scaling should now be configurable from the settings and seamlessly followed by all your apps - including XWayland clients.

image

Random troubleshooting

What to do in case of...

System instability

The first thing you want to do is rule out DRAM failure. First of all, install memtest86+:

sudo dnf -y install memtest86+

After that, reboot your laptop. While it's booting, keep pressing F2. Navigate into "Administer Secure Boot", then to "Enforce Secure Boot" and set that value to "Disabled". Press F10, and the reboot will once again reboot. Keep pressing the arrow down button to reveal GRUB. Then, navigate down to Memory Test (memtest86+) and run it. Let it run overnight, preferably for a good 9-10 hours. After you have a solid number of "Pass" and no failures, you can safely assume that memory instability is not the reason for your crashes.

If your problems persist, contact Support. You will be guided through further troubleshooting steps like performing a mainboard state reset, and you will get an hardware replacement if none of the steps solve the problem for you.

Graphical artifacts in games

Some Linux games will have graphical artifacts, because they bundled dependencies are too old for the very recent RDNA 3 graphics. This is easily worked around by forcing the Windows version through Proton. This will, oddly enough, load modern MESA and other dependencies, eliminating the artifacts and improving the performance.

My speakers suddenly sound too tinny!

Sometimes, the subwoofers somehow stop working and only the tweeters stay on. To quickly fix this, open and close EasyEffects, or reboot.

My laptop stopped charging, or is discharing while in use!

Plug the official charger out and back in

A device plugged inside of an USB-A Expansion Card suddenly stopped working!

Flip your laptop, unlatch the Expansion Card latch that holds your USB-A card snug, then remove the card, wait a few seconds, and insert it again.

I found my laptop boiling in my backpack with a dead battery during "suspend"!

There is a suspend bug with this laptop tha triggers when you suspend your laptop before unplugging it from AC power. To make your laptop sleep properly, make sure to remove the charger and wait a few seconds before you suspend the laptop.

My fingerprint sensor stopped working!

Par for course.

systemctl restart fprintd

Speakers: Loading EasyEffects profile

The internal speakers are widely considered to be the not-so-high point of this laptop. However, Framework Forums user cab released a very nice profile to load in EasyEffects to vastly improve the sound that comes out of the speakers.

To apply it:

  1. Download the preset JSON and save it somewhere
  2. Install EasyEffects, either through Flatpak or DNF. I went with the native package on this one
  3. Click on "Presets", then the "Folder" icon, and find the profile file.
  4. Click on "Pipewire", "Presets Autoloading". Choose "Family 17th/19th HD Audio Controller Analog Stereo" from the "Device" dropdown, and add the profile you imported earlier.
  5. Click on the hambuger menu, Preferences, and enable "Launch Service at System Startup"
  6. Reboot the computer.

Next boot, the speakers will sound much better, and will also have more accurate reproduction of high and low frequencies. The only caveat is that this causes a bit of delay. You might hear a slight artifact at the beginning of things like notification sounds. It is for you to decide whether this is worth it. This solution is a stop-gap until official support for laptop speaker DSP lands into Pipewire directly.

Force applications to run on Wayland

These steps used to be necessary on Fedora 40 / GNOME 46, but they are no longer crucial for Fedora 41, since the newer version of the OS now provides solid defaults for hi-dpi scaling. Thus, these steps have been moved off the original gist, but I am leaving them in this file since they are still relevant for people using older versions of GNOME.


Explicitly enabling Wayland rendering in apps to get rid of aliasing artifacts when fractional scaling is active

After enabling the scale-monitor-framebuffer experimental feature, even if the selected scale factor is integer, Legacy programs that still use XWayland to render will look blurry and display disturbing aliasing effects, due to the fact that they are being upscaled from their effective size up to the desired scale factor with a bilinear filter. On the other hand, all Wayland clients, at worst, get rendered at a much higher resolution as integer-scaling in a virtual framebuffer, and then a downsampling trick is used to scale them back to the effective display's resolution, which only produces some barely perceptible aliasing. At best, Wayland clients that implement the Wayland Fractional Scale Protocol will ask the compositor about the scale factor and take the matter into their own hands and rendering already scaled in a pixel-perfect fashion, without the resource consumption and slight artifacts of the downsampling trick.

A silver lining is that most clients have flags or options that allow experimental Wayland rendering, which usually comes with drawbacks far more bearable than the extreme artifacting of letting Mutter scale them. The strategy changes based on the toolkit or technology used.

Electron 28+ (Like VS Codium and VS Code)

Electron applications that are based on Electron 28 or later read the ELECTRON_OZONE_PLATFORM_HINT environment variable, which can be used to force Wayland.

mkdir -p ~/.config/environment.d/ && \
echo "ELECTRON_OZONE_PLATFORM_HINT=auto" > ~/.config/environment.d/electron_wayland.conf

Older Electron versions (Like Insomnia)

Older Electron versions can be forced to use Wayland with the following flags:

--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto

Typically, the way to go for these programs is:

  1. Create a local desktop file where the Exec line is modified to include those flags
  • DNF-installed applications store their desktop files in /usr/share/applications
  • Flatpak System-installed applications store their desktop files in /var/lib/flatpak/exports/share/applications/
  • Flatpak user-installed applications store their desktop files in ~/.var/lib/flatpak/exports/share/applications/
  • The relevant desktop file needs to be copied over to ~/.local/share/applications and then modified in that location for the local override to work
  1. Use the shell profile file (e.g. ~/.profile or ~/.zprofile) or any file sourced at shell startup to declare an alias that overrides the launch command of that application to include the flags.

Electron - note on Flatpak

Sometimes, applications installed through Flatpak have their sandbox set in a way that the Wayland socket is unreachable. Sometimes, enabling access to that socket is sufficient to get the client to use Wayland. Sometimes, that is necessary but it needs to be combined with another strategy. An example of this is Discord, which will require you to enable its Wayland socket, or else it will crash upon you setting the ELECTRON_OZONE_PLATFORM_HINT=auto environment variable.

To do that, either:

flatpak override --user --socket=wayland $APPLICATION_ID

or do it graphically through Flatseal.

For example, Obsidian installed through Flathub can be configured to run on Wayland using the command:

flatpak override --user --socket=wayland md.obsidian.Obsidian

Jetbrains IDEs (IntelliJ IDEA, PyCharm, CLion, RustRover etc.)

For the record, I prefer installing Jetbrains IDEs from their tar archives. In order to display these IDEs in Wayland mode, you need to switch them to the JetBrains Runtime, version 21.. The documentation for how to change runtime is here. From the dialog, make sure to choose a version of the runtime from 21.0 onwards. Finally, from the settings, choose "Edit Custom VM Options..." and paste in:

-Dawt.toolkit.name=WLToolkit

Restart the IDE, and text should look sharp.

Chromium

Navigate to chrome://flags/#ozone-platform-hint and set the flag to Wayland.

Mozilla (Firefox, Thunderbird)

Programs based upon Mozilla's toolkit understand the MOZ_ENABLE_WAYLAND=1 environment variable. As for Firefox, Fedora's preloaded build ran in Wayland with no setup for me, requiring no further action. As for Thunderbird - I installed it through Flathub and I used Flatseal to set the MOZ_ENABLE_WAYLAND=1 environment variable.

Qt

Qt (5 and 6 at the time of writing) applications should already run in Wayland mode natively. But, in case they do not, they can be started with the QT_QPA_PLATFORM=wayland environment variable set.

Fractional scaling and gaming

For those of you who game in your spare time - XWayland also means games. For now, there are very few routes:

  1. Find a way to make the SDL or Vulkan context use Wayland. Trying to run games with SDL_VIDEODRIVER=wayland is a good starting point but expect everything to break.
  2. Go into Settings and temporarily revert the scale factor to 100% before starting Steam or the game's launcher to have the game detect the native resolution.
  3. There is supposedly a way to get aorund this limitation with Gamescope, but I have had no success so far.

Minecraft

Minecraft can take advantage of vulkanmod to work natively on Wayland. I recommend using Prism Launcher. Note that using Vulkanmod might result in more crashes than usual.

Factorio

Factorio can be made use Wayland with the SDL_VIDEODRIVER=wayland environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment