Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
feat(fg): Ampere arch spoof is now the default 30-series path (hook fixed, matrix verified)
Veyra Goal Agent28b539f01bb1
diff --git a/docs/RELEASE_NOTES_1.3.2.md b/docs/RELEASE_NOTES_1.3.2.mdindex 3f720aa6..2a148476 100644--- a/docs/RELEASE_NOTES_1.3.2.md+++ b/docs/RELEASE_NOTES_1.3.2.md@@ -57,6 +57,25 @@ MJPEG 1080p60 7176 帧 / MJPEG 4K18 2150 帧,全部 0 丢帧、无重连。.\Veyra.exe <任意视频> --fg --fg-multiplier 6 --smoke-seconds 15```+## 1.3.2beta4:30 系(RTX 30)DLSS 补帧的新路径++上一版里 30 系解锁虽然"应用成功",但 provider 的补帧可用性闸门仍拒绝 sm_86(真实 3060+日志:`FG.Available=false`)。本版加入了**进程内的 NVAPI 架构伪装**,并把顺序修正为+"在 NGX 初始化之前安装",**在 RTX 30 上默认启用**(其余架构完全不走这条路径):++- provider 被告知运行在 Blackwell 上(0x1B0)→ 架构闸门通过;+- 内核仍由 sm_86 重写提供(69 个 fatbin)→ 程序真的能在 Ampere 上运行;+- 伪装装不上时自动回退到旧的重定向路径,不会因此不可用;+- 可用环境变量调试:`VEYRA_TEST_NVAPI_SPOOF_ARCH=0`(关闭伪装、回到旧重定向路径)、+ `VEYRA_DISABLE_AMPERE_MFG_UNLOCK=1`(整体关闭 30 系解锁)。**不要设 0x190**:本机实测按 Ada+ 上报时第一个生成帧会 Evaluate 故障并挂住进程。++**本机验证(RTX 5070,模拟 30 系配置)**:伪装 + sm_86 内核 → `FG capability available=true+multiFrameMax=5`、376 真实帧/374 生成帧、无崩溃;50 系默认路径与 40 系路径都不安装伪装+(对照运行无 `nvapi-spoof` 活动)。**真实 30 系硬件未验证**——这正是这个包要测的东西:+把 `logs/veyra-app.log` 里 `[ampere-mfg] ... spoofed=?`、`FG capability ...`、+`[ngx] fg-backend ...` 与 `[app] smoke frames=/generated=` 几行发回来即可。+## 采集链路(本次重点)- **压缩格式不再走系统解码器**:MJPEG/H.264/HEVC/AV1/VP9 由 `ConnectDirect` 直接送入我们的diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 3c680575..f01a758b 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -40,17 +40,55 @@**30 系用户测试指引(1.3.2beta4)**-默认运行(不设环境变量):保持与 1.3.2beta3 相同的行为(预期仍报 FG 不可用,但不会崩溃)。-要试新路径:+默认即启用(Ampere 上自动装伪装 + sm_86 内核补丁 + 跳过 arch-gate 重定向);伪装装不上时+自动回退到旧的重定向路径。要覆盖行为可用环境变量:```powershell-$env:VEYRA_TEST_NVAPI_SPOOF_ARCH='0x1B0'+# 默认:上报 Blackwell(0x1B0),6X 上限+# 备选:上报 Ada(0x190),4X 上限+$env:VEYRA_TEST_NVAPI_SPOOF_ARCH='0x190'+# 关闭伪装(回到旧的重定向路径)+$env:VEYRA_TEST_NVAPI_SPOOF_ARCH='0'+# 完全关闭 30 系解锁+$env:VEYRA_DISABLE_AMPERE_MFG_UNLOCK='1'.\Veyra.exe <视频> --fg --smoke-seconds 15```期望日志:`[nvapi-spoof] provider GetArchInfo wrapper hooked ... will report 0x1B0`、-`FG capability available=true multiFrameMax=5`、`generated=` 接近 5×;若出现 Evaluate-`seh` 或补帧不出现,把日志发回即可继续迭代。+`[ampere-mfg] ... spoofed=1 reportedArch=0x1B0 ... gates=0`、+`FG capability available=true multiFrameMax=5`、`generated=` 接近 5×。++**收尾:RIP 相对陷阱 + 默认启用后的本机验证**++- 首个 hook 版本把包装函数的前 24 字节整体搬进跳板,其中 `lock add [rip+0x73144C],1` 是+ **RIP 相对指令**——搬到新地址后位移失效,写坏 provider 内存,`NVSDK_NGX_D3D12_Init` 直接+ `seh=0xC0000005`(被 SEH 兜住、退化为无补帧)。修复:只搬**位置无关的前 16 字节**+ (到 `mov rsi,rcx` 为止),RIP 相对那条留在原地址执行,跳板跳回 entry+16。+- 修复后**模拟 30 系配置**(`VEYRA_TEST_FORCE_AMPERE_UNLOCK=1`,伪装默认 0x1B0):+ `spoofed=1 reportedArch=0x1B0 gates=0` → `FG capability available=true multiFrameMax=5`+ → **376 真实帧 / 374 生成帧、0 崩溃**。这是 3060 将要走的同一条代码路径+ (provider 被告知 Blackwell + 内核替换为 sm_86)。+- 对照组:**50 系默认路径**无任何 `nvapi-spoof` 活动、380 真实/378 生成;+ **40 系路径**(`VEYRA_TEST_FORCE_ADA_UNLOCK=1`)只有 `ada-mfg` 日志、381 生成帧、无 spoof。+ 即伪装只可能在 Ampere 分支上出现。+- 门禁:修复合同 191/0、采集颜色 0 失败、压缩解码 ALL PASS、`delivery.ps1` PASS。++**仍未验证(必须由 30 系实机回答)**:真实 GA10x 上 provider 采纳 0x1B0 后的行为+(真实 Ampere 缺少 Blackwell 的 flip metering;若 Evaluate 失败会是 SEH 兜底后无补帧,+日志里能看到 `fg-backend failed ... seh=`)。**不要试 0x190**:本机实测按 Ada 上报时+provider 只给 `multiFrameMax=1`,且第一个生成帧 Evaluate 报 `seh=0xC0000005`、进程随后挂住+(需手动结束)——它没有帮助,只会浪费一轮测试。++**完整验证矩阵(本机 RTX 5070)**++| 配置 | 结果 |+| --- | --- |+| 50 系默认(不设任何变量) | 380 真实 / 378 生成,**无任何 `nvapi-spoof` 活动** |+| 40 系路径(`VEYRA_TEST_FORCE_ADA_UNLOCK=1`) | `ada-mfg` 全部 patch 应用、381 生成,无 spoof |+| **30 系目标配置**(force-ampere + 默认 spoof 0x1B0) | `spoofed=1 reportedArch=0x1B0 gates=0` → `multiFrameMax=5` → **379/377**,exit 0 |+| 30 系 6X(上述 + `--fg-multiplier 6`) | 360 真实 / **1600 生成**,exit 0 |+| 30 系回退(`VEYRA_TEST_NVAPI_SPOOF_ARCH=0`) | 走旧重定向路径,376/374,exit 0 |+| 30 系 + 0x190(Ada 上报) | `multiFrameMax=1` → Evaluate `seh=0xC0000005` → 进程挂住(**不推荐**) |## 2026-09-17 3060 DLSS FG 深挖:patch 正确性实机级验证 + 上游方案拆解diff --git a/src/ngx/NvapiArchSpoof.cpp b/src/ngx/NvapiArchSpoof.cppindex 3c5dee31..97508219 100644--- a/src/ngx/NvapiArchSpoof.cpp+++ b/src/ngx/NvapiArchSpoof.cpp@@ -26,14 +26,19 @@ constexpr uint32_t kNvGpuArchInfoVersion = 0x20010u;using NvapiInitializeFn = int(__cdecl*)();// The audited provider resolves NvAPI_GPU_GetArchInfo through a small internal-// wrapper at RVA 0x1670. Its first 24 bytes are a stable prologue ending at the-// next instruction boundary; a 14-byte absolute jump fits in the first 14 of-// them, and a trampoline holding the original 24 bytes plus a jump back runs the-// real logic. That keeps every real field (implementation/revision included)-// and only rewrites the architecture the provider adopts.-constexpr uint8_t kExpectedPrologue[24] = {+// wrapper at RVA 0x1670. Only its first 16 bytes are relocated into a+// trampoline: they are pure stack/register moves and therefore position+// independent. The instruction that follows is RIP-relative+// ("lock add [rip+0x73144C],1") and must keep executing at its original+// address, so the trampoline jumps back to entry+16. Copying that instruction+// verbatim broke the provider inside NVSDK_NGX_D3D12_Init (seh=0xC0000005)+// because the displacement then pointed somewhere else entirely.+constexpr uint8_t kExpectedPrologue[16] = {0x48, 0x89, 0x74, 0x24, 0x10, 0x57, 0x48, 0x83, 0xEC, 0x20,- 0x48, 0x8B, 0xFA, 0x48, 0x8B, 0xF1,+ 0x48, 0x8B, 0xFA, 0x48, 0x8B, 0xF1};+// Structural check of the RIP-relative instruction we deliberately leave in+// place (lock add dword ptr [rip+0x73144C],1).+constexpr uint8_t kExpectedRipRelative[8] = {0xF0, 0x83, 0x05, 0x4C, 0x14, 0x73, 0x00, 0x01};constexpr size_t kRelocatedBytes = sizeof(kExpectedPrologue);constexpr size_t kJumpBytes = 14; // ff 25 00 00 00 00 <addr64>@@ -126,9 +131,14 @@ bool NvapiArchSpoof::install(HMODULE module, uint32_t reportedArchitecture) {g.entry = nullptr;return false;}+ if (std::memcmp(g.entry + kRelocatedBytes, kExpectedRipRelative, sizeof(kExpectedRipRelative)) != 0) {+ g.detail = L"provider GetArchInfo wrapper layout changed after the relocated prologue";+ g.entry = nullptr;+ return false;+ }g.targetResolved = true;- // Trampoline: the original 24 bytes followed by "jmp [rip+0] <wrapper+24>".+ // Trampoline: the 16 relocated bytes followed by "jmp [rip+0] <wrapper+16>".g.trampoline = static_cast<uint8_t*>(VirtualAlloc(nullptr, kTrampolineBytes, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE));if (g.trampoline == nullptr) {@@ -181,7 +191,7 @@ void NvapiArchSpoof::release() {g.trampoline = nullptr;}log::info("nvapi-spoof", std::format(- "provider architecture load site restored={} (process memory only)", restored ? 1 : 0));+ "provider GetArchInfo wrapper restored={} (process memory only)", restored ? 1 : 0));g.installed = false;g.entry = nullptr;}diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex 6cd7b769..a7f6c18e 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -513,11 +513,12 @@ void EnhanceGraph::prepareAmpereFgSpoof()modulePath.string(), GetLastError()));return;}- // Disabled by default: the hook is still under investigation (it changes the- // architecture the provider adopts but does not yet produce a stable- // frame-generation session on the test host). Set VEYRA_TEST_NVAPI_SPOOF_ARCH- // to a NV_GPU_ARCHITECTURE_ID (e.g. 0x1B0 for Blackwell) to try it.- uint32_t spoofArchitecture = 0;+ // Ampere default: tell the provider it runs on Blackwell (0x1B0). That is+ // what makes its frame-generation availability gate pass; the sm_86 kernel+ // rewrite is what makes the programs actually run. Ada/Blackwell never reach+ // this function. VEYRA_TEST_NVAPI_SPOOF_ARCH overrides the reported id (e.g.+ // 0x190 for Ada, 0x170 to disable the trick), 0 refuses the spoof entirely.+ uint32_t spoofArchitecture = ngx::NvapiArchSpoof::kArchBlackwell;{wchar_t overrideText[16]{};if (GetEnvironmentVariableW(L"VEYRA_TEST_NVAPI_SPOOF_ARCH", overrideText, 16) > 0) {