Skip to content

Eliminate early KMS usage in favor of proper systemd chainload - #236

Merged
vnepogodin merged 1 commit into
masterfrom
poc-remove-early-kms
Sep 27, 2026
Merged

vnepogodin merged 1 commit into
masterfrom
poc-remove-early-kms

Conversation

@ventureoo

@ventureoo ventureoo commented Mar 28, 2026 •

Copy link
Copy Markdown
Member

I’ve always considered early KMS as a workaround for issues with race conditions when loading between driver and display manager/graphics environment. Here is another approach, that allows us to solve this "right" in my opinion, as it simply ties graphics services (getty/display-manager) to wait for all graphic drivers. To do this, we ship generator that creates drm-module-load.target at runtime which injects dependencies for all GPU drivers of current hardware and a udev rule that activates it if module loading is successful. If load failed, that’s okay, we have JobTimeoutSec, which allows drm-module-load.target to fail but load the rest of the services that depend on it (as Wants= implies soft dependencies).

To avoid breaking the work plymouth, we should switch to using simple-drm (that is, specify UseSimpledrm=1 in /etc/plymouth/plymouthd.conf, I thought this should be done on the calamares side). This is what Fedora does and it seems normal for them, see: https://fedoraproject.org/wiki/Changes/PlymouthUseSimpledrm

This will certainly require careful testing by other users, but from my testing, it works pretty well. The main advantage is the absence of bloated initramfs, which often becomes an obstacle for configurations with Btrfs snapshots and a separate /boot, as we now do when using limine-snapper-sync, which led us to decide to use ESP partition size 4 Gb by default, which I find excessive.

Fixes: CachyOS/cachyos-calamares#250 #262 CachyOS/distribution#529

@ventureoo
ventureoo force-pushed the poc-remove-early-kms branch from 2d7012b to b328f81 Compare March 31, 2026 21:47
@ventureoo
ventureoo force-pushed the poc-remove-early-kms branch from b328f81 to c1e08d3 Compare August 9, 2026 15:48
@ventureoo ventureoo changed the title PoC: profiles/nvidia: Eliminate early KMS usage in favor of proper systemd chainload Eliminate early KMS usage in favor of proper systemd chainload Aug 9, 2026
@ventureoo
ventureoo marked this pull request as ready for review September 10, 2026 11:25
@ventureoo

Copy link
Copy Markdown
Member Author

Undrafted, cachyos-drm-awaiter was merged and it's ready for testing.

@mati865

mati865 commented Sep 15, 2026 •

Copy link
Copy Markdown

To avoid breaking the work plymouth, we should switch to using simple-drm (that is, specify UseSimpledrm=1 in /etc/plymouth/plymouthd.conf, I thought this should be done on the calamares side). This is what Fedora does and it seems normal for them, see: fedoraproject.org/wiki/Changes/PlymouthUseSimpledrm

According to Arch Wiki SimpleDRM is default, and indeed Plymouth still works after I removed kms hook and nvidia modules from mkinitcpio.
My initramfs+vmlinuz is 39 MiB total. Tested with nvidia-open-dkms 610.57.04 drivers.

EDIT: Obviously, I had installed cachyos-drm-awaiter.

@ventureoo

Copy link
Copy Markdown
Member Author

According to Arch Wiki SimpleDRM is default, and indeed Plymouth still works after I removed kms hook and nvidia modules from mkinitcpio.

UseSimpledrm option is not enabled by default itself (https://gitlab.freedesktop.org/plymouth/plymouth/-/blob/26.134.222/src/main.c?ref_type=tags#L347-348), but yeah, if there's no any another DRM driver inside initramfs, simpledrm will be used anyway. The reason to use UseSimpledrm option is to stop plymouth waiting for another DRM drivers: https://gitlab.freedesktop.org/plymouth/plymouth/-/blob/26.134.222/src/libply-splash-core/ply-device-manager.c#L349-358.

Anyway, thank you for testing!

@ventureoo

Copy link
Copy Markdown
Member Author

Since cachyos-drm-awaiter with latest updates now can generate dependencies for any GPU drivers, not only for main vendors, there's no point in listining it in every profile, so this PR will remove only early kms usage from hooks.

@vnepogodin

Copy link
Copy Markdown
Member

It would make more sense to install drm/gpu related package as part of chwd gpu profile install

Servers wouldnt need drm awaiter

@ventureoo

Copy link
Copy Markdown
Member Author

It would make more sense to install drm/gpu related package as part of chwd gpu profile install

Servers wouldnt need drm awaiter

Okay, I returned it back to chwd.

@vnepogodin vnepogodin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvidia-dkms-580xx.prime missed

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
@ventureoo

Copy link
Copy Markdown
Member Author

nvidia-dkms-580xx.prime missed

Indeed, done.

@vnepogodin vnepogodin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QR codes go brrrrr

@vnepogodin
vnepogodin merged commit ea6252d into master Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plymouth doesn't work after a new install, amdgpu isn't added into mkinitcpio.conf

3 participants