[GH-ISSUE #17] Compatibility report: works inside a Proxmox VM (vfio-pci passthrough), Ubuntu 22.04 guest / kernel 5.15, 2x RTX 3090 — +65% FP16, +66-67% BF16, +72-74% TF32 GEMM (5.15 build fix included) #15

Closed
opened 2026-10-26 16:39:12 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @Filaind on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Zagitta/gpu-unlock/issues/17

Compatibility report for a setup not covered yet: 2x RTX 3090 passed through to a Proxmox VM with vfio-pci, with gpu-unlock running inside the guest. The guest is Ubuntu 22.04 with kernel 5.15, which needs a small build fix (patch below).

Result: both cards log gpu_unlock: unlocked, the NVIDIA driver binds normally in the guest, and there are no Xid/NVRM errors in the guest kernel log. Dense GEMM: +65% FP16, +66-67% BF16, +72-74% TF32, with no power cap (420 W).

System

  • GPUs: 2x GeForce RTX 3090 (Palit), 10de:2204, subsystem 1569:f278, VBIOS 94.02.42.00.9D, power limit 420 W. PCIe Gen3 x8 each (both cards in a consumer X370 board). Host reset_method is flr bus.
  • Host: Ryzen 9 3900X, ASUS PRIME X370-PRO (BIOS 6232).
  • Hypervisor: Proxmox VE 9.2.2, kernel 7.0.2-6-pve. Cards bound to vfio-pci via options vfio-pci ids=10de:2204,10de:1aef. Nothing is installed on the host.
  • VM: q35, SeaBIOS, cpu: host, hostpci0: 0000:08:00,pcie=1 and hostpci1: 0000:09:00,pcie=1. In the guest the cards are at 0000:01:00.0 and 0000:02:00.0.
  • Guest: Ubuntu 22.04.5, kernel 5.15.0-198-generic, NVIDIA open kernel module 610.57.04 (from the .run installer, DKMS), dkms 2.8.7. No Secure Boot.
  • gpu-unlock: a9b0c75 (current main). Kernel cmdline: gpu_unlock.targets=all.

Why inside the guest, not on the host

I did not try installing on the host, for this reason. When the VM starts, the host log shows each GPU reset together with its audio function (08:00.0 and 08:00.1 reset at the same moment). That looks like a secondary bus reset: the audio function has no FLR, so QEMU falls back to a hot reset of the bus. As I understand it, the unlock is only designed to survive an FLR, so a host-side unlock would probably be wiped on every VM start (not tested).

Inside the guest it works because vfio-pci virtualizes the FLR. When the module calls pcie_flr() in the guest, the host log shows a reset of function 0 only (vfio-pci 0000:08:00.0: resetting / reset done, the same for 09:00.0), i.e. a real FLR. The selectors survive it:

pci 0000:01:00.0: entry: plm=0xffffff8f ss0=0x45207131 ss1=0x7 wpr2_hi=0x0
pci 0000:01:00.0: pre-FLR selectors: ss0=0x88888888 expected=0x88888888 ss1=0x8 expected=0x8
pci 0000:01:00.0: PCIe FLR returned: result=0
pci 0000:01:00.0: post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008
pci 0000:01:00.0: gpu_unlock: unlocked

The second card (02:00.0) logs the same (entry ss0=0x60521132 ss1=0x6). Both cards also log poll timeout tolerated and Falcon pre-reset timeout tolerated per HW bug 3419321 twice; as in #15, this looks informational.

No host power cycle was needed. A full VM stop/start (qm reboot) was enough to get a clean entry state (plm=0xffffff8f, wpr2_hi=0x0) on both cards, even though the cards had been used by the NVIDIA driver in the previous VM boot.

Install notes

  • Kernel 5.15 build fix: linux/aperture.h doesn't exist before 6.0, so unlock_610.c doesn't build on 5.15. I used the fbdev helper remove_conflicting_pci_framebuffers() (exported in 5.15) on older kernels. On a passthrough card in a VM there is no firmware framebuffer anyway, but the fallback keeps the efifb/vesafb case covered:
diff --git a/kernel/gpu_unlock/unlock_610.c b/kernel/gpu_unlock/unlock_610.c
index 5a93a8a..4f861dc 100644
--- a/kernel/gpu_unlock/unlock_610.c
+++ b/kernel/gpu_unlock/unlock_610.c
@@ -4,7 +4,12 @@
  * the board ROM, Booter with the V67 signature, the SS0/SS1 selector writes, then
  * FLR so the stock driver starts from a clean, halted GSP.
  */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
 #include <linux/aperture.h>
+#else
+#include <linux/fb.h>
+#endif
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/firmware.h>
@@ -1309,7 +1314,12 @@ static int unlock_transaction_reset(struct unlock_transaction_work *work)
 	 * efifb) on this card must go first; nvidia-drm replaces it later. This
 	 * does nothing on a card without one.
 	 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
 	ret = aperture_remove_conflicting_pci_devices(work->pdev, "gpu_unlock");
+#else
+	/* No linux/aperture.h before 6.0; the fbdev helper covers efifb/vesafb. */
+	ret = remove_conflicting_pci_framebuffers(work->pdev, "gpu_unlock");
+#endif
 	if (ret)
 		return GU_RESULT(ret);
 	dev_info(&work->pdev->dev, "PCIe FLR begin: BME=0 DMA retained, chip=%#x\n", chip);

(The unit tests compile unlock_610.c against the shims in tests/unlock_shim, so I ran make test on the unpatched tree and applied the patch only to the DKMS copy.)

  • Python 3.11+: firmware/fetch_artifacts.py uses hashlib.file_digest, which is 3.11+. Ubuntu 22.04 ships 3.10, so I ran make inputs firmware PYTHON=<python3.12>. All pinned SHA-256 checks passed, and make test passed (5/5).
  • Manual install: I used the same layout as the Debian package rather than make install-deb, because of the patch above and a pinned dkms 2.8.7. Firmware went to /usr/lib/firmware/gpu-unlock/610.43.03, the sources were added to DKMS as gpu-unlock/1.0.0, and I installed packaging/boot/initramfs-tools.conf as /usr/share/initramfs-tools/modules.d/gpu-unlock.conf, then ran update-initramfs -u. The rebuilt initramfs contains gpu_unlock.ko and all five firmware files.
  • Load order: the issue from #11 did not occur here. The Ubuntu 22.04 initramfs (MODULES=most) carries modules but not nvidia.ko, because the .run driver loads from the root filesystem. So the stock modules.d drop-in runs gpu_unlock before nvidia. The NVIDIA driver loaded about 1 s after unlocked.

Dense GEMM, 8192x8192

PyTorch 2.14.0+cu130 in the guest, torch.matmul, 5 warm-up runs, then 5 windows of 10 matmuls each, median TFLOPS timed with CUDA events. allow_fp16_reduced_precision_reduction and allow_bf16_reduced_precision_reduction were set to False (FP32 accumulation), and TF32 was enabled explicitly with allow_tf32. Power limit 420 W on both cards in both runs.

Precision GPU 0 stock -> unlocked GPU 1 stock -> unlocked
FP16 76.8 -> 126.4 (+65%) 76.4 -> 126.1 (+65%)
BF16 77.5 -> 129.6 (+67%) 76.9 -> 127.4 (+66%)
TF32 40.2 -> 69.8 (+74%) 40.2 -> 69.0 (+72%)

Numerics (unlocked only): relative Frobenius error against an FP64 reference on a 4096x4096 random product: FP16 3.60e-4, BF16 2.88e-3, TF32 2.94e-4. Both GPUs gave identical figures. These are normal for the input precisions, but I did not run the same check in the stock run, so this is not a stock-vs-unlocked parity test like #15.

Caveats

  • One boot per run. The stock numbers come from the previous VM boot, which had been up for days; ComfyUI was idle but kept about 11 GB of VRAM allocated per card. The unlocked numbers come from a fresh boot.
  • Only synthetic GEMM so far. I haven't measured the real workload (ComfyUI video diffusion) yet.
  • Not tested: installing on the Proxmox host instead of the guest, S3 suspend, long-term stability.
Originally created by @Filaind on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Zagitta/gpu-unlock/issues/17 Compatibility report for a setup not covered yet: **2x RTX 3090 passed through to a Proxmox VM with vfio-pci, with gpu-unlock running inside the guest.** The guest is Ubuntu 22.04 with kernel 5.15, which needs a small build fix (patch below). **Result:** both cards log `gpu_unlock: unlocked`, the NVIDIA driver binds normally in the guest, and there are no Xid/NVRM errors in the guest kernel log. Dense GEMM: **+65% FP16, +66-67% BF16, +72-74% TF32**, with no power cap (420 W). ## System * **GPUs:** 2x GeForce RTX 3090 (Palit), `10de:2204`, subsystem `1569:f278`, VBIOS `94.02.42.00.9D`, power limit 420 W. PCIe Gen3 x8 each (both cards in a consumer X370 board). Host `reset_method` is `flr bus`. * **Host:** Ryzen 9 3900X, ASUS PRIME X370-PRO (BIOS 6232). * **Hypervisor:** Proxmox VE 9.2.2, kernel `7.0.2-6-pve`. Cards bound to `vfio-pci` via `options vfio-pci ids=10de:2204,10de:1aef`. **Nothing is installed on the host.** * **VM:** q35, SeaBIOS, `cpu: host`, `hostpci0: 0000:08:00,pcie=1` and `hostpci1: 0000:09:00,pcie=1`. In the guest the cards are at `0000:01:00.0` and `0000:02:00.0`. * **Guest:** Ubuntu 22.04.5, kernel `5.15.0-198-generic`, NVIDIA open kernel module `610.57.04` (from the `.run` installer, DKMS), dkms 2.8.7. No Secure Boot. * **gpu-unlock:** `a9b0c75` (current `main`). Kernel cmdline: `gpu_unlock.targets=all`. ## Why inside the guest, not on the host I did not try installing on the host, for this reason. When the VM starts, the host log shows each GPU reset **together with its audio function** (`08:00.0` and `08:00.1` reset at the same moment). That looks like a secondary bus reset: the audio function has no FLR, so QEMU falls back to a hot reset of the bus. As I understand it, the unlock is only designed to survive an FLR, so a host-side unlock would probably be wiped on every VM start (not tested). Inside the guest it works because vfio-pci virtualizes the FLR. When the module calls `pcie_flr()` in the guest, the host log shows a reset of **function 0 only** (`vfio-pci 0000:08:00.0: resetting` / `reset done`, the same for `09:00.0`), i.e. a real FLR. The selectors survive it: ``` pci 0000:01:00.0: entry: plm=0xffffff8f ss0=0x45207131 ss1=0x7 wpr2_hi=0x0 pci 0000:01:00.0: pre-FLR selectors: ss0=0x88888888 expected=0x88888888 ss1=0x8 expected=0x8 pci 0000:01:00.0: PCIe FLR returned: result=0 pci 0000:01:00.0: post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008 pci 0000:01:00.0: gpu_unlock: unlocked ``` The second card (`02:00.0`) logs the same (entry `ss0=0x60521132 ss1=0x6`). Both cards also log `poll timeout tolerated` and `Falcon pre-reset timeout tolerated per HW bug 3419321` twice; as in #15, this looks informational. **No host power cycle was needed.** A full VM stop/start (`qm reboot`) was enough to get a clean entry state (`plm=0xffffff8f`, `wpr2_hi=0x0`) on both cards, even though the cards had been used by the NVIDIA driver in the previous VM boot. ## Install notes * **Kernel 5.15 build fix:** `linux/aperture.h` doesn't exist before 6.0, so `unlock_610.c` doesn't build on 5.15. I used the fbdev helper `remove_conflicting_pci_framebuffers()` (exported in 5.15) on older kernels. On a passthrough card in a VM there is no firmware framebuffer anyway, but the fallback keeps the efifb/vesafb case covered: ```diff diff --git a/kernel/gpu_unlock/unlock_610.c b/kernel/gpu_unlock/unlock_610.c index 5a93a8a..4f861dc 100644 --- a/kernel/gpu_unlock/unlock_610.c +++ b/kernel/gpu_unlock/unlock_610.c @@ -4,7 +4,12 @@ * the board ROM, Booter with the V67 signature, the SS0/SS1 selector writes, then * FLR so the stock driver starts from a clean, halted GSP. */ +#include <linux/version.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) #include <linux/aperture.h> +#else +#include <linux/fb.h> +#endif #include <linux/delay.h> #include <linux/dma-mapping.h> #include <linux/firmware.h> @@ -1309,7 +1314,12 @@ static int unlock_transaction_reset(struct unlock_transaction_work *work) * efifb) on this card must go first; nvidia-drm replaces it later. This * does nothing on a card without one. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) ret = aperture_remove_conflicting_pci_devices(work->pdev, "gpu_unlock"); +#else + /* No linux/aperture.h before 6.0; the fbdev helper covers efifb/vesafb. */ + ret = remove_conflicting_pci_framebuffers(work->pdev, "gpu_unlock"); +#endif if (ret) return GU_RESULT(ret); dev_info(&work->pdev->dev, "PCIe FLR begin: BME=0 DMA retained, chip=%#x\n", chip); ``` (The unit tests compile `unlock_610.c` against the shims in `tests/unlock_shim`, so I ran `make test` on the unpatched tree and applied the patch only to the DKMS copy.) * **Python 3.11+:** `firmware/fetch_artifacts.py` uses `hashlib.file_digest`, which is 3.11+. Ubuntu 22.04 ships 3.10, so I ran `make inputs firmware PYTHON=<python3.12>`. All pinned SHA-256 checks passed, and `make test` passed (5/5). * **Manual install:** I used the same layout as the Debian package rather than `make install-deb`, because of the patch above and a pinned dkms 2.8.7. Firmware went to `/usr/lib/firmware/gpu-unlock/610.43.03`, the sources were added to DKMS as `gpu-unlock/1.0.0`, and I installed `packaging/boot/initramfs-tools.conf` as `/usr/share/initramfs-tools/modules.d/gpu-unlock.conf`, then ran `update-initramfs -u`. The rebuilt initramfs contains `gpu_unlock.ko` and all five firmware files. * **Load order:** the issue from #11 did not occur here. The Ubuntu 22.04 initramfs (`MODULES=most`) carries modules but not `nvidia.ko`, because the `.run` driver loads from the root filesystem. So the stock `modules.d` drop-in runs `gpu_unlock` before `nvidia`. The NVIDIA driver loaded about 1 s after `unlocked`. ## Dense GEMM, 8192x8192 PyTorch `2.14.0+cu130` in the guest, `torch.matmul`, 5 warm-up runs, then 5 windows of 10 matmuls each, median TFLOPS timed with CUDA events. `allow_fp16_reduced_precision_reduction` and `allow_bf16_reduced_precision_reduction` were set to `False` (FP32 accumulation), and TF32 was enabled explicitly with `allow_tf32`. Power limit 420 W on both cards in both runs. | Precision | GPU 0 stock -> unlocked | GPU 1 stock -> unlocked | |---|---:|---:| | FP16 | 76.8 -> 126.4 (+65%) | 76.4 -> 126.1 (+65%) | | BF16 | 77.5 -> 129.6 (+67%) | 76.9 -> 127.4 (+66%) | | TF32 | 40.2 -> 69.8 (+74%) | 40.2 -> 69.0 (+72%) | **Numerics (unlocked only):** relative Frobenius error against an FP64 reference on a 4096x4096 random product: FP16 3.60e-4, BF16 2.88e-3, TF32 2.94e-4. Both GPUs gave identical figures. These are normal for the input precisions, but I did not run the same check in the stock run, so this is not a stock-vs-unlocked parity test like #15. ## Caveats * One boot per run. The stock numbers come from the previous VM boot, which had been up for days; ComfyUI was idle but kept about 11 GB of VRAM allocated per card. The unlocked numbers come from a fresh boot. * Only synthetic GEMM so far. I haven't measured the real workload (ComfyUI video diffusion) yet. * Not tested: installing on the Proxmox host instead of the guest, S3 suspend, long-term stability.
Author
Owner

@dv0ps commented on GitHub (Oct 24, 2026):

If you run Ubuntu LXC containers on Proxmox with GPU passthrough, would you need to modify the host in this case?

<!-- gh-comment-id:6379017171 --> @dv0ps commented on GitHub (Oct 24, 2026): If you run Ubuntu LXC containers on Proxmox with GPU passthrough, would you need to modify the host in this case?
Author
Owner

@Filaind commented on GitHub (Oct 24, 2026):

@dv0ps Yes, you need to install gpu-unlock on the Proxmox host system

<!-- gh-comment-id:6383521511 --> @Filaind commented on GitHub (Oct 24, 2026): @dv0ps Yes, you need to install gpu-unlock on the Proxmox host system
Author
Owner

@pcfreak30 commented on GitHub (Oct 25, 2026):

Interesting. this is effectively my setup so im curious how doing the state/mem hacks inside the vm matter/affect anything vs outside.

<!-- gh-comment-id:6396332544 --> @pcfreak30 commented on GitHub (Oct 25, 2026): Interesting. this is effectively my setup so im curious how doing the state/mem hacks inside the vm matter/affect anything vs outside.
bsakaguchi 2026-10-30 04:54:30 +07:00
Author
Owner

@Zagitta commented on GitHub (Oct 27, 2026):

Thanks for the report! Success reports now live in one place: https://github.com/Zagitta/gpu-unlock/discussions/238. Closing this so the issue tracker stays focused on cards where the unlock fails. Your numbers stay searchable here under the success-report label. If something stops working later, please open an unlock failure issue.

<!-- gh-comment-id:6454866589 --> @Zagitta commented on GitHub (Oct 27, 2026): Thanks for the report! Success reports now live in one place: https://github.com/Zagitta/gpu-unlock/discussions/238. Closing this so the issue tracker stays focused on cards where the unlock fails. Your numbers stay searchable here under the `success-report` label. If something stops working later, please open an unlock failure issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Zagitta/gpu-unlock#15
No description provided.