mirror of
https://github.com/Zagitta/gpu-unlock.git
synced 2026-12-03 19:44:49 +07:00
[PR #314] Guix System port: native module package + boot-time shepherd one-shot #288
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Zagitta/gpu-unlock#288
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/Zagitta/gpu-unlock/pull/314
Author: @Paulr13
Created: 11/6/2026
Status: 🔄 Open
Base:
main← Head:guix-port📝 Commits (2)
523e4f3Guix System port: native module package + boot-time shepherd one-shot1a4f83cCurate for upstream: generic example config, de-personalized docs📊 Changes
4 files changed (+441 additions, -0 deletions)
View changed files
➕
guix/channels.scm(+18 -0)➕
guix/config-example.scm(+169 -0)➕
guix/gpu-unlock.scm(+150 -0)➕
guix/integration.md(+104 -0)📄 Description
Adds a native Guix System port of gpu-unlock under
guix/:gpu-unlock.scm— Guile package module exportingmake-gpu-unlock-module(out-of-tree kernel module built withlinux-module-build-systemagainst the exact nonguix kernel the system uses) andgpu-unlock-firmware(the 16 assets the module requests, extracted from the pinned NVIDIA 610.43.03 sources by the repo's ownfirmware/extract_gsp.py+firmware/extract_boot_assets.py).config-example.scm— add-to-your-config fragment carrying the complete, boot-proven shepherd one-shot.channels.scm— example pinned channels + themake-channel-introductionnote needed for pinned-commit authentication.integration.md— design notes, deployment recipe, verification, benchmarks.No initrd changes: nonguix binds the NVIDIA driver via udev coldplug, so the port blacklists
nvidia*on the kernel command line and loads everything from a rootfs-stage shepherd one-shot in deterministic order. The module stays a no-op unlessgpu_unlock.targets=allis on the cmdline (rollback = delete the flag or boot the previous generation).Two lessons from this port generalize beyond Guix and are what the config encodes:
modprobein a service context cannot see the kernel's modules on a GNU Guix System. Modules live under/run/booted-system/kernel/lib/modules/$(uname -r), not/lib/modules. SettingLINUX_MODULE_DIRECTORYfrom inside the service lambda proved unreliable, so the one-shot passes-d /run/booted-system/kernelon every modprobe call — works with stock kmod./dev/nvidia*at boot (including nvidia-powerd and shepherd-managed llama/OmniVoice-style servers) holds the driver: uvm's dependency blocks unloading nvidia, the eject never happens, andgpu_unlockstill loads with rc=0 — a silent no-op. The fix is ordering: the unlock service runs a/procfd-holder sweep (TERM → KILL → survivor report) before the eject, and every CUDA-consuming service plus the power-cap service getgpu-unlock-loadadded to their shepherdrequirementlists.Tested on 3 Guix hosts (2× RTX 3090 each), kernels 7.1.8 and 7.2.15, driver 580.178.04, boot-persistent across repeated reboots with the full log sequence clean:
stage=claim/gfwwithss0=0x88888888per GPU before the driver bindsTwo additional hosts on this port use it in production serving llama.cpp inference with 24 GB resident per GPU; outputs are bit-identical to stock (the module only writes the speed-select registers + FLRs before the driver binds; stock throttling/power management is untouched).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.