Skip to content

Instantly share code, notes, and snippets.

@gabrielmaialva33
Last active October 13, 2026 07:30
Show Gist options
  • Select an option

  • Save gabrielmaialva33/33ebb2542f0513d55100b22aa2149ff5 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielmaialva33/33ebb2542f0513d55100b22aa2149ff5 to your computer and use it in GitHub Desktop.
The Witcher 3 5.0 on Proton/Linux: re-enable DLSS, DLSS-G and ray tracing (wine_get_version check patch)

The Witcher 3 5.0 on Proton: re-enable DLSS, DLSS-G and ray tracing

game 5.01 NVIDIA AMD Proton

An unofficial workaround until CD PROJEKT RED or Valve fix this properly. As soon as the 5.0 executable sees Wine, it turns off Streamline (DLSS SR/RR, DLSS-G, Reflex), ray tracing, path tracing and FSR frame generation. Everything here brings them back.

Important

The exe patch script supports only bin/x64_dx12/witcher3.exe 5.0.0.1048522 (patch 5.01, 2026-10-08, Steam build 25773555, sha256 2df76539…b101), 5.0.0.1044392 (the 2026-10-01 5.00c hotfix, Steam build 25646871, sha256 9406eccc…fe51) and 5.0.0.1041720 (the 2026-09-29 "Remastered" release, Steam build 25575366, sha256 c272b2c2…c7e25). It picks the build by size, checks the sha256, and refuses anything else, so a future game update needs a script update. The GOG exe passed the same hash check in one report. Wineland and the sed one-liner don't depend on the build.

Pick your path

You use Do this You get
Steam, any GPU Proton Wineland 11.0-20260930 or newer, original exe Everything, nothing to patch
Proton Experimental (2026-10-02 or newer) The sed one-liner Everything
GE-Proton11-7 The script DLSS SR/RR, Reflex, DLSS-G. RT and path tracing also need a newer vkd3d-proton
AMD / Intel on another Proton The script with --rt-only RT, path tracing, FSR FG
GOG through Heroic, or Lutris / Faugus Wineland plus the manual step in #75 / #76 / #77, or the sed one-liner if that step doesn't stick (confirmed through Faugus by @micker) Everything
A laptop, or any PC with the iGPU enabled Read Hybrid GPUs first

"Everything" means DLSS SR/RR, Reflex and DLSS-G on NVIDIA (DLSS-G needs an RTX 40 or newer), plus ray tracing, path tracing and FSR frame generation on any GPU.

Contents: Wineland · Other Protons · Ray tracing · Troubleshooting · DLSS 5 NR · Notes · Under the hood

Recommended: Proton Wineland

Tip

Proton Wineland 11.0-20260930 or newer (nanomatters' proton-cachyos) hides Wine from witcher3.exe only, through a per-game fix (HideWineExports for that exe). The game files stay untouched, so game updates do not break it. It also carries the vkd3d-proton fixes ray tracing needs (the BLAS size fix, tight alignment, the RADV shader fix) and turns NVAPI off on non-NVIDIA GPUs.

  1. Download the newest proton-wineland-11.0-<date>-x86_64_v3.tar.xz (or the x86_64 one for CPUs without AVX2) from the release page and extract it into ~/.local/share/Steam/compatibilitytools.d/. As of 2026-10-05 that is 20261005, which also smooths out the frame pacing swings NVIDIA Reflex caused in this game. It is a regular Proton build, not tied to CachyOS.
  2. Restart Steam, then pick it in The Witcher 3 → Properties → Compatibility.
  3. Use it with the original exe: if you patched it with the script, run python3 w3_proton_patch.py --restore first (or Steam's "Verify integrity of game files").
  • The per-game fix runs when Steam launches the game. Heroic, Lutris and Faugus need a manual step for now: #75, #76, #77.
  • Tested here on 5.00c and 5.01 (RTX 4090, 615.71.09): with the unmodified exe, Streamline loads, DLSS SR/RR, DLSS-G and the RT options are all available. A session of over 15 minutes with path tracing and DLSS-G on ran with no hang and no Xid.

Other Protons

GE-Proton: a protonfix that hides Wine from this game automatically was merged on 2026-10-10 (umu-protonfixes#641), and GE's tree now also has a vkd3d-proton with #3308 and #3332, which the game needs once Wine is hidden. Both ship in the next GE-Proton after 11-7. Until then, GE-Proton11-7 needs one of the options below plus a newer vkd3d-proton.

One-liner (survives game updates)

From @Saancreed: rename the string the game looks up, so the lookup fails and every Wine check goes away at once.

cd "<Steam library>/steamapps/common/The Witcher 3/bin/x64_dx12"
sed -i s/wine_get_version/frog_get_version/ witcher3.exe
  • This behaves like --rt below: DLSS, RT and the non-Wine buffer alignment are all exposed. So it needs a vkd3d-proton with #3308, or the game crashes at startup (GE-Proton11-7's does not have it), and the RT fixes before turning RT on. Proton Experimental has them since its 2026-10-02 update (vkd3d-proton 44cf7c20, which includes #3332 and the dxil-spirv fix; if Steam hasn't updated it yet, the bleeding-edge beta has them too). A vkd3d-proton master build or nanomatters' wineland-11.0-20260930 have them as well.
  • On AMD, also PROTON_DISABLE_NVAPI=1 on GE-Proton and other Protons that don't do it yet. Proton Experimental (since 2026-10-01) and Wineland already turn NVAPI off for this game when no NVIDIA driver is loaded.
  • It changes the exe, so the script then refuses it. Use one or the other; Steam's "Verify integrity of game files" undoes either.

The script

Close the game first. Python 3, no dependencies.

python3 w3_proton_patch.py                # NVIDIA: DLSS SR/RR, Reflex, DLSS-G   (default Steam path)
python3 w3_proton_patch.py /path/to/witcher3.exe
python3 w3_proton_patch.py --rt           # NVIDIA: the above + RT and path tracing
python3 w3_proton_patch.py --rt-only      # AMD / Intel: RT, path tracing and FSR frame generation
python3 w3_proton_patch.py --dry-run      # show the state, change nothing
python3 w3_proton_patch.py --restore      # undo everything
GPU Run You get
NVIDIA default DLSS SR/RR, Reflex and DLSS-G. Nothing else needed
NVIDIA --rt The above plus ray tracing and path tracing, which need a recent vkd3d-proton (below)
AMD / Intel --rt-only Ray tracing, path tracing and FSR frame generation. On AMD, RT also needs the dxil-spirv fix (below)
  • The DLSS patches are NVIDIA only: with OptiScaler/fakenvapi they made the game exit in one report, so AMD and Intel use --rt-only.
  • A copy of the original is saved once as witcher3.exe.orig-<version> (e.g. witcher3.exe.orig-5.0.0.1044392). Steam's "Verify integrity of game files" also restores the original.
  • A game update replaces the exe and the offsets change. Run the script again only if it says the build is supported.

Then choose DLSS and Frame Generation in Options → Graphics.

Hiding Wine by hand

HideWineExports=Y, or "Hide Wine version" in winecfg (proton-cachyos, wine-staging), hides Wine from the game entirely, which exposes DLSS and RT without touching the exe. It still needs a vkd3d-proton with #3308 and the RT fixes. With those it was reported working on NVIDIA in #3226 and on AMD (@drizzt, GOG version through Heroic).

  • On proton-cachyos the per-app key did nothing and the global HKCU\Software\Wine\HideWineExports=Y worked (@vharmash, RX 9070). Wineland's per-game fix uses the per-app key and works.
  • Older proton-cachyos builds crash with it because their lsteamclient lacks SteamUtils011.

Hybrid GPUs (laptops)

Patch 5.01 fixes a case where the game picked the wrong GPU, so try without the settings below first. With an integrated GPU enabled, the game's hardware detection can pick the iGPU instead of the dedicated one: Low preset, RT locked, settings that "revert", DLSS reported as not supported, and very low FPS. Found by @Soyalexf. Hide the iGPU from the game by pointing Vulkan at the dedicated GPU's driver only, in the launch options:

VK_DRIVER_FILES=/usr/share/vulkan/icd.d/nvidia_icd.json %command%   # NVIDIA
VK_DRIVER_FILES=/usr/share/vulkan/icd.d/radeon_icd.json %command%   # AMD

On NVIDIA laptops with PRIME offload, __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only %command% does the same.

If none of that helps, turning the iGPU off in the BIOS (dGPU-only or MUX mode, on laptops that have it) takes it out of the picture entirely. That fixed the frame rate on an RTX 3050 laptop (@San10deep). DLSS still needs one of the fixes above to show up.

Ray tracing and path tracing

--rt, --rt-only, the one-liner and hiding Wine all clear the Wine flag, so RT and path tracing become selectable. What else is needed depends on the GPU.

Warning

NVIDIA, drivers 590 and newer: vkd3d-proton #3332 (by @Stanni97, merged 2026-09-30). Without it, RT hangs the GPU within about a minute (Xid 109 / VK_ERROR_DEVICE_LOST).

  • The cause: vkd3d-proton's Witcher 3 workaround asked for BLAS sizes with ALLOW_UPDATE forced on. On NVIDIA that reports up to ~5x less build scratch than BLAS built without it actually use.
  • Tested here on 5.0 (RTX 4090, 615.71.09) with vkd3d-proton master 4d06d745 plus #3332, nothing else: about 29 minutes, ~17 with RT and ~12 with path tracing, DLSS RR and DLSS-G on. No hang, and zero register_rtas_scratch_range warnings.

Warning

AMD (RADV): dxil-spirv PR #311 (by @drizzt, merged 2026-09-30 and in vkd3d-proton master). Without it, RADV crashes in vkCreateRayTracingPipelinesKHR while the game loads, because one of the game's path-tracing shaders translates to invalid SPIR-V (Mesa #16450).

With it, RT was reported working on a Radeon 7900X (@drizzt), and with #3332 as well on an RX 6800 XT, ~20 minutes stable (@Soyalexf). @Soyalexf's scripts for AMD: https://github.com/Soyalexf/witcher3-rt-amd-proton

Note

No build needed on Proton Experimental or Wineland. Proton Experimental has both fixes since its 2026-10-02 update (if yours is older: Steam → Library → Tools → Proton Experimental → Properties → Betas → bleeding-edge), and so does nanomatters' wineland-11.0-20260930. On another Proton, build vkd3d-proton master as below.

Step by step: vkd3d-proton master (about 10 minutes, for GE-Proton and other Protons)

Most of the time is the build. Close Steam first. The commands are bash: on fish or another shell, run bash first.

# 1. Build tools
sudo pacman -S --needed git meson ninja glslang mingw-w64-gcc wine          # Arch, CachyOS
# sudo apt install git meson ninja-build glslang-tools mingw-w64 mingw-w64-tools   # Debian, Ubuntu

# 2. vkd3d-proton master (it already has #3332, #3308 and the dxil-spirv fix for AMD)
cd ~
git clone --recursive https://github.com/HansKristian-Work/vkd3d-proton.git
cd vkd3d-proton

# 3. Build (64-bit is all this game needs)
meson setup build --cross-file build-win64.txt --buildtype release -Dstrip=true
ninja -C build

# 4. A copy of your Proton with the new DLLs.
#    P = your GE-Proton folder name in compatibilitytools.d (it may be GE-Proton11-7 or GE-Proton11-7-x86_64)
cd ~/.local/share/Steam/compatibilitytools.d
P=GE-Proton11-7
cp -a "$P" "$P-w3"
sed -i "s/\"$P\"/\"$P-w3\"/g" "$P-w3/compatibilitytool.vdf"
D="$P-w3/files/lib/wine/vkd3d-proton/x86_64-windows"
rm -f "$D/d3d12.dll" "$D/d3d12core.dll"
cp ~/vkd3d-proton/build/libs/d3d12/d3d12.dll ~/vkd3d-proton/build/libs/d3d12core/d3d12core.dll "$D/"
  1. Start Steam. In The Witcher 3 → Properties → Compatibility, pick the new ...-w3 entry.
  2. Run python3 w3_proton_patch.py --rt (NVIDIA) or --rt-only (AMD / Intel), then turn on ray tracing / path tracing in the game.

Troubleshooting

Symptom What to do
DLSS still greyed out after patching Run once with PROTON_LOG=1 and check that sl.common.dll and sl.dlss.dll get loaded. If only sl.interposer.dll shows up, the exe that actually runs is not the patched one. With a plain Wine runner instead of Proton, also check that dxvk-nvapi is set up.
Crash at startup right after hiding Wine The vkd3d-proton is older than #3308 (GE-Proton11-7's is). Use a newer one, or the script's --rt / --rt-only, which keep Wine's buffer alignment.
Crash in Steam.dll at startup The remaster needs SteamUtils011, which older proton-cachyos builds (20260703) lack. With an outdated Steam client, recreating a missing ~/.local/share/Steam/steam/games folder let Steam update itself (@Patola).
Low preset, RT locked, DLSS "not supported", very low FPS The game picked the iGPU: see Hybrid GPUs.
GOG through Heroic: witcher3.exe runs with no window The GOG update leaves empty folders under content/ and dlc/, and the game hangs on them. From the game folder, find content dlc -depth -type d -empty -delete fixed it (Heroic #5941, confirmed by @Ritaku02).
Stutter while signed in to a CDPR account While signed in, the game checks the connection about 10 times a second, and under Wine each check re-reads the stats of every network adapter; one slow NIC driver is enough (profiled by @ninele7 in Proton#607). Wineland 11.0-20261011 ships a fix for it. On other Protons, signing out of the CDPR account avoids it.
"Frozen" loading screen after dying Under Proton, "Load last save" from the death screen can take 3–4 minutes, while the same save loads in seconds from the main menu. Reported on Steam Deck and desktop Linux, not on Windows; one report says Proton 11-02 cut it to ~30 s (Steam thread). For now, quit to the main menu and load from there.
Random crash in menus with a live 3D scene (inventory, map, alchemy, character), witcher3.exe+0x3317E3 A race in the game itself, much more common under Wine. @p-valentin's fix patches it: for 5.00c, and for 5.01 (the same patch with the 5.01 addresses; @Snuffles20 crashed the unpatched 5.01 within minutes and not since). It needs the unmodified exe: on Wineland just run it; with the sed one-liner, apply it first and the sed after. It can't be combined with this gist's script.
AMD: crash with Mesa's anti-lag layer on Add DISABLE_LAYER_MESA_ANTI_LAG=1 to the launch options (@vharmash).

Extra: DLSS 5 Neural Rendering on top

Once DLSS works in the game, you can add DLSS 5 Neural Rendering (NR) on top of it with OptiScaler. My own setup is in a kit: W3-DLSS-NR-kit-8f603d70.zip, with the OptiScaler_DLSSNR build 8f603d70, the NR model and my OptiScaler.ini. Tested on an RTX 4090 with path tracing, Ray Reconstruction and DLSS-G: 50–60 fps at 3440x1440 with DLSS Quality.

  1. Extract it into bin/x64_dx12, next to witcher3.exe. If your NVIDIA driver isn't 615.71.09, replace _nvngx.dll with your own: cp /usr/lib/nvidia/wine/_nvngx.dll <game>/bin/x64_dx12/.
  2. Launch options: WINEDLLOVERRIDES="dxgi=n,b" %command%.
  3. In game, pick DLSS. F7 turns NR on and off, and Home opens the OptiScaler menu.
  • The kit's ini already has ApplyAfterRR=true. Without it, NR skips every frame while Ray Reconstruction is on.
  • In the tests published so far, NR costs around 30% of the frame rate with path tracing.
  • If the GPU hangs (Xid 109) only with NR on, reset any GPU overclock first. NR is much heavier than DLSS upscaling, and an overclock that was stable in other games hung here until it was reset (@tuxrinku).
  • If NR doesn't run, OptiScaler.log next to the exe says why: look for the lines starting with DLSS-NR.
  • Unofficial; single player only.

Notes

  • Tested here on Linux with an RTX 4090. Reported working with DLSS on RTX 3060, 4060 Laptop, 4070, 4090, 5070 Ti and 5090, and with RT on AMD (Radeon 7900X, RX 6800 XT, RX 7900 XTX, RX 9070). DLSS-G needs an RTX 40 or newer.
  • HairWorks works under Proton. It is built into the DX12 exe, and the NVHair*.dll / GFSDK_HairWorks files next to it are not used, so their absence from a PROTON_LOG means nothing. Every graphics preset, RT ones included, turns it back off, so set it after choosing a preset. Path-traced hair stays unavailable: it needs Linear Swept Spheres, which NVIDIA lists for RTX 50 only and dxvk-nvapi does not report.

Caution

Modifying the executable may be against the game's EULA. It does not touch any DRM, only the platform check, and it is fully reversible.

Under the hood

Why DLSS is missing under Proton

The 5.0 executable asks ntdll for wine_get_version. When it finds it (Wine/Proton), the game does three things:

  • Skips NVIDIA Streamline entirely. It never calls slInit, so DLSS Super Resolution, Ray Reconstruction, DLSS Frame Generation and Reflex are all reported as unsupported.
  • Sets a cached "Wine or Steam hardware" flag. That flag forces DLSS-G unsupported, zeroes the ray tracing capability (all RT and path tracing options greyed out), skips the path-tracing shaders, disables FSR frame generation, and changes buffer alignment.
  • Nothing else. It is not the NVAPI IDs or the D3DKMTQueryAdapterInfo type 31 queries seen in the logs.

Root-cause details: ValveSoftware/Proton#607. RT hang details: HansKristian-Work/vkd3d-proton#3226.

Patches (file offsets)
5.0.0.1041720 5.0.0.1044392 (5.00c) 5.0.0.1048522 (5.01) Original → new Effect
0x1B709CB 0x1B7169B 0x1B77ECB 75 42 → 90 90 Default and --rt: creates the Streamline manager under Wine (DLSS SR/RR, Reflex)
0x1B759A0 0x1B76620 0x1B7CE30 74 → EB Default and --rt: DLSS-G support comes from Streamline instead of the Wine flag
0x1EE2A53 0x1EDE8F3 0x1EE4C33 75 0B → 90 90 --rt, --rt-only: the Wine flag no longer set (RT, path tracing, FSR FG)
0x1EE09F7 0x1EDC897 0x1EE2BD7 75 → EB --rt, --rt-only: keep Wine's buffer alignment (needed only on vkd3d-proton older than #3308)
0x106E0D — — 20 00 00 00 → 00 01 00 00 Old --rt only, no longer applied: RT BLAS scratch default 32 → 256 MiB

@d1g1talpump found the 5.00c offsets first, in a fork of this gist that is no longer online. The offsets were checked independently here before being added. The 5.01 offsets were found here and checked in game on Proton Experimental (RTX 4090): DLSS SR/RR, DLSS-G, RT and path tracing all available.

Buffer alignment, and what was superseded

Both RT options also keep the buffer alignment behaviour Wine gets. That is only needed on vkd3d-proton older than #3308, such as the one in GE-Proton11-7: there, clearing the flag alone makes the game request tight-aligned 256-byte buffers, which get rejected, and the game crashes within seconds. On newer builds it is harmless.

Superseded: vkd3d-rtas-prebuild-x8.patch in this gist (×8 prebuild sizes) and the game-side scratch buffer 32 → 256 MiB. Both were stopgaps before the cause was known; #3332 alone is enough. The script published on 2026-09-29 still applied the scratch patch with --rt by mistake. It is harmless (it was the earlier stable setup, and costs ~224 MiB of VRAM); running --rt again with the current script takes it out, and --restore undoes it too.

diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index 44685730..3b531c9d 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -7946,6 +7946,25 @@ static void STDMETHODCALLTYPE d3d12_device_GetRaytracingAccelerationStructurePre
info->UpdateScratchDataSizeInBytes = size_info.updateScratchSize;
}
+ /* LOCAL WORKAROUND (vkd3d-proton #3226): Witcher 3 RT hangs on NVIDIA 590+ unless the RTAS result and
+ * scratch sizes reported to the application are inflated. x8 by default;
+ * VKD3D_RTAS_SIZE_MULT=<n> overrides it at runtime (1 = stock behaviour). */
+ {
+ static uint32_t rtas_size_mult;
+ uint32_t mult = vkd3d_atomic_uint32_load_explicit(&rtas_size_mult, vkd3d_memory_order_relaxed);
+
+ if (!mult)
+ {
+ mult = max(1u, vkd3d_env_var_as_uint("VKD3D_RTAS_SIZE_MULT", 8));
+ vkd3d_atomic_uint32_store_explicit(&rtas_size_mult, mult, vkd3d_memory_order_relaxed);
+ INFO("RTAS prebuild sizes are multiplied by %u (local workaround).\n", mult);
+ }
+
+ info->ResultDataMaxSizeInBytes *= mult;
+ info->ScratchDataSizeInBytes *= mult;
+ info->UpdateScratchDataSizeInBytes *= mult;
+ }
+
TRACE("ResultDataMaxSizeInBytes: %"PRIu64".\n", info->ResultDataMaxSizeInBytes);
TRACE("ScratchDatSizeInBytes: %"PRIu64".\n", info->ScratchDataSizeInBytes);
TRACE("UpdateScratchDataSizeInBytes: %"PRIu64".\n", info->UpdateScratchDataSizeInBytes);
#!/usr/bin/env python3
"""Re-enable DLSS / DLSS-G (and optionally ray tracing) in The Witcher 3 5.0 under Proton/Wine.
The Witcher 3 5.0 ("Remastered", DX12) detects Wine through GetProcAddress(ntdll, "wine_get_version") and then
deliberately skips NVIDIA Streamline (so DLSS SR/RR, DLSS Frame Generation and Reflex are unavailable) and forces
ray tracing / path tracing off. This script flips those checks in bin/x64_dx12/witcher3.exe. It only accepts the
exact builds listed in BUILDS below (5.0.0.1041720, the 5.00c hotfix 5.0.0.1044392 and patch 5.01,
5.0.0.1048522), checked by sha256.
python3 w3_proton_patch.py [path/to/witcher3.exe] DLSS SR/RR, Reflex and DLSS-G
python3 w3_proton_patch.py --rt [path/to/witcher3.exe] also RT and path tracing (read the README first:
needs a vkd3d-proton with #3332, or the GPU hangs
within a minute on NVIDIA 590+)
python3 w3_proton_patch.py --rt-only [path/to/witcher3.exe] AMD / Intel: RT, path tracing and FSR frame generation,
without the NVIDIA-only DLSS patches (RADV also needs
dxil-spirv PR #311 in vkd3d-proton; see the README)
python3 w3_proton_patch.py --restore [path/to/witcher3.exe] undo every patch (Steam "Verify integrity" also does)
add --dry-run to only report the current state.
The DLSS patches are NVIDIA only. Unofficial; use at your own risk. Close the game before running it.
"""
import argparse
import hashlib
import os
import shutil
import sys
DEFAULT_PATH = os.path.expanduser(
"~/.local/share/Steam/steamapps/common/The Witcher 3/bin/x64_dx12/witcher3.exe")
# (file offset, original bytes, patched bytes, description). Per build: the same four checks, found in 1044392 by
# matching the code around each 1041720 site with RIP-relative displacements wildcarded (each matches exactly once,
# and the instructions around it are unchanged). In 1048522 (5.01) WF and AL matched the same way; SL and DG did
# not, because a register and a stack frame changed around them, and were found through the wine_get_version
# string references and the reads of the cached Wine flag, which map one to one between the builds.
SL = "create the Streamline manager (slInit) under Wine: DLSS SR/RR, Reflex"
DG = "do not force DLSS-G 'unsupported' on the Wine flag"
WF = "clear the cached Wine flag: RT, path tracing, FSR FG"
AL = "keep buffer alignment as under Wine (only needed on vkd3d-proton older than #3308)"
BUILDS = {
90832336: {
"version": "5.0.0.1041720", "steam_build": "25575366",
"sha256": "c272b2c2e61f84c758e28fab69ab2915944dd1e539dbb435fae9fc67494c7e25",
"base": [(0x1B709CB, b"\x75\x42", b"\x90\x90", SL), (0x1B759A0, b"\x74", b"\xEB", DG)],
"rt": [(0x1EE2A53, b"\x75\x0B", b"\x90\x90", WF), (0x1EE09F7, b"\x75", b"\xEB", AL)],
# Applied by earlier versions of --rt. Not needed with vkd3d-proton #3332 and no longer applied, but still
# recognised so that --restore undoes it.
"legacy": [(0x106E0D, b"\x20\x00\x00\x00", b"\x00\x01\x00\x00",
"(old --rt, no longer applied) RT BLAS scratch 32 -> 256 MiB")],
},
90674640: {
"version": "5.0.0.1044392", "steam_build": "25646871",
"sha256": "9406eccc12b68e08920931442ef6a57340e910d3e01f2082e88232487433fe51",
"base": [(0x1B7169B, b"\x75\x42", b"\x90\x90", SL), (0x1B76620, b"\x74", b"\xEB", DG)],
"rt": [(0x1EDE8F3, b"\x75\x0B", b"\x90\x90", WF), (0x1EDC897, b"\x75", b"\xEB", AL)],
"legacy": [],
},
90715600: {
"version": "5.0.0.1048522", "steam_build": "25773555",
"sha256": "2df765398a3d1f165db418271be7200178320a4466817379f2fa0dc0001fb101",
"base": [(0x1B77ECB, b"\x75\x42", b"\x90\x90", SL), (0x1B7CE30, b"\x74", b"\xEB", DG)],
"rt": [(0x1EE4C33, b"\x75\x0B", b"\x90\x90", WF), (0x1EE2BD7, b"\x75", b"\xEB", AL)],
"legacy": [],
},
}
def has_nvidia_gpu():
try:
return any(open(os.path.join("/sys/class/drm", d, "device/vendor")).read().strip() == "0x10de"
for d in os.listdir("/sys/class/drm") if d.startswith("card") and "-" not in d)
except OSError:
return True # cannot tell; do not warn
def state_of(data, patch):
off, orig, new, _ = patch
cur = data[off:off + len(orig)]
return "original" if cur == orig else "patched" if cur == new else "unknown"
def main():
ap = argparse.ArgumentParser(
description="Re-enable DLSS / DLSS-G (and optionally RT) in The Witcher 3 5.0 under Proton/Wine.")
ap.add_argument("exe", nargs="?", default=DEFAULT_PATH)
mode = ap.add_mutually_exclusive_group()
mode.add_argument("--rt", action="store_true", help="also enable ray tracing and path tracing")
mode.add_argument("--rt-only", action="store_true",
help="AMD / Intel: RT, path tracing and FSR frame generation without the DLSS patches")
mode.add_argument("--restore", action="store_true", help="revert every patch")
ap.add_argument("--dry-run", action="store_true", help="report only, change nothing")
args = ap.parse_args()
path = args.exe
if not os.path.isfile(path):
sys.exit(f"not found: {path}")
data = bytearray(open(path, "rb").read())
build = BUILDS.get(len(data))
if build is None:
sys.exit(f"unexpected size {len(data)}: this script supports witcher3.exe (DX12) "
+ ", ".join(b["version"] for b in BUILDS.values()) + "; a newer game update needs a script update")
BASE, RT, LEGACY = build["base"], build["rt"], build["legacy"]
ALL = BASE + RT + LEGACY
version = build["version"]
states = [state_of(data, p) for p in ALL]
if "unknown" in states:
sys.exit("unexpected bytes at a patch site: different build or modified exe; nothing changed")
# Rebuild the original image in memory and check it is exactly the supported build.
orig = bytearray(data)
for off, o, _, _ in ALL:
orig[off:off + len(o)] = o
if hashlib.sha256(orig).hexdigest() != build["sha256"]:
sys.exit(f"sha256 mismatch: not witcher3.exe {version} (DX12); nothing changed")
print(f"witcher3.exe {version} (Steam build {build['steam_build']})")
print("current state:")
for p, s in zip(ALL, states):
print(f" 0x{p[0]:07X} {s:8} {p[3]}")
if not args.restore and not args.rt_only and not has_nvidia_gpu():
print("WARNING: no NVIDIA GPU found. The DLSS patches are for NVIDIA; on AMD or Intel use --rt-only "
"(RT and FSR frame generation). See README.")
if args.restore:
target = bytes(orig)
elif args.rt or args.rt_only:
# Exactly the chosen set, from the original: --rt-only takes out DLSS patches from an earlier run, and both
# take out the old scratch patch an earlier --rt applied.
target = bytearray(orig)
for off, _, new, _ in (RT if args.rt_only else BASE + RT):
target[off:off + len(new)] = new
target = bytes(target)
else:
target = bytearray(data)
for off, _, new, _ in BASE:
target[off:off + len(new)] = new
target = bytes(target)
if target == bytes(data):
print("nothing to do")
return
if args.dry_run:
print("dry run: would write changes")
return
backup = path + ".orig-" + version
if not os.path.exists(backup):
with open(backup, "wb") as f:
f.write(bytes(orig))
print(f"backup of the original: {backup}")
tmp = path + ".tmp-patch"
with open(tmp, "wb") as f:
f.write(target)
shutil.copymode(path, tmp)
os.replace(tmp, path)
if args.restore:
print("restored the original")
elif args.rt_only:
print("patched: RT/path tracing and FSR frame generation only (no DLSS patches)")
else:
print("patched: DLSS/DLSS-G" + (" + RT/path tracing" if args.rt else ""))
if args.rt or args.rt_only:
print("WARNING: RT under Proton needs a recent vkd3d-proton: with #3332 on NVIDIA 590+ (or the GPU hangs), "
"and on AMD (RADV) also with dxil-spirv PR #311 (or the game crashes while loading). See README.")
if __name__ == "__main__":
main()
@gabrielmaialva33

Copy link
Copy Markdown
Author

@San10deep nice find, thanks for reporting back! On laptops that can do it, turning off the iGPU (or dGPU-only/MUX mode) in the BIOS is the cleanest fix for this, since the game can't pick the wrong GPU anymore.

DLSS showing as not supported is a separate thing: the game's Wine check, which is what this gist is about. Which Proton are you on? The easiest route is Proton Wineland 11.0-20260930 or newer with the original exe (the "Recommended" section at the top). On Proton Experimental, the sed one-liner does it. Frame generation will stay off on a 3050, since DLSS-G needs an RTX 40, but DLSS SR should show up. If it's still greyed out after that, run once with PROTON_LOG=1 %command% and post the steam-292030.log.

@San10deep

San10deep commented Oct 5, 2026 •

Copy link
Copy Markdown

@gabrielmaialva33 Proton Wineland 11.0 (20261005) (lastest) did the trick DLSS is back on RT also shown im dont think it would work so keeping it off for now should i also enable and test it ??

I have also added the settings config for anyone requiring help some settings are set to low to make the white ghosting halo around characters

[Rendering/RT/HBIL]
UseHBIL=false
HBILImpact=1
[Gameplay/EntityPool]
SpawnedLimit=130
[Hidden]
HasSetup=true
uiVerticalFrameScale=1
uiHorizontalFrameScale=1
[RTXGI/GlobalGrid]
ProbeMaxRayDist=128
[Localization]
RequestedSpeechLanguage=
SpeechLanguage=EN
RequestedTextLanguage=
TextLanguage=EN
[Viewport]
VSync=false
Resolution="1920x1080"
ReflexMode=2
FullScreenMode=2
AMDAntiLag=0
OutputMonitor=0
[Budget]
TerrainTileMipDataBudget=100
TerrainTileMinTimeout=2
TerrainTileTimeout=10
OcclusionQueryAdditionalMemory=5
TerrainTileLoadingTimeout=5
[ContentManager/Mods]
EnabledLocal=true
EnabledWorkshop=true
MaxNameLength=64
Enabled=true
[Audio]
DynamicRange=1
EnhancedHeadphoneMode=false
Subtitles=true
[LoadingScreen/TCR]
ShowProgress=true
[Game]
DoNotPauseWhileStopped=false
[Scripts]
DebugScriptsForceFlush=true
DebugScriptsLogDir=
[Rendering/RT/PathTracer]
PTHairQualityMode=0
PTLateSpecularScreenSpaceTrace=true
PTEnable=false
PTLateSpecularCheckerboard=true
[PostProcess]
WaterFogPerPixel=true
XeLowLatency=false
DLSSGNumFramesToGenerate=1
SharpenAmount=1
MotionBlurPositionTreshold=0.05
DLSSQuality=1
LockhartPerformanceMode=false
RCASAmount=0.2
FSRSharpnessLow=0.3
AAMode=6
DLSSGMode=0
MotionBlurRotationTreshold=1
FogUseDistInColorLerp=1
AllowMotionBlur=false
XESSQuality=4
FSR1Quality=0
AllowLensEffects=true
NISSharpness=0.2
XessFrameGeneration=false
EnableDLSSRR=false
SSAOEnabled=3
FSRFramegen=0
MotionBlurIntensity=10
AllowBlur=false
FSR2Quality=3
FSRSharpnessHigh=1
XeLowLatencyFrameRateControl=0
[Input]
PadVibrationEnabled=true
KeyboardCooldownSpeed=0.1
InvertCameraXOnMouse=false
InvertCameraYOnMouse=false
CameraAutoRotX=true
FreeCameraSpeed=1
PadVibrationAmount=10
InvertCameraX=false
UIMouseSensitivity=1
CameraAutoRotY=true
RightStickCameraSensitivity=1
InvertCameraY=false
RightStickAimSensitivity=1
MouseSensitivity=1
ForceDisableTouch=false
SteamController=0
ForceDisablePad=false
FreeCameraSensitivity=1
AdaptiveTriggersEnabled=true
AdaptiveTriggersAmount=10
[DLC]
DlcEnabled_dlc_010_001=1
DlcEnabled_dlc_015_001=1
DlcEnabled_dlc_005_001=1
DlcEnabled_dlc_007_001=1
DlcEnabled_dlc_013_001=1
DlcEnabled_dlc_004_001=0
DlcEnabled_dlc_017_001=0
DlcEnabled_dlc_006_001=0
DlcEnabled_dlc_001_001=1
DlcEnabled_dlc_008_001=1
DlcEnabled_dlc_011_001=1
DlcEnabled_dlc_020_001=0
DlcEnabled_dlc_002_001=1
DlcEnabled_ep1=1
DlcEnabled_dlc_014_001=1
DlcEnabled_dlc_009_001=1
DlcEnabled_dlc_018_001=1
DlcEnabled_bob_000_000=1
DlcEnabled_abob_001_001=1
DlcEnabled_dlc_012_001=1
DlcEnabled_dlc_003_001=1
DlcEnabled_dlc_016_001=1
DlcEnabled_dlc_011_002=0
[WatermarkOverlay/TCR]
FadeOutCooldownExtraTime=1
FadeInSpinnerTime=1
NoninteractiveSpinnerTime=3
FadeOutSpinnerTime=1
NoninteractiveEndCooldown=1
[Rendering/RT/RoughnessRemap]
RemapDerivative0=0
RemapDerivative3=1
RemapDerivative2=1
RemapDerivative1=2
[Rendering/DRS]
Enable=false
[Gameplay]
AutoApplyBladeOils=false
ModioEnabled=true
LootMergeEnabled=true
DisableAutomaticSwordSheathe=false
Difficulty=4
CrossProgression=true
MarketingConsent=false
TelemetryConsent=true
AutosaveTimeInterval=15
EnableAlternateSignCasting=1
EnableUberMovement=1
EnemyUpscaling=true
[LevelOfDetail]
SwarmHideDistance=200
DecalsHideDistance=40
DimmerHideDistance=60
DynamicDecalsHideDistance=20
StripeHideDistance=60
[General]
ConfigVersion=7
[LoadingScreen/Editor]
Disabled=false
[Rendering/RT]
EnableAOSSSampling=true
RtRadianceScreenSpaceTrace=true
EnableRT=false
BalanceModeRT=false
RTGIPreset=false
Shadows=0
LocalShadowsAllLightsCastShadows=false
EnableRtRadiance=false
RTAOEnabled=false
EnableAOPretrace=true
[Scene]
SceneDirectorCommentCharLineLimit=180
SceneDirectorCommentPosX=50
SceneDirectorCommentPosY=300
SceneDirectorCommentTextScale=0.4
[LoadingOverlay/TCR]
FadeOutCooldownExtraTime=1
FadeInSpinnerTime=1
NoninteractiveSpinnerTime=3
FadeOutSpinnerTime=1
NoninteractiveEndCooldown=1
[Accessibility]
NoAirDrain=false
MotionSicknessFocusMode=false
AutoLoot=false
DisableDurabilityBoat=false
FocusToggle=false
DisableDurabilityItem=false
ColorblindFocusMode=false
WeightlessItems=true
FastBoats=false
HideHerbs=false
HideCorpse=false
LowHPAutoHealOn=false
[Marketing]
Countdown=0
LastLaunchVersion="v 5.00c"
[RTXGI/Grid1]
ProbeMaxRayDist=128
[Visuals]
HdrPaperWhite=300
AllowClothSimulationOnGpu=false
InventoryBgColorScaleB=0.036
InventoryFixedLuminance=0.25
InventoryBgColorScaleG=0.034
MovieFramerate=30
HdrEnabled=false
GammaValue=0.92
HdrSaturation=0.2
MaxTVBrightness=500
InventoryBgColorScaleR=0.02
[Galaxy]
DevSaveMarks=false
tokenRefA=
SaveAllowTickMarks=true
[Rendering]
AllowReflex=false
ShowStreamlineConsole=false
GrassDensity=3500
DecalsSpawnDistanceCutoff=10
GlobalOceanTesselationFactor=32
HairWorksGlobalWidthLimit=2.25
CascadeShadowDistanceScale2=1
MaxTextureAnizotropy=16
AllowDLSS=true
HairWorksGlobalStrandSmoothness=2
HairWorksGlobalDensityQuality=0.75
CascadeShadowDistanceScale3=1
HairWorkstGlobalDensityLimit=0.35
TextureStreamingHeadsDistanceLimitSq=100
MeshLODDistanceScale=1.2
AllowDLSSRR=true
ScaleformTextureUnstreamDelay=2.5
DecalsChance=1
MaxAtlasTextureSize=4096
TerrainReadAheadDistance=200
AllowDLSSG=true
SSREnabled=false
HairWorksLevel=0
MaxTextureArraySize=2048
TerrainScreenSpaceErrorThreshold=2
TerrainScreenSpaceErrorThresholdFar=5
TextureStreamingCharacterDistanceLimitSq=225
TextureStreamingDistanceLimitSq=40000
HairWorksGlobalDetailLODFactor=0.65
AllowStreamline=true
TextureMipBias=-1
DeveloperMode=false
TextureInFlightCountBudget=12
ShouldRefetchUpscaler=true
CascadeShadowDistanceScale0=1
MeshRenderingDistanceScale=1.5
WidescreenCutscene=false
HairWorksAALevel=0
TextureInFlightCountBudgetLoadingMode=256
CascadeShadowDistanceScale1=1
[Input/Gestures]
EnableSwipe=true
EnablePan=true
EnableGestures=true
EnablePinch=true
[Visuals4K]
PerformanceMode=false
[LoadingScreen]
FadeInTime=3
SkipShowWithAnyKey=true
GameRevealTime=3
SkipHideDelay=3
SkipInputDelay=0.25
FadeOutTime=1.5
SkipAutoshow=false
[Rendering/TAA]
CASPacked=false
CASDistanceDecayStrength=0.6
CASAmountNear=1
CASAmount=1
CASDistanceDecayPower=1.5
CASDenoise=true
TAAUseLDS=false
CASDistanceBased=true
CASFast=false
CASAmountFar=0
EnableCAS=true
[Engine]
LimitFPS=0
[StartupFlow]
LastSeenVersion=500
LaunchCounter=1
[Rendering/SpeedTree]
GrassGenerationEfficiency=0.075
GrassDistanceScale=2
SRTGrassExtraRange=2
FoliageDistanceScale=1.5
FoliageShadowDistanceScale=16
GrassRingSize=6291456
[Rendering/TrimGrass]
trimSlopeMost=0.6
trimSizeMedium=0.65
trimSlopeMedium=0.07
trimSizeBig=1.2
trimSizeSmall=0.1
trimSlopeLeast=0.01
[Rendering/Shadows]
MergedShadowsCascade4LOD=0
MergedShadowsCascade2LOD=0
MergedShadowsCascade3LOD=0
ScreenShadows=true
[Gameplay/BoatCamera]
BoatLocalSpaceCamera=false
[Save]
ShowCompatWarning=false
[Streaming/Textures]
CinematicModeMipBias=1
[Kinect]
Kinect=true
[Foliage]
MaxVisibilityDepth=12

@gabrielmaialva33

gabrielmaialva33 commented Oct 5, 2026 •

Copy link
Copy Markdown
Author

@San10deep great, glad it's working! Sure, give RT a try: on Wineland it won't hang the GPU. Just keep expectations low on a laptop 3050, since RT is heavy and 4 GB of VRAM (6 GB on some models) fills up fast. Path tracing is out of reach there. Turn on one RT option at a time with DLSS on Performance, and if it stutters or drops below ~30 fps, switch it back off.

And thanks for sharing your settings! Quick note for anyone copying them: that's the whole user.settings, so it also carries personal stuff like difficulty, DLC toggles, language, accessibility options (WeightlessItems=true), gamma and AllowReflex=false. Better to copy only the lines you need. Do you know which one fixed the white halo around characters? My guess is [Rendering/RT/HBIL] UseHBIL=false, since horizon-based effects work in screen space and tend to leave halos around moving characters. If you can confirm, I'll add it to the troubleshooting table.

@micker

micker commented Oct 6, 2026

Copy link
Copy Markdown

hello i try to use it with my zephyrus g14 (rtc 4060) + faugus on garuda impossible to actived dlss .. some one can help me ?

@gabrielmaialva33

Copy link
Copy Markdown
Author

@micker two things to check on the G14:

  1. Faugus. Wineland's Witcher 3 fix is applied only when Steam launches the game, so through Faugus you set it once by hand. Use Proton Wineland 11.0-20261005 or newer for the game, then in Faugus: right-click the game → Edit → Tools → Winetricks → "Select the default wineprefix" → "Run a Wine cmd shell", and enter:
    reg add "HKCU\Software\Wine\AppDefaults\witcher3.exe" /v HideWineExports /t REG_SZ /d Y /f
    
    Full steps in nanomatters/proton-cachyos#77. Use the original exe: if you ran the patch script before, --restore it first.
  2. Hybrid GPU. The G14 can hand the game the AMD iGPU, which looks exactly like this: DLSS "not supported", Low preset, low FPS. Add __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only to the game's launch arguments in Faugus or, if your model has a MUX switch, put it in dGPU mode (ROG Control Center / supergfxctl) and reboot.

If DLSS is still greyed out after both, run it once with PROTON_LOG=1 and post the log.

@micker

micker commented Oct 6, 2026

Copy link
Copy Markdown

hello thanks for your return
1 i do wineprefix but i am not sure that works after doing reg when i close cmd i need to close all other windows choose
2 i add argument
3 this is my log https://filepaste.app/p/0jm2s2gr
thanks for your help

@gabrielmaialva33

Copy link
Copy Markdown
Author

@micker thanks, the log helps. The GPU part is fixed: the game runs on the NVIDIA GPU now. What's left is the Wine check: Streamline still says "SL not initialized", so the game still sees Wine. The registry key didn't end up in the prefix Faugus runs the game with.

The quickest way around it is to skip the registry and rename the string the game looks for, in the game's bin/x64_dx12 folder:

cd "<game folder>/bin/x64_dx12"
cp witcher3.exe witcher3.exe.orig
sed -i s/wine_get_version/frog_get_version/ witcher3.exe

It's safe with Wineland 20261005, which has the vkd3d-proton fixes it needs, and putting the .orig back undoes it. Then pick DLSS in Options → Graphics; frame generation works on a 40-series laptop GPU too.

If you'd rather keep the exe untouched, check that the key really is in the prefix from the game's Edit window in Faugus: grep -A2 -i 'witcher3.exe' <prefix>/user.reg should show "HideWineExports"="Y".

@micker

micker commented Oct 7, 2026

Copy link
Copy Markdown

it works !!! many thanks !

@gabrielmaialva33

Copy link
Copy Markdown
Author

Patch 5.01 is out and the gist is updated for it: w3_proton_patch.py now supports 5.0.0.1048522 too (Steam build 25773555), tested in game on Proton Experimental with DLSS SR/RR, DLSS-G, RT and path tracing all available. If it said "unexpected size" today, download it again. Wineland and the sed one-liner work on 5.01 unchanged. One thing to know: @p-valentin's crash fix is for 5.00c only for now, and the same race is still in 5.01's code.

@tuxrinku

tuxrinku commented Oct 9, 2026

Copy link
Copy Markdown

Thanks for the guide, I managed to get everything working including DLSS-NR, but here and there I get a GPU crash with the following error : NVRM: Xid (PCI:0000:01:00): 109, pid=2970526, name=witcher3.exe, channel 0x0000000a, errorString CTX SWITCH TIMEOUT, Info 0x2c00d

According to this thread it's been apparently fixed, but I still get this error frequently. I'm on a RTX 4080 with the 615.71.09 driver on CachyOS. I'm using the latest proton-cachyos which is based on the proton-experimental-11.0-20261001 build that should be including the fix addressing this error.

Any idea how I can fix it ?

@gabrielmaialva33

Copy link
Copy Markdown
Author

@tuxrinku I got the same Xid 109 on a 4090 while chasing the RT hang, but it stopped once the vkd3d-proton fix was in: nothing in my kernel log since Sept 29, and I've been playing with DLSS-NR, RR and path tracing on Proton Experimental 20261001 and Wineland 20261005 since then.

A few things worth checking:

  1. Do you have PROTON_VKD3D_LOWLATENCY=1 in your launch options? With it, proton-cachyos uses vkd3d-low-latency, which is based on vkd3d-proton 3.0.1 and doesn't have the fix. Drop it if it's there.
  2. Check that the fix is actually loaded: launch with PROTON_LOG=1 and look for vkd3d-proton - build: in ~/steam-292030.log. It should say 44cf7c2042168f3 (or a newer master build).
  3. If both look right, narrow it down: play a while with NR off (F7) and RT on, then with RT off and NR on. The old RT hang hit about 40 s after turning RT on, every single time, so a crash "here and there" may be something else.

If it keeps happening, post the DLSS-NR lines from OptiScaler.log (next to witcher3.exe) and roughly when the Xid hit, and I'll take a look.

@tuxrinku

Copy link
Copy Markdown

Turns out it was because of my GPU overclock, even though I had no problem with it before, resetting it fixed the issue. I suppose DLSS-NR is really pushing your GPU to its limits. Thanks !

@gabrielmaialva33

Copy link
Copy Markdown
Author

Glad you found it! Makes sense: the NR model is a lot heavier than DLSS upscaling and runs every frame, so an overclock that's fine elsewhere can still fall over here. I'll add a note about it to the NR section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment