diff --git a/docs/windows-host.md b/docs/windows-host.md index 9d19c6a..e93d85f 100644 --- a/docs/windows-host.md +++ b/docs/windows-host.md @@ -59,6 +59,31 @@ nvenc` exe runs here as-is (no SDK install). The 4090's Ada NVENC has no consume host encodes alongside Apollo. **Gotcha:** the SudoVDA monitor is rendered by — and DXGI-enumerated under — the 4090, not the SudoVDA adapter LUID (the capturer searches all adapters; see the fix). +#### Native build on the 4090 (fast iteration loop) + +Build on the box itself (edit locally → `sftp` to the repo → `cargo build` there → run via the task) +instead of build-on-VM-then-copy. Prereqs that bit us, in order: + +1. **Full MSVC C++ build tools, incl. the CRT libs.** A VS install can land `cl.exe` + the Windows + SDK + sanitizer libs but *miss* the desktop CRT import libs (`VC\Tools\MSVC\\lib\x64\msvcrt.lib`, + `libcmt.lib`, …) → `LNK1104: msvcrt.lib`. Root cause here: the `Microsoft.VisualCpp.Redist.14` + package failed to install (1603), cascading to skip the NativeDesktop workload. Fix = (re)install + the C++ workload via the VS Installer **GUI** (the headless `setup.exe modify` over SSH fails — a + non-elevated SSH token gives 1603/87, and `--quiet` as SYSTEM hangs). A reboot may be needed first + (a pending reboot also yields 1603). Stop-gap: the desktop CRT libs are version-pinned, so they can + be copied from another box with the **identical** MSVC version (`14.51.36231` here). +2. **Build from an ASCII path.** A username with a non-ASCII char (`C:\Users\Enrico Bühler\…`) breaks + the MSVC PDB writer → `LNK1201: error writing to the program database`. Clone/copy the repo to + e.g. `C:\Users\Public\punktfunk-native` and build there (the VM worked only because it built in + `C:\Users\Public\punktfunk`). +3. `winget install NASM.NASM Kitware.CMake`; generate the NVENC import lib (`lib /def` → set + `PUNKTFUNK_NVENC_LIB_DIR`); set `CMAKE_POLICY_VERSION_MINIMUM=3.5` (libopus). + +Build env (each `cargo` invocation): `$env:PATH += ";C:\Program Files\NASM;C:\Program Files\CMake\bin"`, +`$env:CMAKE_POLICY_VERSION_MINIMUM="3.5"`, `$env:PUNKTFUNK_NVENC_LIB_DIR="C:\Users\Public\nvenc"`, then +`cargo build --release -p punktfunk-host --features nvenc`. Validated: native build (1m37s) → +720p60 NVENC, 174/174 frames, p50 2.5 ms, ffmpeg-decodes clean. + All Windows backends are `clippy -D warnings` and `rustfmt` clean on `x86_64-pc-windows-msvc` (the Windows-only modules are cfg-excluded from Linux CI, so run clippy on the VM after touching them — its rustc 1.96 clippy is stricter than the Linux CI image on shared code, e.g. `needless_return`).