Fix OptiScaler NGX routing and align marker polling defaults
- Explicitly route OptiScaler to d4r\nvngx.dll in release packages. - Extract INI generation into a helper that preserves line endings and rejects missing or duplicate settings. - Check NGX routing separately from file presence and return failure when the installation is incomplete or misconfigured. - Add an optional OptiScaler patch for external DLSS backends while preserving AMD identity for FSR4, with matching launch guidance. - Align portable and launcher marker polling defaults at 200 us. - Log when d4r's model override replaces game or OptiScaler presets. - Add configuration, package, routing and coexistence regression tests. - Update installation documentation, add FSR/DLSS comparison videos and ignore local .tools artifacts. Refs: #7, #14
This commit is contained in:
1 parent
f66cccaf28
commit
cb08e1c313
17 files changed
+738
-31
No files matched your search
@@ -78,6 +78,11 @@ Settings
|
||||
some GPU time. Restart after changing it; other scenes and RDNA4 hardware still need testing.
|
||||
- OptiScaler.ini: OptiScaler's settings, such as its fps overlay and the render resolution of each
|
||||
quality mode. Press Insert in game for OptiScaler's menu.
|
||||
[Libraries] NvngxPath=d4r\nvngx.dll explicitly selects d4r's shim; OptiDllPath=d4r is also
|
||||
needed for the other DLLs. Keep this route when restoring a customized INI during an update.
|
||||
Do not point NvngxPath at d4r\ngx\_nvngx.dll: that is NVIDIA's core for the shim's internal use.
|
||||
OptiScaler 0.9.4 resolves this relative override from the game's working directory. If a custom
|
||||
launcher uses a different working directory, use the shim's absolute Windows filename instead.
|
||||
|
||||
Each game has its own copy of both files.
|
||||
|
||||
@@ -112,8 +117,11 @@ If something goes wrong
|
||||
- d4r's log is d4r/d4r_nvngx.log. It is rewritten at every launch. Lines starting with "d4r:" and
|
||||
"nvcuda bridge:" name missing files or libraries.
|
||||
- DLSS missing in the game's menu, or no d4r_nvngx.log: check the launch options and that the
|
||||
files are next to the game's main .exe. For OptiScaler's own log, set LogToFile=true in
|
||||
OptiScaler.ini's [Log] section.
|
||||
files are next to the game's main .exe. Run sh d4r/d4r-check.sh: it checks file presence and
|
||||
OptiScaler's explicit NGX route separately. For OptiScaler's own log, set LogToFile=true in
|
||||
OptiScaler.ini's [Log] section. Its later "NVNGXProxy::InitNVNGX Loaded from" line should name
|
||||
d4r\nvngx.dll, not C:\windows\system32\_nvngx.dll. The startup "nvngx.dll not found!" warning
|
||||
can be expected with the shim under d4r/; do not move it into the game root to silence that check.
|
||||
- A wrong image: try Model = E in d4r/d4r.ini, and report the problem with both logs.
|
||||
- Do not use d4r in games with anti-cheat. OptiScaler's DLL injection can get an account banned.
|
||||
- Not supported: DLSS Frame Generation, DLSS Ray Reconstruction, DirectX 11 and Vulkan games.
|
||||
|
||||
+45
-2
@@ -14,6 +14,15 @@ problems=0
|
||||
ok() { printf ' ok %s\n' "$1"; }
|
||||
bad() { printf ' MISSING %s\n' "$1"; problems=$((problems + 1)); }
|
||||
note() { printf ' note %s\n' "$1"; }
|
||||
misconfigured() { printf ' CONFIG %s\n' "$1"; problems=$((problems + 1)); }
|
||||
external_backend=$(awk '
|
||||
{ sub(/\r$/, ""); line = $0; sub(/^[ \t]+/, "", line); sub(/[ \t]+$/, "", line) }
|
||||
line ~ /^\[/ { dlss = (tolower(line) == "[dlss]"); next }
|
||||
dlss && tolower(line) ~ /^allowexternalbackend[ \t]*=/ {
|
||||
count++; sub(/^[^=]*=[ \t]*/, "", line); value = tolower(line)
|
||||
}
|
||||
END { if (count == 1 && value == "true") print "true" }
|
||||
' "$GAME/OptiScaler.ini" 2>/dev/null)
|
||||
|
||||
printf 'd4r install in %s\n' "$(cd "$GAME" 2>/dev/null && pwd || echo "$GAME")"
|
||||
[ -d "$D4R" ] || { printf 'no d4r folder here; run this from the folder with the game .exe\n'; exit 1; }
|
||||
@@ -21,6 +30,34 @@ ls "$GAME"/*.exe >/dev/null 2>&1 && ok "game executable next to d4r/" || note "n
|
||||
for f in dxgi.dll OptiScaler.ini d3d12.dll d3d12core.dll d4r/nvngx.dll d4r/nvcuda.dll d4r/zluda/libcuda.so d4r/d4r.ini; do
|
||||
[ -f "$GAME/$f" ] && ok "$f" || bad "$f (re-extract the d4r zip)"
|
||||
done
|
||||
# File presence alone does not establish NGX routing: OptiDllPath=d4r can still
|
||||
# select system32/_nvngx.dll before d4r/nvngx.dll. Check the per-DLL override.
|
||||
if [ -f "$GAME/OptiScaler.ini" ]; then
|
||||
nvngx_path=$(awk '
|
||||
{ sub(/\r$/, ""); line = $0; sub(/^[ \t]+/, "", line); sub(/[ \t]+$/, "", line) }
|
||||
line ~ /^\[/ { libraries = (tolower(line) == "[libraries]"); next }
|
||||
libraries && tolower(line) ~ /^nvngxpath[ \t]*=/ {
|
||||
count++; sub(/^[^=]*=[ \t]*/, "", line); value = line
|
||||
}
|
||||
END { if (count != 1) exit 1; print value }
|
||||
' "$GAME/OptiScaler.ini") && unique_path=yes || unique_path=no
|
||||
normalized_path=$(printf '%s' "$nvngx_path" | tr '\\' '/' | tr '[:upper:]' '[:lower:]')
|
||||
# Also recognize an absolute Wine Z: path to this install's shim (as used
|
||||
# by developer launches); do not accept an arbitrary nvngx.dll elsewhere.
|
||||
game_path=$(cd "$GAME" 2>/dev/null && pwd -P)
|
||||
absolute_path=$(printf 'z:%s/d4r/nvngx.dll' "$game_path" | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$unique_path" = yes ] && { [ "$normalized_path" = 'd4r/nvngx.dll' ] ||
|
||||
[ "$normalized_path" = './d4r/nvngx.dll' ] || [ "$normalized_path" = "$absolute_path" ]; }; then
|
||||
ok "OptiScaler NGX routing: NvngxPath=$nvngx_path (d4r shim)"
|
||||
case "$normalized_path" in
|
||||
z:*) ;;
|
||||
*) [ "$external_backend" = true ] || note "relative NvngxPath requires the game's working directory to be this folder" ;;
|
||||
esac
|
||||
else
|
||||
misconfigured 'OptiScaler NGX routing: set [Libraries] NvngxPath=d4r\nvngx.dll (exactly once); OptiDllPath alone can load system _nvngx.dll'
|
||||
note 'd4r/ngx/_nvngx.dll is the NVIDIA core for the shim, not the OptiScaler target'
|
||||
fi
|
||||
fi
|
||||
[ -f "$D4R/nvngx_dlss.dll" ] && ok "d4r/nvngx_dlss.dll (NVIDIA DLSS library)" || bad "d4r/nvngx_dlss.dll: copy NVIDIA's DLSS library here"
|
||||
[ -f "$D4R/ngx/_nvngx.dll" ] && ok "d4r/ngx/_nvngx.dll (NVIDIA NGX runtime)" || bad "d4r/ngx/_nvngx.dll: copy NVIDIA's NGX runtime here"
|
||||
if [ -f "$D4R/nvngx_dlss.dll" ] && command -v strings >/dev/null 2>&1; then
|
||||
@@ -49,5 +86,11 @@ if [ -n "$target" ]; then
|
||||
else note "GPU $arch: no native kernels for it in this release (DLSS runs, much slower)"; fi
|
||||
fi
|
||||
|
||||
printf '\nSteam launch options for this game:\n PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %%command%%\n'
|
||||
[ "$problems" -eq 0 ] && printf '\nEverything d4r needs is in place.\n' || printf '\n%d thing(s) to fix above.\n' "$problems"
|
||||
if [ "$external_backend" = true ]; then
|
||||
note "AllowExternalBackend requires the patched OptiScaler DLL; keep native AMD identity visible for FSR4"
|
||||
printf '\nSteam launch options for this patched setup:\n PROTON_ENABLE_NVAPI=1 DXVK_NVAPI_ALLOW_OTHER_DRIVERS=1 DXVK_NVAPI_GPU_ARCH=AD100 WINE_HIDE_AMD_GPU=0 %%command%%\n'
|
||||
else
|
||||
printf '\nSteam launch options for this game:\n PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %%command%%\n'
|
||||
fi
|
||||
[ "$problems" -eq 0 ] && printf '\nFiles and OptiScaler NGX routing checks passed (runtime initialization is not tested).\n' || printf '\n%d thing(s) to fix above.\n' "$problems"
|
||||
[ "$problems" -eq 0 ]
|
||||
@@ -52,6 +52,8 @@ NativeFp8 = on
|
||||
MotionVectorDilation = 0
|
||||
; Keep inputs and output in video memory. Input and output readiness waits use CPU sleeps.
|
||||
VramInterop = true
|
||||
; Microseconds between checks for the game's input marker (default 200; 0 yields).
|
||||
MarkerPollUs = 200
|
||||
LinearInputs = true
|
||||
ElideNgxSync = true
|
||||
; Lets DLSS's last kernel write straight into the game's output buffer (DLSS 4 / K only). It takes
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
# OptiScaler.ini values the d4r release sets (Section.Key=Value); everything else keeps OptiScaler's
|
||||
# default. scripts/package_release.sh applies them to the OptiScaler.ini of the bundled release.
|
||||
# DLSS as the DX12 upscaler, loaded from the d4r folder (OptiScaler looks for nvngx.dll there)
|
||||
# DLSS as the DX12 upscaler. Select the shim by filename: OptiDllPath alone allows
|
||||
# OptiScaler's first _nvngx.dll probe to load Proton's system core before trying nvngx.dll.
|
||||
Upscalers.Dx12Upscaler=dlss
|
||||
DLSS.Enabled=true
|
||||
Libraries.OptiDllPath=d4r
|
||||
Libraries.NvngxPath=d4r\nvngx.dll
|
||||
# Do not use d4r\ngx\_nvngx.dll here: that NVIDIA core is loaded internally by the shim.
|
||||
# The game's DLSS calls reach OptiScaler; d4r's own load of NVIDIA's NGX core is left alone
|
||||
Inputs.EnableDlssInputs=true
|
||||
Hooks.HookOriginalNvngxOnly=true
|
||||
|
||||
Reference in new issue
Block a user