fix: slim initramfs for nvidia systems - #4768
Conversation
Up to standards ✅🟢 Issues
|
|
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. |
tested this and im getting initramfs of 179mb. Fix could probably be better but for now it won;t be a show stopper |
|
How big is your boot? I'm wondering if we should set that to 2GB if we haven't already. |
|
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? |
|
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. |
|
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? |
|
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. |
|
#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.
Why is there nvidia firmware when there are no drivers in the intel/amd version |
|
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.
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. |
yes, dual GPU systems like laptops are of course supposed to work |
|
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? |
Up to standards ✅🟢 Issues
|
|
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 . |
|
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? |

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