1# GPU tensor unlock
2
3[The host module](../nixos/gpu-unlock.nix) builds the pinned upstream kernel
4module and extracts its NVIDIA firmware without executing the driver installer.
5It runs in the initrd before the normal NVIDIA driver. The installed driver
6and kernel stay on the repository's existing versions. The target is the
7current GPU's PCI address; a different address is skipped by upstream.
8
9`python3 tools/deploy.py stage host` builds and installs a candidate boot
10generation from an immutable uploaded release. It preserves the previous
11default boot entry and leaves the running host, services, and published release
12unchanged. It prints the candidate entry and fallback. Only after reboot
13approval, select the printed entry with `bootctl set-oneshot <entry>` and
14reboot. A subsequent boot uses the previous default again. Promote the reviewed
15source through the normal main deployment workflow when retaining the change.
16After promotion, clear the trial's EFI default with `bootctl set-default ''`
17so NixOS's `loader.conf` selects the production generation on subsequent boots.
18
19Before rebooting, inspect the candidate and fallback initrds for the MAC-bound
20Ethernet link rule, and verify both static addresses and the gateway in the
21built system. The [isolated boot test](../nixos/tests/snowglobe-network.nix)
22exercises the same network module and GPU module in a disposable VM.
23
24Run [the benchmark](benchmark-gpu-unlock.py) with the existing inference image's
25Python and environment, using `inference --phase before-<run>` and
26`tensor --phase before-<run>`. Repeat with `after-<run>` after the approved boot.
27Keep the script, image, model, serving settings, lengths, and seeds identical.
28Each context length has three uncached requests with a fixed output budget;
29measurements include server prefill/decode time, streamed first-token latency,
30speculation counters, and output hashes. Tensor tests use CUDA events and
31FP32 accumulation, plus FP32 and integer controls, while retaining GPU memory
32for the resident model. The script rejects busy inference and records skipped
33tensor sizes if memory is insufficient. Save stdout with host/GPU metadata
34and clock, power, and temperature telemetry. These are synthetic performance
35probes, not model-quality evaluations.