Commit Graph
25 Commits
Author SHA1 Message Date
ayo 25493b3198 feat: add d4r inference engines and Windows parity tooling
Add native K/M/RR inference engines, HIP kernels, replay and validation
harnesses, and Windows DLSS setup and runtime support. Include GPU
profiling tools, build and packaging scripts, platform integration
patches, and implementation documentation.
2026-10-16 08:54:39 -04:00
ayo 73994d4634 Clear windows branch; preserve previous contents in win-old 2026-10-16 05:20:08 -04:00
ayo f0c881985b Change d4r license to GPL-3.0-only 2026-10-08 17:17:44 -04:00
ayo 774efac524 Windows: DLSS watermark off, check script, 310.7.0 pair, shorter docs
- Set Disable.Watermark on the game path (the Linux shim already does);
  [DLSS] ShowWatermark = true keeps NVIDIA's stamp.

- Always write d4r\d4r_nvngx.log in player mode. It was skipped when the
  launcher gave the game a valid stderr pipe, e.g. Steam.

- Accept NVIDIA's 310.7.0 + _nvngx 32.0.15.9636 as "less tested" pins.
  Native kernels are still gated by PTX identity, so a different DLL
  falls back to translated kernels.

- Add d4r-check.ps1 (ok/MISSING/note lines with a fix for each; -Report
  writes a bug-report ZIP) with 15 fixture tests.

- package-windows-release.ps1: -Architectures subset, ships the check
  script, GPU registry and one GPU-query tool.

- Add a shorter WINDOWS_README.txt; trim README's Windows section and
  merge in the RX 9060 XT / distributor-DLL notes.

- Diagnostic probe accepts preset 12 (L).

Tested on RX 7700 XT without a game: loader and shim start-up, K and M
synthetic NGX frames with both DLL pairs (finite output, native kernels
used). Not tested in a game.
2026-10-03 04:58:05 -04:00
ayo 65ab1460a8 Windows: drag-in install with a per-game d4r.ini
Players extract one ZIP into the game folder, copy their two NVIDIA
DLLs, and start the game from Steam, Epic or a shortcut. No launcher
script is needed; settings live in d4r\d4r.ini.

- Shim player mode: when the launcher has not set D4R_HIP_ROOT and
  d4r.ini sits beside the shim, derive the backend environment from it.
  Codegen flags stay at the Windows-validated values. NVIDIA DLLs must
  match an exact SHA256 in dll-pins.txt, with "you have X, you need Y"
  errors. Rejects a vkd3d/Wine d3d12.dll and code objects built for
  another GPU. [DLSS] Model accepts K or M and is applied by rewriting
  the render preset hints.

- d4r.ini exposes only options that exist on Windows: Model, AsyncInterop,
  ValidateOutput, Log, CacheDir. Invalid values fall back with a note in
  d4r_nvngx.log.

- d4r_nvngx_loader: one _nvngx.dll for all GPUs. It matches the game's
  adapter by LUID and loads _nvngx_<arch>.dll from the same folder.

- OptiScaler patch 0006: relative NvngxPath/NvngxDlssPath/
  NvngxFeaturePath resolve against OptiScaler's folder.

- package-windows-release.ps1 builds the release from the per-target
  game packages and refuses mixed targets or differing shared runtimes.

- Tests: test-player-config.ps1 (ini and DLL-pin decisions, loader
  selection on the local GPU) and test-windows-release-package.ps1.
2026-10-03 03:10:19 -04:00
ayo 7ab56d42fc Keep patch files LF on Windows checkouts
Patches are applied with git apply, which fails on CRLF. With core.autocrlf=true Git also reported every .patch file as modified.
2026-10-03 03:06:48 -04:00
ayo 4f3b3a9fe6 Merge pull request #11 from xdfnx-dev/upstream-windows
Add native Windows D3D12/HIP backend and gfx1201 K/M validation
2026-10-02 04:06:28 -04:00
ayo f66cccaf28 Add experimental preset L and fix DLSS resource lifetimes and waits
- Build L texture variants and complete older release kernel bundles.
- Add selective Swin encoder fallback to reduce L/M motion trails.
- Add opt-in GPU motion-vector dilation for thin geometry and sky gaps.
- Replace GPU input waits with cancellable readiness polling and use
  sleeping event queries for completion.
- Retain recorded resources through command allocator completion, defer
  shutdown until cleanup, and preserve unfinished output synchronization.
- Extend lifecycle harness checks and add event, model and motion tests.
- Update configuration defaults, build scripts and release documentation.
2026-10-02 00:30:46 -04:00
ayo b645ef9096 Add DLSS accuracy mode and GLIBC 2.41 release builds
- Add default-off PreferAccuracy for all native kernel families,
  including RDNA4 FP8 variants.

- Restore intermediate FP8 quantization, per-MMA FP16 rounding,
  denormal handling and NGX synchronization in accuracy mode.

- Select separately marked accuracy kernels and use a separate JIT
  cache; reject mixed sets and never silently substitute fast kernels.

- Add a pinned GLIBC 2.41 build environment for ZLUDA/LLVM, the DLLs
  and both kernel sets, with ABI checks and toolchain provenance.

- Support parallel target builds and pre-extracted PTX; correct
  ROCm header paths and Clang-CL input handling.

- Bump to 0.1.3 and update release notes, documentation and tests.

Validation: 11 tests passed; all 912 kernels built; E/K/M GPU harness
runs completed with accuracy off/on. Packaged libraries loaded under
GLIBC 2.41 and require no GLIBC version newer than 2.38.

RTX image-quality parity remains unverified.

Fixes #6
Refs #6
2026-10-01 01:35:39 -04:00
ayo b2b3781aca Fix DLSS artifacts and improve synchronization diagnostics
- Fix Cyberpunk 2077 preset-K black artifacts by preserving FP16/FP64
  denormal requirements while limiting denormal suppression to FP32.

- Fix stale direct-output redirects after array destruction, preventing
  reused handles from inheriting an earlier feature's output buffer.

- Log rejected resource formats and dimensions, including failures after
  startup, with rate limiting for repeated errors.

- Add opt-in blocking output synchronization with a dedicated bridge
  export and fallback to context synchronization.

- Report output-wait CPU and wall time, and defer GPU timing queries
  until asynchronous evaluation has completed. The CPU-overhead
  mitigation for #7 still needs reporter confirmation.

- Reject release libraries requiring GLIBC newer than the configured
  baseline, defaulting to 2.41, and document compatible builds.

Validation: shim and bridge builds pass; targeted redirect-lifetime and
format-logging checks pass.

Fixes #5
Fixes #8
Refs #7
2026-09-30 23:17:25 -04:00
ayo 4334a0c3c4 Add RDNA4 (gfx12) support and a 0.1.2 optimization round
RDNA4 (experimental; untested on RDNA4 hardware)
- kernels/common/wmma_layout.h picks the WMMA operand/accumulator layout
  per target; K (pwin_*) and M (swin_*) index through it, so the same
  sources build for gfx11 and gfx12. D4R_WMMA_LAYOUT=12 on gfx11 is a test
  shim that runs the gfx12 indexing on gfx11 WMMA.

- M can use native e4m3 FP8 WMMA on gfx12 (D4R_NATIVE_FP8=1). Texture
  tails (enc0_tail, dec0_head) get gfx12 f16 and FP8 paths that match
  ZLUDA's gfx12 lowering.

- ZLUDA patch 0007: gfx12 WMMA helpers, optional native FP8 MMA
  (D4R_ZLUDA_WMMA_FP8_NATIVE), a layout override for testing, and an
  architecture argument for d4r_emit. Texture kernels are now compiled
  offline per target through d4r_emit (D4R_ZLUDA_EMIT) instead of on the
  local GPU.

- New d4r.ini option [Kernels] NativeFp8 (default on), wired through the
  shim and d4r_config.py. On gfx12 the bridge serves kernels/<arch>-fp8
  when it is on.

- The bridge picks the KFD GPU with the most SIMDs (so an iGPU is not
  chosen over a discrete GPU); D4R_GPU_ARCH overrides it.

- kernels/build.sh and package_release.sh build gfx1100-gfx1103 and
  gfx1200/gfx1201 (plus -fp8 variants), and D4R_BUNDLE_TEX takes
  per-target folders.

Performance (RDNA3; harness byte-identical unless noted)
- ZLUDA patch 0006: m16n8k8 f16 MMAs on WMMA (E; not bit-exact, 52-55 dB
  per layer, D4R_ZLUDA_WMMA_K8=0 disables it), per-key weight-image slots
  for native prep kernels (d4r_prep_key_at, d4r_prep_key_slots), and
  wave64 builds of MMA-free kernels (D4R_ZLUDA_WAVE64).

- M: packed FP8 encoding, conflict-free patch-merge reads, scalar weight
  loads in enc1, and weight prep once per weight set for the six enc3
  tube blocks.

- K: CU mode for the six non-wide pwin layers.

- Texture kernels: every DLSS flag variant is built natively (24 K output,
  8 M post, 4 M downsample, 4 M enc0), not only Townfall's; post and K
  output run as wave64.

- M direct output: rrlite_downsample_kernel writes the shim's output
  buffer; the shim's default direct-output presets are now 11,13.

Tools
- dump_runner takes the prep grid from d4r_prep_blocks and refuses
  texture/surface dumps.

- New pwin_check.py, swin_check.py, model_enc3.py and tail_check.hip.

Docs: README GPU table and RDNA4 notes, building (patches 0002-0007,
d4r_emit), native-kernels (RDNA4 section), performance (new numbers),
packaging README. Version 0.1.2.
2026-09-29 20:36:10 -04:00
ayo f310d52b69 package folder changes 2026-09-28 01:34:53 -04:00
ayo da263ecf75 Fix VRAM leak on quality changes and RGBA16 motion vectors; more games
- Shim: reuse VRAM interop buffers across features instead of freeing them;
  ROCm 7.2.x's hipExternalMemoryGetMappedBuffer retains its view twice, so
  freed buffers never released their memory (~130 MB per quality change)
- Bridge: close the exported fd after hipImportExternalMemory
- Shim: accept R16G16B16A16_TYPELESS motion vectors and convert 4-channel
  motion vectors to RG16F on the GPU, keeping VRAM interop (Dying Light:
  The Beast rendered black)
- Harness: D4R_HARNESS_RECREATE=N quality-change cycles,
  D4R_HARNESS_MV_RGBA16=1 motion vector format
- Supported games: TLOU, Control, Cyberpunk 2077, Rift Apart, HZD Remastered,
  Subnautica 2, Alan Wake 2, Silent Hill 2, Dying Light: The Beast; general notes
- README: GPU support section (native kernels only for gfx1101); ignore videos/
2026-09-28 01:26:51 -04:00
ayo 1952452830 Bundle the ROCm 7.2.4 runtime in the release zip 2026-09-27 18:59:07 -04:00
ayo bc31abdd50 Fix reflection lag from RGBA exposure 2026-09-27 18:31:42 -04:00
ayo 00cb497ede supported games 2026-09-27 17:49:42 -04:00
ayo db51da64ec supported games 2026-09-27 17:49:42 -04:00
ayo 508312ebf9 moved
Added a demo video link for DLSS Ultra Performance and removed duplicate mention.
2026-09-27 17:23:31 -04:00
ayo 818dd8bf42 Fix 8-bit DLSS VRAM interop 2026-09-27 17:22:04 -04:00
ayo bcc1fa6560 just link for demo 2026-09-27 17:01:03 -04:00
ayo 17c2c83723 Show DLSS demo preview in GitHub README 2026-09-27 16:55:46 -04:00
ayo 629bc35e9d ZLUDA: read null texture objects as zero (fixes Ghost of Tsushima GPU fault) 2026-09-27 16:53:22 -04:00
ayo b36b6d21c4 readme 2026-09-27 16:20:39 -04:00
ayo 0edf1b138f release notes 2026-09-27 16:13:32 -04:00
ayo 118173ecd7 d4r: official NVIDIA DLSS on AMD GPUs under Linux and Proton 2026-09-27 15:26:56 -04:00