mirror of
https://github.com/JustAResearcher/gpu-unlock-ada.git
synced 2026-12-03 20:45:57 +07:00
[PR #113] Load gpu_unlock from init-top on initramfs-tools, before udev coldplug #116
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JustAResearcher/gpu-unlock-ada#116
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/JustAResearcher/gpu-unlock-ada/pull/113
Author: @steppergg
Created: 10/29/2026
Status: 🔄 Open
Base:
main← Head:initramfs-tools-init-top📝 Commits (1)
f19bcb5Load gpu_unlock from init-top on initramfs-tools, before udev coldplug📊 Changes
4 files changed (+78 additions, -1 deletions)
View changed files
📝
Makefile(+2 -0)📝
README.md(+5 -1)➕
packaging/boot/initramfs-tools-init-top(+30 -0)📝
tests/test_packaging.py(+41 -0)📄 Description
Fixes #112.
Problem
On initramfs-tools hosts where
nvidia.kois in the image (Ubuntu'sframebuffer-nvidiahook copies it), every boot logsgpu_unlock: unlock failed (-16)./initrunsrun_scripts /scripts/init-top(line 222 in current initramfs-tools) beforeload_modules(line 227), andinit-top/udevcoldplugs the GPU. nvidia autoloads by its PCI alias and binds the card before themodules.dlist is read. mkinitcpio and dracut load their lists before coldplug, so they aren't affected.Change
The Debian package also installs
/usr/share/initramfs-tools/scripts/init-top/00-gpu-unlock, which runsmodprobe gpu_unlock. Themodules.dlist already loads the module on every boot; this only loads it earlier. Targets set on the command line or inmodprobe.dbehave as before, and without targets it does nothing. A failed modprobe is logged to kmsg and never stops the boot.Ordering:
mkinitramfscallscache_run_scriptsfromhook-functions, which writes the init-topORDERfile fromget_prereq_pairs | tsort. That code is the same in Debian upstream and in Ubuntu 24.04's0.142ubuntu25.8(hook-functionslines 954–982). Both GNU tsort and uutils tsort (the defaulttsorton Ubuntu 25.10+) emit scripts without prerequisites in name order, so00-gpu-unlock(no prereqs) runs ahead ofudev. Themodules.ddrop-in stays, since it is what puts the module and its firmware in the image.No softdep, in line with the README: the order still comes from the initramfs.
Testing
tests/test_packaging.py:sh -npasses andprereqsprints nothing;00-gpu-unlockfirst;gpu_unlockand exits 0 even when modprobe fails.set_initlistandget_prereq_pairsfrom current initramfs-tools (b6795cf) against an installed tree withudev,plymouth(PREREQ=udev) andkeymap. The order came out00-gpu-unlock keymap udev plymouth.10de:2705, Ubuntu 24.04.5, initramfs-tools 0.142ubuntu25.8, kernel 7.2.13, driver 615.78.08), with theirmodprobe.dsoftdep workaround removed first and a full cold boot (comment):lsinitramfslistsscripts/init-top/00-gpu-unlock,ORDERputs it first and beforeudev, dmesg showsgpu_unlock: unlockedbefore nvidia loads,unlock failedcount 0,read_sm_rates.pyreadsfmla32: 0, andmma_benchshows FP32-accumulate at full rate.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.