The Witcher 3 NG 4.02 - RT Optimalization Guide / Memory Leak Fix

+

Tips and tweaks to gein better peformance:

- i recommend to delete every time dx12user.settings and user.settings files (for DX11 mode) from <ur documents>/The Witcher 3 Folder, after any game update or before you try my new mod version or after you removed some other mods. When you start the game this file will be automaticly restored to default config, you just need to configure again ur in game gameplay and graphic/video etc. settings.

1) Fix Memory Leak (mostly for Nvidia GPU with lower VRAM size then 20GB for 4K res. or <16GB for 1440p and <12GB for 1080p)

- Change Anisotropic filtering in Nvidia Control Panel to x16 (Sadly it's not possible in AMD GPU, AF settings in Adrenaline Software not works for DX12 games...):

- In Nvidia Control Panel in Menage 3d Settings -> Program Settings and choose witcher3.exe (from <game installation directory/bin/x64_d12 folder) and set Anisotropic filtering to x16
(*if u had it chosen already then first restore this exe to default settings and then change AF to x16)

Texture Filtering - Negative LOD Bias : have to be set to Clamp
Textures Filtering Quality setting
have to be set to Quality
Textures FIltering trilinear optimalization
have to be set to On
(in default they are set like that but sure u have it set exacly like that, like on the video above) otherwise FIX WON'T WORK.

* Minus
of those settings is more blured and not so sharp textures compared to default AF build in game engine but, after you change in game settings of Sharpening to High, then it will give you very smillar results, look: https://imgsli.com/MTU2MDcy/0/5
but Plus of this also is 5-7% fps boost

2) For Nvidia GPU Fix bug in Nvidia drivers causing higher Frametime Spikes:

-in Nvidia Control Panel go to Menage 3d Settings -> Program Settings and choose witcher3.exe (same like in AF fix), then change Low Latency to Ultra and Power Menagment Mode in to Prefer Maximum Performance

3) Allowing cloth simulation counting on GPU:

- Change this setting by opening file dx12user.settings (in ur documents W3 folder) in notepad and find line:
AllowClothSimulationOnGpu= change from false to true and save file.


4) Enabled Hardware-Accelerated GPU scheduling

- Make sure u have it enabled, its needed to enable DLSS from in game Anti-Aliasing settings and also DLSS frame generation (DLSS 3.0 Frame Gen. it's only for RTX 4000 series GPU)
https://support.cdprojektred.com/en...-enable-hardware-accelerated-gpu-scheduling-1 -


5) Use Raytracking mod:

All-in-One RT Performance Tweaks + Memory Leak Fix

  • Greatly Improves both CPU and GPU demanding area performance up to 25% FPS boost compared to Vanilla 4.02 RT performance mode:

6) Gein more FPS by changing graphic settings:

- Ray tracking Settings set to On
- Ray Tracking Global Illumination
set to Performance
- Ray Tracked Imbient Acclusion
set to On
- Ray Tracked Shadows
have to be to Off ( RT Shadows at On may look bad with this mod! Even so, RT Shadows are quite demanding and still often flicker and popup in low distance, this destroys immersion)
- Ray Tracked Reflections have to be to Off( RT Reflections at On may look bad with this mod! Even so, Reflections still will be visable and looks just like SSR on High without RT, even if you set SSR to Low)
- Screen Space Reflections (SSR):
set to Low ( like i wrote above, with RT GI turned On there is no visual differences between SSR Low or High : https://imgsli.com/MTU1NTU2/4/5, https://imgsli.com/MTU1NTU2/4/3 )
- Anti-Aliasing:
to DLSS (nVidia RTX Cards) / FSR2 (Nvidia GTX/AMD/Intel Cards)
- DLSS/FSR2 settings to: Quality for resolution 1080p, Balanced or Performance for res. 1440p or higher.
- for RTX 4000 series GPU Disable DLSS frame Generation (DLSS 3.0) option in game Video settings ( after 4.02 update Frame Gen. is broken and causing crashes)
- Hairworks: to Off
( is very demanding and still bugged like Geralt's dark hair)
- Shadow quality: to High ( still good quality with minimal differences between Ultra+)
- Foliage visibility range: to High (same like above)
- Grass density: to High ( same like above)
- Water Quality to Ultra ( same like above)
- Number of Background Characters: to High (this setting is very CPU demending in Cities, if you have High IPC CPU like ryzen 5000 series (or newer) or intel 11 gen series ( or newer) then i recomend High, for faster CPU set Ultra (no much differences between Ultra+), but if you want to releave CPU usage then go to Medium o lower.
- Terrain Quality to Ultra (there is no much diferences in performance and visually between Ultra+, but may relive some of VRAM usage)
- Textures to Ultra(same like above)
- Detail Level to High ( still good quality with minimal visual differences and less objects for RT calculations)

7) Check Nvidia Reflex options (to On or On + Boost):

- it should reduce frametime spikes to minimum and lower almost two times frametime in ms, thats will give overall smoothnes gameplay , without microsecound stuttering when Reflex it's turned OFF. It may reduce ur FPS by few frames, but it's still worth it.

8) Disable Control Flow Guard (CFG) for game exe:

- you can disable it in Winows defender settins for game witcher3.exe in x64_d12 folder (or x64 for DX11 mode). More info here: https://www.techpowerup.com/forums/...ows-10-fixes-various-games-stuttering.258819/

9) Disable Steam, GOG and other programs with in game overlay:

for Steam:
Go into your library and right-click on the game's name, the click "properties". Then just untick the box that says "Enable the Steam Overlay while in-game".
for GOG:

Go into GOG settings icon (lelft upper corner) -> Settings -> Game Features -> at in game features untick the box "overlay"
For others program with in game overlay just google it =).


10) For Nvidia RTX GPU Install latest DLSS DLL 3.1.1 :

https://www.techpowerup.com/download/nvidia-dlss-dll
unpack and copy nvngx_dlss.dll file to <game directory>/bin/x64_dx12 folder and replace files.


11) Install latest GPU drivers:

- For Nvidia: https://www.nvidia.com/download/index.aspx
- for AMD: https://www.amd.com/en/support
- For Intel: https://www.intel.com/content/www/us/en/download-center/home.html


My laptop config:
1672501395915.png

All in Game settings:

Here's a screen graphic comparison:

 
Last edited:
At least for me, reflections are kind of glitched if you enable RT but disable RT reflections (there's this weird black bar that appears on the right side when looking at water, goes away if you enable RT reflections)
 
4 Tips to gein better FPS with RT On:

1)
Gein more FPS by chaning graphic setting to:

Shadow quality: High
Foliage visibility: High
Grass density: High


Lowering these 3 setting give 50+% FPS boost with minimal visual differencess.


2) Allowing cloth simulation counting on GPU:
Change this setting by opening file dx12user.settings (in ur documents W3 folder) in notepad and find line:
AllowClothSimulationOnGpu= change from false to true and save file.
To get even better preformance go to W3 instalation folder and to bin\x64_dx12, then rename file: APEX_ClothingGPU_x64.dll ( e g. add _backup in end or just move it outside x64_dx12 folder).

Because DX12 mode is hevy one/two threads CPU demanding and that's why GPU is not used on 100%, allowing cloth simulation on GPU relive CPU usage.
It will changes how the game handles physX (probably by GPU driver) and that can actually improve FPS by 15-30% in some areas.
(for DX11 mode just edit user.setting file in same way if you want)


3) Use modded optimized RT setting:
Download OptimizedRT.ini file and unpack it to <ur game folder>\bin\config\platform\pc
This could increase FPS by another ~40-50% FPS. And maybe more in the future, just follow this thread in nexusmod.


4) Disable RT Shadows and Reflections (RT Quality of Next Gen Consols settings):
  • Ray Traced Shadow: Off - i prefer that way bacuse with On RT Shadow are sometimes flicker and popup in low distance, for me it's annoying.
  • Ray Traced Reflections: Off - on off reflections will be still visable and much better then without RT
Thank you very much!
Do you notice a big difference between quality and performance presets for "Optimized raytracing" mod?
 
Being lazy here... Somebody went through all of this and got FPS before/after? Regardless of rig, just to get a total approximated FPS gain.

Don't judge me, it's the holidays!
 
I am personally still having issues (RTX 3080) but this did help.

I should add, that the differences are more noticeable after restarting the game (although my issue is that system RAM (not VRAM) climbs well over 20GB from 10GB over time)
 
Gains are likely to vary from computer to computer because all the RTX optimizations in the world won't help much with the CPU bottleneck inherent in the game. So if you have say a Ryzen 3600X hooked up to a RTX4080 you aren't ever going to get the same FPS as someone that has Ryzen 7800X or an Intel 13900 hooked up to a RX4080 because you are going to be more limited due to lack of CPU power. If they ever get the CPU bottleneck fixed then we'll see so really big gains in RT performance.

I found this tweak to be the most interesting because it would likely help even with RT not enabled
AllowClothSimulationOnGpu= change from false to true and save file.

That should help take some of the load off the CPU especially if that runs on one of the threads that is getting maxxed out especially if you notice your GPU is being underutilized (less than 98% usage) because of the CPU bottleneck
 
Gains are likely to vary from computer to computer because all the RTX optimizations in the world won't help much with the CPU bottleneck inherent in the game. So if you have say a Ryzen 3600X hooked up to a RTX4080 you aren't ever going to get the same FPS as someone that has Ryzen 7800X or an Intel 13900 hooked up to a RX4080 because you are going to be more limited due to lack of CPU power. If they ever get the CPU bottleneck fixed then we'll see so really big gains in RT performance.

I found this tweak to be the most interesting because it would likely help even with RT not enabled
AllowClothSimulationOnGpu= change from false to true and save file.

That should help take some of the load off the CPU especially if that runs on one of the threads that is getting maxxed out especially if you notice your GPU is being underutilized (less than 98% usage) because of the CPU bottleneck
It was in Guide, just added info to disable Hairworks and added screen comparison:

for me it was 90% FPS boost witl Full RT and 120% FPS boost with RT (GI + AO)
 
It was in Guide, just added info to disable Hairworks and added screen comparison:
for me it was 90% FPS boost witl Full RT and 120% FPS boost with RT (GI + AO)
You are still nowhere near your full potential performance though because of the CPU bottleneck, in your picture you only have 63% GPU utilization when it should really be 98-99% ..... That's the effect of one or two CPU threads maxing out at 100% and limiting the number of frames fed to your GPU by your CPU. To make matters worse most of your CPU threads are doing next to nothing which is why you average CPU utilization is so low.

If you have an 8 core 16 thread CPU and 2 threads are at 100% and the rest at running at 10% then you average CPU utilization will only be 11% which is why you really need to monitor all threads before you can determine whether or not you have a CPU bottleneck. That's why I have my system monitor which runs on a seperate 7" LCD set up to look like this. This is what it looks like when I have 4 tabs open in Chrome and playing a YouTube video

Sensor Panel.jpg
 
You are still nowhere near your full potential performance though because of the CPU bottleneck, in your picture you only have 63% GPU utilization when it should really be 98-99% ..... That's the effect of one or two CPU threads maxing out at 100% and limiting the number of frames fed to your GPU by your CPU. To make matters worse most of your CPU threads are doing next to nothing which is why you average CPU utilization is so low.

If you have an 8 core 16 thread CPU and 2 threads are at 100% and the rest at running at 10% then you average CPU utilization will only be 11% which is why you really need to monitor all threads before you can determine whether or not you have a CPU bottleneck. That's why I have my system monitor which runs on a seperate 7" LCD set up to look like this. This is what it looks like when I have 4 tabs open in Chrome and playing a YouTube video

View attachment 11339215
No need to inform us, We all know that and nothing can't be done about it caus of shitty DX12 mode wrapper that CDP release. Maybe in future update will be fixed this crappy dx12 mode, but i lost my trust to CDP...

DX11 mode works much better:
Optimalization Setting on DX11.png

and after reaching the center:

Optimalization Setting on DX11 center.png

i wish to get same core usage in DX12 but i canno't use magic... and that's how you have to look on preformance, graphs tell you much more infomations.
 

Attachments

  • Optimalization Setting on DX11.png
    Optimalization Setting on DX11.png
    3.1 MB · Views: 201
  • Optimalization Setting on DX11.png
    Optimalization Setting on DX11.png
    3.1 MB · Views: 204
Last edited:
Whenever i walk around in Novigrad for extended periods of time GPU memory runs full when RT is on.
This happens even with textures at medium, it actually doesn't seem there is a difference in memory usage between Ultra+ and Medium.
But i have no idea how that is possible.
You have any clue what settings take up more VRAM???
 
No need to inform us, We all know that and nothing can't be done about it caus of shitty DX12 mode wrapper that CDP release. Maybe in future update will be fixed this crappy dx12 mode, but i lost my trust to CDP...

Well you don't know as much as you think you do because CDPR is NOT using a DX12 "wrapper" for anything other than a couple of menus in the game, the EXACT SAME wrapper you use every time you use the Steam or RTSS overlays which are also written in DX11 and need to call up d3d11on12.dll from the System32 folder to make them work with DX12 games ...... That 'wrapper" doesn't really affect game performance one way or another and I doubt you even noticed it was already running in every DX12 game when using the Steam overlay. You've been using it in DX12 games for years and didn't even know it
Post automatically merged:

Whenever i walk around in Novigrad for extended periods of time GPU memory runs full when RT is on.
This happens even with textures at medium, it actually doesn't seem there is a difference in memory usage between Ultra+ and Medium.
But i have no idea how that is possible.
You have any clue what settings take up more VRAM???
That is basically tied to the same problem as the CPU usage/bottleneck problem. In DX11 CPU and memory usage was done mainly in the DX11 drivers where in DX12 CPU and memory usage has to be programmed into the game engine's core functions. The CPU is what controls the memory transfers from system memory to the GPU's memory and why ReBAR is so beneficial IF it is programmed correctly. I suspect it's not flushing anymore old GPU memory than it has to that is so when you return to an area your were at recently it doesn't have to transfer all those assets from system memory to GPU memory again. That's what speeds up load times when you fast travel. Especially on the last gen consoles the reason fast travel was so slow it first it had to transfer the assets from the hard drive to system memory and then from system memory into the GPU memory. One thing the new gen consoles can do that is still lagging behind on PC is the ability to transfer assets from a fast NVMe drive directly into GPU memory in large GB chunks whereas for the most part the PC still has to transfer to system memory and in most cases is limited to transferring 256 MB chunks from system memory to GPU memory. Simply enabling ReBAR for people who have the CPUs and GPUs made in the last 2-3 years doesn't really help much unless the game engine is programmed to take advantage of it plus the fact that it still isn't really fully implemented in Windows in any meaningful way compared to current gen consoles.

The bottom line here is it is going to take a major overhaul of the game engine to correct these problems and if they aren't willing to do that then management should have never decided to try to put Ray Tracing in the game. Frankly I feel sorry for the Devs because they have to take all the heat for the bad decisions made by upper management who probably don't know a bit from a byte or an electron from a proton or their own butt from a hole in the ground. 99% of business failures are caused by bad management not bad workers so give the Devs a break and direct your anger to upper management

For those who are actually interested in the differences between DX11 and DX12 and why the conversion from DX11 to DX12 is no simple task I highly recommend this recently updated article that explains the basics or this one that is a little more in-depth. For a deeper dive I suggest the documentation found on the Microsoft website which is quite extensive
 
Last edited:
Well you don't know as much as you think you do because CDPR is NOT using a DX12 "wrapper" for anything other than a couple of menus in the game, the EXACT SAME wrapper you use every time you use the Steam or RTSS overlays which are also written in DX11 and need to call up d3d11on12.dll from the System32 folder to make them work with DX12 games ...... That 'wrapper" doesn't really affect game performance one way or another and I doubt you even noticed it was already running in every DX12 game when using the Steam overlay. You've been using it in DX12 games for years and didn't even know it
Post automatically merged:


That is basically tied to the same problem as the CPU usage/bottleneck problem. In DX11 CPU and memory usage was done mainly in the DX11 drivers where in DX12 CPU and memory usage has to be programmed into the game engine's core functions. The CPU is what controls the memory transfers from system memory to the GPU's memory and why ReBAR is so beneficial IF it is programmed correctly. I suspect it's not flushing anymore old GPU memory than it has to that is so when you return to an area your were at recently it doesn't have to transfer all those assets from system memory to GPU memory again. That's what speeds up load times when you fast travel. Especially on the last gen consoles the reason fast travel was so slow it first it had to transfer the assets from the hard drive to system memory and then from system memory into the GPU memory. One thing the new gen consoles can do that is still lagging behind on PC is the ability to transfer assets from a fast NVMe drive directly into GPU memory in large GB junks whereas for the most part the PC still has to transfer to system memory and in most cases is limited to transferring 256 MB chunks from system memory to GPU memory. Simply enabling ReBAR for people who have the CPUs and GPUs made in the last 2-3 years doesn't really help much unless the game engine is programmed to take advantage of it plus the fact that it still isn't really fully implemented in Windows in any meaningful way compared to current gen consoles.

The bottom line here is it is going to take a major overhaul of the game engine to correct these problems and if they aren't willing to do that then management should have never decided to try to put Ray Tracing in the game. Frankly I feel sorry for the Devs because they have to take all the heat for the bad decisions made by upper management who probably don't know a bit from a byte or an electron from a proton or their own butt from a hole in the ground. 99% of business failures are caused by bad management not bad workers so give the Devs a break and direct your anger to upper management
Idk, it seems low textures kinda worked to stay at around 7 GB Memory usage when roaming Novigrad, but that seems way way too high considering we are coming from a game that would use about 3 GB at it's ultra settings.
Now we have raytracing and better textures, but should that alone more than double the requirement ??
I guess you are right in that they didn't bother to program the memory management into the core of the engine.
 
Idk, it seems low textures kinda worked to stay at around 7 GB Memory usage when roaming Novigrad, but that seems way way too high considering we are coming from a game that would use about 3 GB at it's ultra settings.
Now we have raytracing and better textures, but should that alone more than double the requirement ??
I guess you are right in that they didn't bother to program the memory management into the core of the engine.
RT on DX12 game mode has a memory leak issue or something like that in demanding places like Novigrad, causing FPS drop to half less or even more and FPS will not recover till game restart. We can't do nothing about it till CDP release fix for it, but when and if it will be fixed nobody know...
Well you don't know as much as you think you do because CDPR is NOT using a DX12 "wrapper" for anything other than a couple of menus in the game, the EXACT SAME wrapper you use every time you use the Steam or RTSS overlays which are also written in DX11 and need to call up d3d11on12.dll from the System32 folder to make them work with DX12 games ...... That 'wrapper" doesn't really affect game performance one way or another and I doubt you even noticed it was already running in every DX12 game when using the Steam overlay. You've been using it in DX12 games for years and didn't even know it
Post automatically merged:
I sad wrapper bacuse is that shitty implamentation dx12 again no need to inform us, specialy in guide thrid it's not place for that like you didn't know about it...
 
Idk, it seems low textures kinda worked to stay at around 7 GB Memory usage when roaming Novigrad, but that seems way way too high considering we are coming from a game that would use about 3 GB at it's ultra settings.
Now we have raytracing and better textures, but should that alone more than double the requirement ??
I guess you are right in that they didn't bother to program the memory management into the core of the engine.
Ray tracing adds an additional 0.5 to 2 GB to VRAM .... The original textures in the game were I believe only 1K and now they are nearly all 2k-4K so you will see an almost doubling in VRAM usage alone just from the upgraded textures then add up to 2 more GB for Ray Tracing At 1440p I'm using 5.2 - 5.8 GB in Novigrad but I'm not wasting time with Ray Tracing and won;'t until/unless they fix the GPU bottleneck problem. Instead I opted to crank up the other settings with a Mod so my settings are
Background characters - Ultra+
Shadow Quality - Ultra ++++
Terrain Quality - Ultra ++++
Water Quality - Ultra +++
Foliage Range - Ultra ++
Grass Density - Ultra ++
Texture Quality - Ultra ++++
Detail Level - Ultra ++++

I'm also using a custom.ini that tweaks the SSAO settings to give a more HBAO+ type effect and run all areas of the game at a locked 60 FPS @1440p but my GPU utilization is only 60-70% most of the time due to the frames limiter but also the CPU bottleneck. The game looks pretty damned good even without Ray Tracing. 62+ total hours and have yet to experience a single crash

 
Idk, it seems low textures kinda worked to stay at around 7 GB Memory usage when roaming Novigrad, but that seems way way too high considering we are coming from a game that would use about 3 GB at it's ultra settings.
Now we have raytracing and better textures, but should that alone more than double the requirement ??
I guess you are right in that they didn't bother to program the memory management into the core of the engine.
Sadly there is no memory menagment and because of this GPU VRAM / PCI-E Bus gets overload:
 
For me my cpu just gets back to 8 percent usage after about 20min of playing. Otherwise the frames are pretty acceptable for a RX 6900 XT and an Ryzen 7 3800X. But thank you for the guide!
 
For me my cpu just gets back to 8 percent usage after about 20min of playing. Otherwise the frames are pretty acceptable for a RX 6900 XT and an Ryzen 7 3800X. But thank you for the guide!
did ur GPU VRAM reached to maximum (16GB) after this 20 min of gamplay, what % of GPU Bus load did u observe, more then 30-40?? Please check in GPU-Z.
 
I update my thread with Memory leak FIX and other tips and tweaks. Check it out.
Post automatically merged:

another tips and tweaks added with newset RT optimalizations mods!
 
Last edited:
Top Bottom