Windows 10 DWM Priority
Posted: 01 Oct 2018, 09:25
Searched through forums, couldn't find anything specific about that.
I dual-boot Win 10 and Linux and sometimes like to test and see how the same games perform in different OSes. Apparently, some of the games in Linux, have produced a better image clarity. Done some additional tests, and strangely enough, I did eventually get improved results in Windows 10 (much clearer and responsive image). Tested on various openGL and D3D, old and new games, as well as with Oculus Rift (had a very noticeable improvement, maybe due to the lower persistence). All it took was changing dwm.exe (Windows Display Manager) priories to the lowest possible values (EDIT: some NV Profile Inspector settings are also needed).
I think that different display managers behaving differently (unfortunately, in Win 10, we can't completely disable DWM, however, we can set it to the lowest priorities, which (just a guess) might somehow restrict it from interfering with the pipeline). I don't know if it is just my config/system or something that would benefit some other people, but would like to find out.
Nevertheless, could anyone with a G-Sync monitor or Rift, do me a favor and test something out please? Could you change Windows 10 DWM priorities and tell if you notice any difference in image quality (clarity, input lag, blur)?
You can just go to the Task Manager > Details > dwm.exe >right click > set to Low (works straight away, no need to reboot or anything, you can even alt-tab from a game). However, I have noticed that the better way, is to do it through the Process Hacker x64 utility (seems I can get more consistent results).
In the Process Hacker utility find the dwm.exe, then right click and set: Priority to Idle; I/O priority to Very Low; Miscellaneous > Page Priority to Very Low (page file priority, but for good measure). Don't worry, they do reset to defaults after system reboot.
Just in case, some of my system specs:
Windows 10 Pro x64 (1803)
MSI GTX 970 (@1518/4000) (411.70)
i5 6600k (@4.8) + 16GB DDR4
Acer Predator XB241H (@144Hz, OD- Extreme; Capped@140 fps through RTSS)
RTSS (7.1.0.15378)
NVCP (V-Sync - Force ON; Triple buffering OFF; G-Sync - ON; Resolution/Color/Scaling settings - NV default)
NV Profile Inspector (Maximum pre-rendered frames - 1; Maximum frames allowed - 0x00000001; Frame Rate Limiter Mode - V2 Force Off; Frame Rate Limiter - 0x00200000 PS_FRAMERATE_LIMITER_DISALLOWED; MAX_PENDING_CMD_BUFFERS - 0x00000000 Off; Enable Ansel - 0x00000000 ANSEL_ENABLE_OFF)
Update
I have double-checked some variables and done some additional tests.
In order to get the effect you need 2 things. 1) Set the DWM priorities to the lowest states as described above. 2) Use NV Profile Inspector and set: Frame Rate Limiter Mode - Limiter V2 Force Off; Frame Rate Limiter - 0x00200000 PS_FRAMERATE_LIMITER_DISALLOWED. Without one or another, I have struggled to recreate the effect.
Also, maximum pre-rendered frames should be at one, obviously. Don't worry about Command Buffer as it should be off by default.
Update 2
Have done some further testings. Recreated the effect with only one DWM priority. Through the Process Hacker, the Priority was set to Idle. Changing the states of any other priorities was not needed. Although, when testing in-game, and constantly alt-tabbing from full screen and back, it would seem that, sometimes, the dwm.exe had to be restarted in order to get the effect (no need to leave the game, just service restart and then alt-tab back to the game).
Nevertheless, the settings in the NV Profile Inspector had to be kept as described above, as setting any of the two to their defaults, would remove the effect (have not tried any other combinations).
In addition, it seems that the effect is not dependent on the G-Sync mode, as I was able to see similar behavior while in ULMB or Fixed Refresh modes (after all, Rift was getting the same effect as well). Some further tests needed.
Update 3
After some thorough testing, the UFO tests did not show any improvements (the first impression was deceiving). Same goes for applications (e.g. Windows Apps, browsers). However, media players (MPV with the D3D11 render, MPC-HC) did, be it not that noticeable as in games. In comparison with openGL or D3D, Software Rendering modes in several old games (Quake 1, Quake 2, Unreal...), did not provide any improvements. Triple buffering ON, or V-sync ON without capped frames, making the effect more subtle (expected, since they usually introduce more lag/motion blur). Reloading graphic driver in Windows (e.g through CRU), removes the effect, although, after reloading dwm.exe, it comes back.
So far, the effect appears in openGL, D3D and Vulkan applications only (+ MPC-HC EVR). The effect itself is seem to be nothing more, but a slight reduction in motions blur (more noticeable in fast-paced games, especially when no post-processing filters applied). The reduction in motion blur is very similar to the difference between Overdrive OFF and Overdrive Extreme settings on my monitor (OD OFF + tweaks = OD Extreme + No tweaks), but without all the drawbacks of OD.
Would appreciate any feedback. Thank you.
Update 4 - Final
Everything is good now. In fact, never had such a fluid, crisp and responsive image on my G-Sync monitor. Without thorough explanations, the problem was due to the Windows 10 approach to the interrupt requests and priorities scheduling, or more precisely - ISRs (IRQ mode would glitch the ISRs of DirectX Graphic Kernel by constantly executing it). This is why fiddling with DWM priorities or NV Profile Inspector settings would result in improvements. After switching 970 GTX to the MSI mode (thanks to mbk1969 of guru3d) (https://forums.guru3d.com/threads/windo ... ts.378044/) the "effect" I was talking about (in fact, normal operation) is now persistent. By switching to the MSI mode, disabling HPET and providing some additional tweaks to decrease DPC latency, I was able to make Windows 10 even more responsive than my Arch Linux with Zen kernel (Average measured interrupt to process latency - 1.5µs; Average measured interrupt to DPC latency - 0.5µs, @ Timer Resolution - 0.997ms, even less with 0.5ms). Image fluidity and clarity are immense, so is the input lag.
I dual-boot Win 10 and Linux and sometimes like to test and see how the same games perform in different OSes. Apparently, some of the games in Linux, have produced a better image clarity. Done some additional tests, and strangely enough, I did eventually get improved results in Windows 10 (much clearer and responsive image). Tested on various openGL and D3D, old and new games, as well as with Oculus Rift (had a very noticeable improvement, maybe due to the lower persistence). All it took was changing dwm.exe (Windows Display Manager) priories to the lowest possible values (EDIT: some NV Profile Inspector settings are also needed).
I think that different display managers behaving differently (unfortunately, in Win 10, we can't completely disable DWM, however, we can set it to the lowest priorities, which (just a guess) might somehow restrict it from interfering with the pipeline). I don't know if it is just my config/system or something that would benefit some other people, but would like to find out.
Nevertheless, could anyone with a G-Sync monitor or Rift, do me a favor and test something out please? Could you change Windows 10 DWM priorities and tell if you notice any difference in image quality (clarity, input lag, blur)?
You can just go to the Task Manager > Details > dwm.exe >right click > set to Low (works straight away, no need to reboot or anything, you can even alt-tab from a game). However, I have noticed that the better way, is to do it through the Process Hacker x64 utility (seems I can get more consistent results).
In the Process Hacker utility find the dwm.exe, then right click and set: Priority to Idle; I/O priority to Very Low; Miscellaneous > Page Priority to Very Low (page file priority, but for good measure). Don't worry, they do reset to defaults after system reboot.
Just in case, some of my system specs:
Windows 10 Pro x64 (1803)
MSI GTX 970 (@1518/4000) (411.70)
i5 6600k (@4.8) + 16GB DDR4
Acer Predator XB241H (@144Hz, OD- Extreme; Capped@140 fps through RTSS)
RTSS (7.1.0.15378)
NVCP (V-Sync - Force ON; Triple buffering OFF; G-Sync - ON; Resolution/Color/Scaling settings - NV default)
NV Profile Inspector (Maximum pre-rendered frames - 1; Maximum frames allowed - 0x00000001; Frame Rate Limiter Mode - V2 Force Off; Frame Rate Limiter - 0x00200000 PS_FRAMERATE_LIMITER_DISALLOWED; MAX_PENDING_CMD_BUFFERS - 0x00000000 Off; Enable Ansel - 0x00000000 ANSEL_ENABLE_OFF)
Update
I have double-checked some variables and done some additional tests.
In order to get the effect you need 2 things. 1) Set the DWM priorities to the lowest states as described above. 2) Use NV Profile Inspector and set: Frame Rate Limiter Mode - Limiter V2 Force Off; Frame Rate Limiter - 0x00200000 PS_FRAMERATE_LIMITER_DISALLOWED. Without one or another, I have struggled to recreate the effect.
Also, maximum pre-rendered frames should be at one, obviously. Don't worry about Command Buffer as it should be off by default.
Update 2
Have done some further testings. Recreated the effect with only one DWM priority. Through the Process Hacker, the Priority was set to Idle. Changing the states of any other priorities was not needed. Although, when testing in-game, and constantly alt-tabbing from full screen and back, it would seem that, sometimes, the dwm.exe had to be restarted in order to get the effect (no need to leave the game, just service restart and then alt-tab back to the game).
Nevertheless, the settings in the NV Profile Inspector had to be kept as described above, as setting any of the two to their defaults, would remove the effect (have not tried any other combinations).
In addition, it seems that the effect is not dependent on the G-Sync mode, as I was able to see similar behavior while in ULMB or Fixed Refresh modes (after all, Rift was getting the same effect as well). Some further tests needed.
Update 3
After some thorough testing, the UFO tests did not show any improvements (the first impression was deceiving). Same goes for applications (e.g. Windows Apps, browsers). However, media players (MPV with the D3D11 render, MPC-HC) did, be it not that noticeable as in games. In comparison with openGL or D3D, Software Rendering modes in several old games (Quake 1, Quake 2, Unreal...), did not provide any improvements. Triple buffering ON, or V-sync ON without capped frames, making the effect more subtle (expected, since they usually introduce more lag/motion blur). Reloading graphic driver in Windows (e.g through CRU), removes the effect, although, after reloading dwm.exe, it comes back.
So far, the effect appears in openGL, D3D and Vulkan applications only (+ MPC-HC EVR). The effect itself is seem to be nothing more, but a slight reduction in motions blur (more noticeable in fast-paced games, especially when no post-processing filters applied). The reduction in motion blur is very similar to the difference between Overdrive OFF and Overdrive Extreme settings on my monitor (OD OFF + tweaks = OD Extreme + No tweaks), but without all the drawbacks of OD.
Would appreciate any feedback. Thank you.
Update 4 - Final
Everything is good now. In fact, never had such a fluid, crisp and responsive image on my G-Sync monitor. Without thorough explanations, the problem was due to the Windows 10 approach to the interrupt requests and priorities scheduling, or more precisely - ISRs (IRQ mode would glitch the ISRs of DirectX Graphic Kernel by constantly executing it). This is why fiddling with DWM priorities or NV Profile Inspector settings would result in improvements. After switching 970 GTX to the MSI mode (thanks to mbk1969 of guru3d) (https://forums.guru3d.com/threads/windo ... ts.378044/) the "effect" I was talking about (in fact, normal operation) is now persistent. By switching to the MSI mode, disabling HPET and providing some additional tweaks to decrease DPC latency, I was able to make Windows 10 even more responsive than my Arch Linux with Zen kernel (Average measured interrupt to process latency - 1.5µs; Average measured interrupt to DPC latency - 0.5µs, @ Timer Resolution - 0.997ms, even less with 0.5ms). Image fluidity and clarity are immense, so is the input lag.