Skip to content

fix: slim initramfs for nvidia systems - #4768

Open
bashilias wants to merge 5 commits into
ublue-os:mainfrom
bashilias:fix/4764-nvidia-slim-initramfs
Open

fix: slim initramfs for nvidia systems#4768
bashilias wants to merge 5 commits into
ublue-os:mainfrom
bashilias:fix/4764-nvidia-slim-initramfs

Conversation

@bashilias

Copy link
Copy Markdown
Contributor

fix for #4764

draacut drop in for nvidia images that enables zstd compression and skips drivers that arent needed for nvidia systems.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area/nvidia Issues specific to NVIDIA GPU support, drivers, and compatibility kind/enhancement New feature, don't implement without a spec and consensus labels Jun 16, 2026
@codacy-production

codacy-production Bot commented Jun 16, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@bashilias bashilias changed the title added: dracut drop in for nvdia images. Dropping amd and intel drivers fix: slim initramfs for nvidia systems Jun 16, 2026
@bashilias

Copy link
Copy Markdown
Contributor Author

compression is working, down to 214mb but amdgpu.ko.xz and i915.ko.xz are still in the initramfs despite omitting the drivers because 99-nvidia.conf uses force_drivers which overrides omit_drivers i believe going to get rid of the drivers with sed.

@bashilias

Copy link
Copy Markdown
Contributor Author
  1. sed strips i915, amdgpu, radeon, xe, nouveau from force_drivers in 99-nvidia.conf
  2. zz-nvidia-slim.conf (loads last, alphabetically after 99-nvidia.conf) adds omit_drivers for those same drivers and upgrades compression to zstd -19 -T0.

tested this and im getting initramfs of 179mb. Fix could probably be better but for now it won;t be a show stopper

@castrojo

Copy link
Copy Markdown
Collaborator

How big is your boot? I'm wondering if we should set that to 2GB if we haven't already.

@renner0e

Copy link
Copy Markdown
Member

The issue you mentioned is a problem on bluefin lts, you are on the wrong repo, development has also moved to the projectbluefin org.

Correct me if I'm wrong but wouldn't this break amd/Intel systems that are on the Nvidia image?

People switching from Nvidia to amd and never rebasing to the proper image and systems on external drives that are supposed to be used on Nvidia and everything else comes to mind.

What about dual GPU systems?

@bashilias

Copy link
Copy Markdown
Contributor Author

valid concern, users with Nvidia gpu switching to amd without rebasing to the non-nvidia image will get a broken boot. . Maybe increasing the boot size is the better solution but existing installs with 1 GB /boot don't benefit from a partition size change, they'd still need a workaround. But that's a smaller population than the risk of breaking dual gpu users.

@bashilias

Copy link
Copy Markdown
Contributor Author

Another solution would be just adding compression instead of getting rid of the drivers.

@renner0e

renner0e commented Jun 16, 2026

Copy link
Copy Markdown
Member

Another solution would be just adding compression instead of getting rid of the drivers.

How much of an actual difference does it make if you just crank the compression level to the max and nothing else. Any noticable speed differences?

@bashilias

bashilias commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

tested compression only. It only saves a few mb (<10mb) since the firmware blobs are already pre compressed. Driver removal is the only real fix (345mb > 179mb) for the size issue but raises valid dual GPU concerns. This compression can be implemented for now but as @castrojo said the boot also needs to be increased, however it won't help current installs. The -19 compression level only adds a bit of build time on CI, boot speed is unaffected since zstd decompression is the same at all levels.

@mhetzi

mhetzi commented Jun 16, 2026

Copy link
Copy Markdown

#3354 can you add a fix for non nvidia images too? because on my system the boot partition is 2GB.

The initramfs with all these firmware blobs is simply too big for some EFI systems.

image

Why is there nvidia firmware when there are no drivers in the intel/amd version

@bashilias

Copy link
Copy Markdown
Contributor Author

Thinking about this more, for dual gpu laptops (Nvidia + Intel iGPU), i915 isn't actually needed in the initramfs. The initramfs only runs long enough to mount the real rootfs, display is handled by the Nvidia driver via nvidia-drm.modeset=1. i915 loads from the real rootfs afterwards anyway.
The real question for the maintainers is; what is the nvidia image actually targeting?

  • Dedicated Nvidia workstations ? driver removal is safe,
  • Also Nvidia+Intel hybrid machines?

We cna keep the driver removal fix, its probably safe even for hybrid GPU systems, remove only AMD drivers (amdgpu/radeon), and keep i915/xe for hybrid laptop safety or bump /boot to 2GB in installer, but @mhetzi shows even 2GB isn't always enough..

Long term; might have to think about per-variant initramfs so each image only carries its own GPU firmware.

@renner0e

Copy link
Copy Markdown
Member

Also Nvidia+Intel hybrid machines?

yes, dual GPU systems like laptops are of course supposed to work

@bashilias

Copy link
Copy Markdown
Contributor Author

The root cause is hostonly=no which is set deliberately for atomic images, meaning all gpu firmware gets bundled regardless of variant. Compression doesn't help since the firmware blobs are already pre compressed individually. Even increasing /boot won't scale as firmware keeps growing with new gpu generations. The only sustainable fix is per variant initramfs where each image only ships firmware for its own gpu family.

For the nvidia image this means removing amdgpu, radeon and nouveau but keeping i915 and xe for Nvidia+Intel hybrid laptops. For the non-nvidia image it means removing nvidia firmware which would fix the issue @mhetzi raised. Each image ends up carrying only what it needs. Switching gpus would require rebasing to the correct image which is already the expected workflow in the atomic model. Want to go this route?

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 17, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@bashilias

Copy link
Copy Markdown
Contributor Author

i updated the fix to also remove nvidia firmware from non nvidia images. results; nvidia image 327MB to 194MB (kept i915/xe for hybrid laptops), non nvidia image 236MB to 134MB. This should fix the issues raised by @mhetzi and @renner0e .
existing installs wont benefit automatically, they need to rebase or regenerate initramfs manually.

@castrojo

castrojo commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Ok here's an idea, we have projectbluefin/bluefin:stable and :testing going now, why don't we just put it in testing, this let's people opt in and you can just let it rip, we're migrating people there eventually anyway.

Might be a good time to get fresh ideas in too?

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

Labels

area/nvidia Issues specific to NVIDIA GPU support, drivers, and compatibility kind/enhancement New feature, don't implement without a spec and consensus size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants