mirror of
https://github.com/Zagitta/gpu-unlock.git
synced 2026-12-03 19:44:49 +07:00
[PR #57] vbios_610: round FWSEC dmem_size up to 256 (fixes -EINVAL unlock abort on GA106 RTX 3060) #135
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Zagitta/gpu-unlock#135
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/57
Author: @536138283
Created: 10/24/2026
Status: 🔄 Open
Base:
main← Head:fix-ga106-dmem-align📝 Commits (1)
7e423f8vbios_610: round FWSEC dmem_size up to 256 for GA106📊 Changes
1 file changed (+10 additions, -0 deletions)
View changed files
📝
kernel/gpu_unlock/vbios_610.c(+10 -0)📄 Description
Problem
On an RTX 3060 (GA106,
10de:2544) the unlock aborts with-EINVALand leaves thecard unbindable, so
nvidiathen fails to probe it in a tight retry loop (593 timesin my boot) and the GPU is unusable until the machine is powered off:
Note
0x2544is already insupported_ids, so this is not a device-ID gap.Root cause
falcon_dma_valid()requires every DMA size to be a multiple of 256, because thefalcon DMA engine moves 256-byte units (
falcon_dma()advancesdone += 256):descriptor()roundsimage_sizeup to 256:but passes
dmem_sizethrough verbatim:This board's FWSEC descriptor reports
dmem_size = 0x980(2432 = 9x256 + 128), whichis not 256-aligned, so
falcon_hs()rejects its own arguments atunlock_610.c:364and returns
-EINVALbeforefalcon_reset(). The firmware therefore never runs atall, but
work->firmware_startedhas already been set by the caller and bus masteringis on, so the module conservatively keeps the DMA buffers and the card stays claimed.
GA102 boards report
dmem_size = 0x800(already aligned) — which is exactly whattests/test_vbios_610.c:108asserts:so this path is never exercised on the cards the unlock was developed against.
Fix
Round
dmem_sizeup to 256 the same wayimage_sizealready is, with the sameoverflow guard.
The rounded size stays in bounds on this board, exactly:
range(image_size, data_off, dmem_size)allows equality (bytes > length - off), andmemcpy(image, rom + fw.image_off, fw.image_size)has already copied the full roundedimage, so the extra
0x80bytes the DMA covers are real ROM content already inside theallocated buffer — not an out-of-bounds read. The three other
dmem_sizebounds checksin
descriptor()only become more permissive:range(image_size, data_off, dmem_size)0xe300 + 0xa00 = 0xed00 <= 0xed00range(dmem_size, pkc_off, 384)0x724 + 0x180 = 0x8a4 <= 0xa00range(dmem_size, interface_off, 4)0x20 <= 0xa00Verification
make testpasses, including the C component tests. The GA102 assertion above isunaffected because
0x800is already aligned.With the patch the unlock completes on this card:
nvidiathen binds normally (0 probe failures), and the card is fully usable.Scope of what I verified: the unlock path completes, both speed selectors hold
their unlocked values across the FLR, and the card works normally afterwards. I have
not benchmarked FP16/BF16/TF32 throughput on this box (no PyTorch installed), so I
am not claiming a TFLOPS figure here — only that the
-EINVALabort is fixed and theselectors are written as intended.
Test system
10de:2544rev a1, subsystem1043:8a8f94.06.54.00.2F0xb76000a1af28cbbHappy to gather more data or test revisions on this card if useful. Other GA106 boards
reporting a non-aligned
dmem_sizeshould be fixed by the same change, but0x2544isthe only one I can test.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.