Custom Fedora OCI images for Framework laptops

Not advocating rebasing on a system you’re afraid to change, however, this would be worth a read: https://universal-blue.org/introduction/

Silverblue needs extra stuff to match Ublue. And, for Intel 13th Gen users, we have our own image thanks to the Ublue team- nothing extra needed.

1 Like

I’d like to try out bluefin on my AMD Framework 13. Would it be better to install the base image or the Framework (albeit Intel optimized) image?

Yeah probably stick to the non-Framework image on the AMD one, though let me know if there’s specific tweaks you need!

1 Like

It seems that currently the kernel parameter amdgpu.sg_display=0 is at least somewhat helpful in mitigating graphical corruption issues that occur with AMD. Not sure if that is possible to add.

I just sent in a pull request to add it! We’ll split the setup commands into -intel and -amd specifically. (I’ll update the docs later today)

Also filed this issue for the headphone jack if someone wants to take a stab at it!

3 Likes

@Jorge_Castro ; power-profiles needs an out of tree patch if you don’t want to use one of the alternative fixups - details in this thread:

You can blacklist userpsace govt which sorta fixes it - my kernel cli looks like:

amd_pstate=active amdgpu.ppfeaturemask=0xffffffff amdgpu.sg_display=0 cpufreq.default_governor=powersave initcall_blacklist=cpufreq_gov_userspace_init,cpufreq_gov_performance_init

1 Like

amdgpu.ppfeaturemask=0xffffffff

Be careful with this; the default feature mask upstream is intentional.

amd_pstate=active

This is controlled by a Kconfig option. Unless it’s been changed in your kernel config it’s unnecessary.

amdgpu.sg_display=0

If you’re affected by an issue that needs this, can you please try turning off PSR (amdgpu.dcdebugmask=0x10) and see if that helps it instead? If so; that’s a much better workaround until the underlying issue is fixed.

1 Like

There are a couple of other things :slight_smile:

pcie_aspm=force pc
ie_aspm.policy=powersupersave

should also be in there for decreased power draw. And yeah one of the fixups to make sure power is set for the energy performance profile (hopefully cpupower gets support for setting this natively soon).

And yeah the amdgpu mask exposure hasn’t seemed to break things for me at all (i get little to no difference with or without it through multiple different kernels)

I believe I read somewhere amd is working on a better way of handling gpu power features than what the current system allows for anyway, so at some point hopefully it isn’t needed. At the moment it’s primarily useful on desktop GPU’s - corectl seems to expose the same bits on the phoenix apu with or without it.

@Mario_Limonciello ; what is amdgpu.dcdebugmask=0x10 doing?

I understand scatter gather disabling vaguely.

My issues seemed to be preceded by related to a iommu/VI extension errors ; and resulted in graphical lockups during power state changes (resume/sleep) where I would get a whited out screen. I’ll try with the debug mask you suggested and see how It goes. But if you could elucidate on that flag a bit, would be super appreciative.

pcie_aspm=force pcie_aspm.policy=powersupersave

These can be a bit too aggressive. I would watch out for PCIe instability or decreased NVME or Wifi performance. If they are stable, it’s best for Framework to adjust the default policies in the BIOS rather than the “big hammer” in Linux like that.

I understand scatter gather disabling vaguely.

This forces all memory allocations to go into VRAM instead of GTT. Turning up the VRAM values in BIOS has a similar effect because more allocations can go into VRAM.

@Mario_Limonciello ; what is amdgpu.dcdebugmask=0x10 doing?

It disables the panel self refresh feature in the Display Core (DC) part of the driver. You can find some high level descriptions in DisplayPort - Wikipedia along with some better links that are more in depth.

In the public AMD bug tracker there are a number of issues open and reported about PSR that are still under investigation, but none of them have been reported on Framework (IIRC) so I’d like to understand if this folds into those issues or is something completely separate.

1 Like

Yeah - I haven’t noticed anything ‘so far’ with the aspm options set. I got major issues withe the nvme_noacpi option that was suggested in the tlp thread. Including hard lockups and btrfs corruption… so yeah. Will see.

Ideally the ASPM profile should be set by ppd for battery/ac I would imagine.

@Mario_Limonciello ; Ok so the Whited-out screen on resume has returned with the amdgpu.dcdebugmask=0x10 suggestion in lieu of amdgpu.sg_display=0

reverting to Scatter Gather disabling for the moment.

Interesting new error that I am seeing in addition to the IOMMU ones previously posted is the attached. I believe there is something about atomic operations changing in drm layer at the moment and this is likely as i’m running 6.7 which has a bunch of amdgpu related patches and mesa 24.

2 Likes

Thanks for confirming it’s not linked to PSR.

1 Like

I haven’t had these since adding my user to the video group.

1 Like

Hey folks,

I wanted to share that I have been running my own custom Kinoite image for the Framework 13 AMD. It’s still a work in progress, but it is at a pretty decent state thus far. This is not meant to be an official distribution per se, but thought I would share what I did with the group in case it’s helpful. It is based off of the awesome work that the universal blue team has done creating the Kinoite-main image. Huge thanks to Jorge for this project.

Copied from my repo:

Changes to Kinoite-Main Image

  • Add PCIE and USB power saving configurations to /etc/udev/rules.d/
  • Add wifi power saving configuration to /etc/sysctl.d/
  • Add wifi power saving configuration for intel wifi to /etc/udev/modprobe.d/
  • Add AMD s2idle and psr debugging scripts to /usr/share/ublue-os/scripts
  • Add udev rules to change AMD EPP Hints on AC Power / Battery
  • Add sysctl.d rules for vm.dirty_writeback_centisecs and kernel.nmi_watchdog parameters for power saving
  • Make scripts / kernel parameters available via just script
    • just fw13-amd to update default kernel parameters (cpufreq.default_governor=powersave, pcie_aspm.policy=powersupersave)
    • just check_sleep to run amd_s2idle.py debug script
    • just check_psr to run psr.py debug script
    • just epp_power to set AMD EPP Hints to Power Saving
    • just epp_balance_power to set AMD EPP Hints to Balance Power
    • just epp_balance_performance to set AMD EPP Hints to Balance Performance
    • just epp_performance to set AMD EPP Hints to Performance
  • Install powertop, kernel-tools, fprintd, fwupd, tailscale, 1password and other apps by default
  • Install AMDGPU_TOP by default
  • Make some commonly installed Flatpaks available to install on first boot, these are completely optional

After first install be sure to run just fw13-amd to set the kernel parameters. If you want the ideal power saving mode run just epp_power to set the power saving mode. If you want to switch back to balanced use just epp_balance_power. This is needed because power-profiles-daemon does not set these properly which significantly contributes to poor battery life on linux by default.

I didn’t run any of the other kernel params (disable scatter gather / iommu, etc) since I didn’t see a need for it myself yet.

Running this image on power saving mode, I can get ~3.5-4 watts at idle, ~6.3 watts during offline video playback. And ~5-8 watts web browsing. The main goals of the image were to create optimized defaults. A lot of the power saving tweaks are what tlp would have done, and are also taken from Archwiki.

The Github repo has the instructions to switch to this image. You can always switch back or to another, which is the beauty of ostree systems. Happy to accept any tweaks or best practices I have missed as I am still new to this. Obviously it’s also forkable / modifiable if you want to use it as a reference for your own image.

7 Likes

Awesome! Appreciate the share!

1 Like

Hah this is so awesome! Thanks for sharing this!

2 Likes

got bluefin up and running on my FW13 AMD - really like it so far!
the only thing that is not working out of the box is the fingerprint scanner. is there anything special to do on the immutable system?

downloaded the cab file from: Updating Fingerprint Reader Firmware on Linux for 13th Gen and AMD Ryzen 7040 Series Laptops

tried to install it with fwupdtool, but it fails:

 sudo fwupdtool install --allow-reinstall --allow-older goodix-moc-609c-v01000330.cab 1e8c8470-a59c-571a-82fd-19c9fa32b9c3
Laden …                  [********                               ]11:58:06.743 FuEngine             failed to add device /sys/devices/pci0000:00/0000:00:08.1/0000:c1:00.0: ioctl error: Ungültige Adresse [14]
Laden …                  [***********                            ]11:58:08.722 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.722 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
Laden …                  [************                           ]11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
Laden …                  [************                           ]11:58:08.723 FuUdevDevice         fu_udev_device_get_sysfs_path: assertion 'FU_IS_UDEV_DEVICE(self)' failed
11:58:08.723 FuDevice             fu_device_add_parent_backend_id: assertion 'backend_id != NULL' failed
Schreiben …              [*******************                    ]
Ausgewähltes Gerät: Fingerprint Sensor
Entpacken …              [ -                                     ]
generic GUID requires a CHID, child, parent or sibling requirement

The problem is the CAB file doesn’t express the requirements appropriately for which systems it can apply to. This is a requirement with newer fwupd versions. Framework needs to respin it.

See [RESPONDED] Fedora 39 Kinoite Fingerprint Reader Not Working - #3 by Mario_Limonciello for more details.

3 Likes