Page 1 of 3

Random lag associated with DWM.exe in Windows 7

Posted: 21 Feb 2021, 22:50
by RyomaFV
Hello. I'm having a strange Issue that's been driving me crazy for months. I have a single display setup. An XG2402 connected via displayport to a gtx 1660ti card. Core i7 3770, 16 gb ram.

The problem is my windows starts lagging out of nowhere. I have reduced the problem and found it this lag is fixed if i disable Aero settings or restart Dwm. exe or Windows desktop manager service. My monitor is currently at 144 hz. I've tried different nvidia drivers, setting it at 120 hz, ran several antimalware programs. My pc is clean and I can't find a fix for it. In my research I found this problem seems to be common with multimonitor setups, but that isn't the case in here. I need some help.

Thanks guys.

Re: Random lag associated with DWM.exe in Windows 7

Posted: 22 Feb 2021, 21:14
by empleat
RyomaFV wrote:
21 Feb 2021, 22:50
Hello. I'm having a strange Issue that's been driving me crazy for months. I have a single display setup. An XG2402 connected via displayport to a gtx 1660ti card. Core i7 3770, 16 gb ram.

The problem is my windows starts lagging out of nowhere. I have reduced the problem and found it this lag is fixed if i disable Aero settings or restart Dwm. exe or Windows desktop manager service. My monitor is currently at 144 hz. I've tried different nvidia drivers, setting it at 120 hz, ran several antimalware programs. My pc is clean and I can't find a fix for it. In my research I found this problem seems to be common with multimonitor setups, but that isn't the case in here. I need some help.

Thanks guys.
Well since you are using Windows 7, you can safely disable DWM service, or kill process in task manager, forget how it was. Also disable HID service, if you don't need it and use classic theme, no ClearType and everything in Appearance on lowest. God Windows 7 was good on gaming!

Re: Random lag associated with DWM.exe in Windows 7

Posted: 23 Feb 2021, 17:27
by RyomaFV
I have tried to disable it. And yes, it is great on gaming, that's why I haven't changed yet. I just reenable it to fix the issue, since if I turn DWM off, I get a lot of screen tearing in certain windows. I guess it's because vsync is forced off. Wish I could find where the issue, since I'm hesitant about it being hardware associated, but not sure about it. :shock:

Sometimes it doesn't happen in hours or days. Others, it happens randomly and a lot of times. I think it's related to GPU usage, but can't pinpoint the issue yet.

Re: Random lag associated with DWM.exe in Windows 7

Posted: 23 Feb 2021, 17:51
by RyomaFV
I have tried that, but it introduces tearing in some windows or in windowed applications. What I usually do is restarting the service or Nvidia driver, and it fixes the issue for a while. However, I'm worried because I'm not sure if it is related to a Hardware failure. I'd love to pinpoint the cause and fix it, but so far most of the issues similar to mine are associated to multi display setups. I only have this monitor and iGPU is disabled on Bios.

What benefits can I get from disabling HID service? :) Not sure if I need it or not. I'm using Cleartype, otherwise fonts look awful on my screen. What's wierd is the problem happens randomly, sometimes goes away for hours, and sometimes it happens every 30 minutes. I have no idea what could be causing it. Is there any chance it will fix itself if I upgrade to win 10? I'm aware Freesync and Nvidia compatibility is not possible in Win 7 as well.

Thanks for your reply!

Re: Random lag associated with DWM.exe in Windows 7

Posted: 26 Feb 2021, 21:12
by empleat
RyomaFV wrote:
23 Feb 2021, 17:51
I have tried that, but it introduces tearing in some windows or in windowed applications. What I usually do is restarting the service or Nvidia driver, and it fixes the issue for a while. However, I'm worried because I'm not sure if it is related to a Hardware failure. I'd love to pinpoint the cause and fix it, but so far most of the issues similar to mine are associated to multi display setups. I only have this monitor and iGPU is disabled on Bios.

What benefits can I get from disabling HID service? :) Not sure if I need it or not. I'm using Cleartype, otherwise fonts look awful on my screen. What's wierd is the problem happens randomly, sometimes goes away for hours, and sometimes it happens every 30 minutes. I have no idea what could be causing it. Is there any chance it will fix itself if I upgrade to win 10? I'm aware Freesync and Nvidia compatibility is not possible in Win 7 as well.

Thanks for your reply!
Tearing can be many things!

What is your FPS? E.g. for me 60 fps even with G-SYNC is still definition of tearing itself!

DWM forces V-SYNC on in Windows 10 in (Hybrid Fullscreen mode) turned on by FSO. As FSO runs games in windowed borderless mode.

But I don't think DWM on forces V-SYNC in Windows 7, especially in Fullscreen mode (Fullscreen Exclusive)! I wasn't disabling DWM since forever and there were times: I tried V-SYNC on and instantly turned it off coz superlag... So that means: it was disabled before! V-SYNC will add delay of one frame, if 60fps (that's +16.67ms delay)!!! But if you want: you can try fastsync in Nvidia control panel, it should not be as bad, or variable refresh rate. Supposed it is supported in Windows 7!

BTW Free/G-SYNC doesn't work on Windows 7??? However if you can hit 120fps+, there should be less tearing. I used to play on 144hz and tearing wasn't a major problem for me, even G-SYNC helps a lot now!

You should always use Fullscreen option in-game for lowest input lag and smoothness (reduced tearing) - in Windows 7 this is called Fullscreen Exclusive mode and was always the best option! Since 460.09 there is MPO overlay, which should activate automatically in borderless windowed mode. No idea, if it works in Windows 7: https://nvidia.custhelp.com/app/answers ... er-version

If you think it is hardware. Use stress test overnight. But first check for overheating like in 15min stress test, to cancel if it overheats. Still leave it overnight only if confident in your cooling, test 1 hour first mb! Prime95 will heat your CPU using AVX and for GPU OCCT, but it is now limited for 1 hour max! For diagnostics use hwinfo, tick sensors only and click Logging Start after test, click on icon again to disable it. You can use Generic Log Viewer for HWINFO to view logs. In HWINFO program check for for thermal throttling for CPU and every other boxes which have yes, or no. Also check Performance Limit under GPU! Everything should be no pretty much!

For benchmarking you can download 3D Mark free version to check score of a system, if it is performing as it should and compare to people with the same HW!

For RAM/CPU I recommend Memtest, at least 8 runs overnight. May be limited to 4 in free version :/

Also check your disk usage in game. I suppose game is on ssd? Today games will stutter on hdd! Also you can check smart for disk health. Or run something like chkdsk c: /r, which will check for filesystem errors and bad sectors and try to repair them and then reports after login, or in Event Viewer. Data backup is recommended probably!

It is strange that it happens for you randomly and after restarting NVIDIA service, or DWM it helps. It could be something with GPU. Also consider undervolting: https://www.yourtechbro.com/complete-un ... u-and-gpu/
If you have 1 fan gpu and it overheats, thermal throttling will cause underclocking. It is safe, if you don't mess it up colossally and prolongs lifespan. As CPUs, RAMs, GPUs are overvolted from factory settings!

Also do you have any overclocks? If so, try to disable them and see if it helps.

Do you use any monitoring tools?

You can try clean driver uninstall, as even Nvidia installer don't remove all residues! Use DDU, Nvidia recommends it, it should be safe, but you never know! Check it with in PS with: get-filehash "filename.exe" -Algorithm sha256, or sha1. You will see checksum on website (wagnarsoft is official site) to compare it against! Or go to security tab and view certificate, it should say OK. Also 7-zip can check for errors and if there are any warn you! To make sure, it is not corrupted! You should do this when installing sensitive stuff, but Windows should warn you, if there is something wrong with certificate - i think, but not everything has them, so 7-zip is useful. Also you can write on Nvidia, they will help you with setting. It is important to do it right!

Also you can try cleanboot - in case it is Windows. First note checked services in following location, so you can re-enable them. Win+r write msconfig OK, click Services tab, click hide all microsoft services and uncheck everything, restart and try again.

Also I recommend sfc /verifyonly, it will check for corruption, but do nothing, however sfc /scannow will attempt to fix errors, warning you: it can revert some system setting!!!

These are advanced tools, also checks only for corruption, but does nothing:
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth

This will try to repair issues:
DISM /Online /Cleanup-Image /RestoreHealth

About DISM: https://www.windowscentral.com/how-use- ... s-10-image

Also in worst case you can try to repair windows install. It can be used to keep all files, but will mess up many settings. Also you should probably backup first!!!
https://answers.microsoft.com/en-us/win ... 0096ec3085

Also you can try restore points, or restore from backup, if you have any! It is best to backup often using something like Aomei!

Also check Event Viewer for any errors, or critical errors!

Do you use any other usb devices?

Check device manager for yellow signs.


Performance/tearing/input lag:


Did you also try cap fps at your lowest? Best done in-game engine, or Riva Tuner doesn't introduce much of input lag! Riva tuner can monitor min/max fps!

Also in NV control panel should be prefer maximum performance for your 3D apps (i use custom setting) and for low latency mode: use off, or on for low latency. Ultra should be used only if you GPU is constantly maxed at 99%, otherwise it won't be effective and will be worse probably than on!

Also go to Adjust Desktop and position in NV CP. Best settings are: no scalling, display - if your display supports scalling (check manual and OSD) and override the scalling mode...

Make sure in adjust resolution, Nvidia color setting is checked, default setting is limited color range!

Also recommend to download process lasso, which allows to disable dynamically IdleSaver and change power plan based on application running. Also exclude application from probalance by right clicking on it and click induce performance mode. Apps can be added in options/power/performance mode to induce performance mode aka change power plan. And exclusion from pro balance in options/cpu/pro balance setting/configure excluded processes.

Also you can choose default profile in power start process lasso with profile. Also there is setting some apps take priority over others and control current power profile. Also I recommend you to disable gui and run it on background and disable logging to reduce overhead.

Download parkcontrol also from bitsum to unpark cores, can be set per power plan also!

This should show ultimate performance plan, apply in elevated cmd: powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61

Is this even in Windows 7, otherwise use High performance power plan and disable USB selective suspend and turning disk after put 0 minutes! Wears down ssd.

Also put this to cmd: powercfg -attributes SUB_DISK 0b2d69d7-a2a1-449c-9680-f91c70521c60 -ATTRIB_HIDE
To show disk power saving, should be on active for no power savings!

Also I recommend you to find ssd tweaks and check trim is on and disable prefetch and superfetch. Also sysmain service.

Also check, if ssds are not being defragmented. In My computer click on disk and degrag and automatic defrag, there should be under ssd never ran!

Also page file should be on ssd and minimum should be your ram size / 8. And max 1-1.5 size of ram, which is not necessary, best is to leave it on system managed, it will cause some overhead, not terrible.

I recommend strongly to disable C states in BIOS, also eist if you have it and any motherboard specific power saving features!

Also you can try NVCleanInstall for trimming driver installation. To install only necessary driver packages, should be also safe, but I can't guarantee you 100% https://www.techpowerup.com/download/te ... leanstall/

Also in worst case you will reinstall OS, recommend you to check wim tweak. It will allow you to do minimal Windows 7 install, even better!

Disable HID service, will cause some USB devices not to work and disable media keys on keyboard, but reduced input lag a lot!

You can download ClearTypeSwitch to switch ClearType on/off fast!

PS: If none helps, I recommend to try Nvidia forums support!

Re: Random lag associated with DWM.exe in Windows 7

Posted: 03 Mar 2021, 19:45
by RyomaFV
That's the problem. Games are not affected by this. It only fucks up Windows Desktop. If I start swapping between applications Desktop wll get laggy until I drag a Window around. I can't pinpoint the cause yet. It's killing me. I have no idea if it is associated to nvidia drivers in some way. I doubt it's hardware since, if that were the case, how come it magically fix itself (for a few minutes or hours) and then comes back out of nowhere? Full screen apps are not affected by this. That's what puzzles me. It's similar to that lag you experience when you have two monitors and two different refresh rates, but only in desktop. And I have a single XG2402 monitor, 144hz, plugged to a Nvidia gtx 1660ti through display port. Freesync is not supported because Nvidia compatibility with Freesync only works in Win10. Would work if I had an ATI card.

Already tried reinstalling many drivers. My last option will be clean installing windows, but if that's the case I'll have to migrate to 10 :(

Re: Random lag associated with DWM.exe in Windows 7

Posted: 05 Mar 2021, 16:33
by empleat
RyomaFV wrote:
03 Mar 2021, 19:45
That's the problem. Games are not affected by this. It only fucks up Windows Desktop. If I start swapping between applications Desktop wll get laggy until I drag a Window around. I can't pinpoint the cause yet. It's killing me. I have no idea if it is associated to nvidia drivers in some way. I doubt it's hardware since, if that were the case, how come it magically fix itself (for a few minutes or hours) and then comes back out of nowhere? Full screen apps are not affected by this. That's what puzzles me. It's similar to that lag you experience when you have two monitors and two different refresh rates, but only in desktop. And I have a single XG2402 monitor, 144hz, plugged to a Nvidia gtx 1660ti through display port. Freesync is not supported because Nvidia compatibility with Freesync only works in Win10. Would work if I had an ATI card.

Already tried reinstalling many drivers. My last option will be clean installing windows, but if that's the case I'll have to migrate to 10 :(
Did you try cleanboot, ddu, sfc/dism? You can also do a repair install without losing any files! Only Windows settings.

No you don't have to migrate to 10... Don't you have install medium? There was way to download Windows 7 from MS.

If you have retail CD-key: https://www.microsoft.com/en-us/softwar ... d/windows7

There was way to download Windows 7 from MS (no idea if this still works): https://www.makeuseof.com/tag/download- ... microsoft/

Or mb try ebay, there are cheap keys for 5$

Re: Random lag associated with DWM.exe in Windows 7

Posted: 05 Mar 2021, 23:57
by PiCKiN
empleat wrote:
22 Feb 2021, 21:14
RyomaFV wrote:
21 Feb 2021, 22:50
Hello. I'm having a strange Issue that's been driving me crazy for months. I have a single display setup. An XG2402 connected via displayport to a gtx 1660ti card. Core i7 3770, 16 gb ram.

The problem is my windows starts lagging out of nowhere. I have reduced the problem and found it this lag is fixed if i disable Aero settings or restart Dwm. exe or Windows desktop manager service. My monitor is currently at 144 hz. I've tried different nvidia drivers, setting it at 120 hz, ran several antimalware programs. My pc is clean and I can't find a fix for it. In my research I found this problem seems to be common with multimonitor setups, but that isn't the case in here. I need some help.

Thanks guys.
Well since you are using Windows 7, you can safely disable DWM service, or kill process in task manager, forget how it was. Also disable HID service, if you don't need it and use classic theme, no ClearType and everything in Appearance on lowest. God Windows 7 was good on gaming!
I've been wanting to try Windows 7 just for gaming but I heard you cant play DX12 games for example like CoD Warzone. Is this true?

Re: Random lag associated with DWM.exe in Windows 7

Posted: 06 Mar 2021, 18:47
by empleat
PiCKiN wrote:
05 Mar 2021, 23:57
empleat wrote:
22 Feb 2021, 21:14
RyomaFV wrote:
21 Feb 2021, 22:50
Hello. I'm having a strange Issue that's been driving me crazy for months. I have a single display setup. An XG2402 connected via displayport to a gtx 1660ti card. Core i7 3770, 16 gb ram.

The problem is my windows starts lagging out of nowhere. I have reduced the problem and found it this lag is fixed if i disable Aero settings or restart Dwm. exe or Windows desktop manager service. My monitor is currently at 144 hz. I've tried different nvidia drivers, setting it at 120 hz, ran several antimalware programs. My pc is clean and I can't find a fix for it. In my research I found this problem seems to be common with multimonitor setups, but that isn't the case in here. I need some help.

Thanks guys.
Well since you are using Windows 7, you can safely disable DWM service, or kill process in task manager, forget how it was. Also disable HID service, if you don't need it and use classic theme, no ClearType and everything in Appearance on lowest. God Windows 7 was good on gaming!
I've been wanting to try Windows 7 just for gaming but I heard you cant play DX12 games for example like CoD Warzone. Is this true?
Yep Windows 7 has support only for DX11. It should support Vulkan however. You can also try a Linux, it has Vulkan support I think. But no idea about Warzone. Also Linux isn't as optimized and I imagine, it requires hardcore tweaking. Last time I tried: I couldn't install even drivers from guide for my exact version, even Nvidia support wasn't able to solve my issues. Or +300 upvoted solution from superuser doesn't work for simple problem. And it changes each version. If you want to spend 3 hours to solve every small problem :D

Re: Random lag associated with DWM.exe in Windows 7

Posted: 06 Mar 2021, 21:48
by deama
I wrote a guide on how to use RTSS' scanline sync, it allows you to have the DWM disabled whilst having no stuttering/tearing issues if you set it up right.
Try it out:
deama wrote:
14 Jul 2020, 08:39
Don't put nvidia ultra low latency to ultra, leave it on On; only pick ultra if you want a bit less input lag if you push GPU past 95%.

Disable gsync/freesync or whatever else fancy stuff you got, you don't need it; from my experience it's a scam.
I went to a friend's house at one point to check out his gsync thing, but even though it was at 100hz, it felt like it was running at 60hz, in addition to the +20ms input lag that he got (I measured it) from it. After I disabled it and configured his system, not only did it finally feel smooth for him, he doesn't really get any tear lines either; he even decided to overclock it to 120hz just to get it smoother.

Disable all vsync, from nvidia control panel and in games.

Not sure if you have this, but download RTSS (latest version), since 2019 they added scanline sync, we will use this to fix your issue, hopefully.

Alright so open up RTSS and delete any profiles you may have for the games you'll be testing, keep global. highlight "Global" profile and then click "Setup" at the bottom. Under the "FCAT properties" tick the "enable frame color indicator" and to the right pick the 2 bars option from the drop down; click ok. If you have any values under "frame limit" or "scanline sync", put them to 0.
Now basically what should happen is two long white bars on the left side of your screen should appear when you start a game, if they don't make sure other profiles aren't interfering, and make sure you also got Show On-screen statistics enabled, as well as on-Screen display support.

Now open up a game, make sure the game is easy for you to run at 240fps (if you have a 240hz monitor), and make sure you don't do these tests in the main menu, make sure you're inside of the game itself.
Your framerate should be uncapped at this point, and the white bars to the left should be flickering a bunch between transparent white bar, and a solid white bar, or just flickering between no bar and a solid white bar. When this happens that means the frames aren't in sync, basically it's a microstutter. If the two bars are visible, but they're transparent white, then you don't have any stutters or tearing; this is what you want.
Essentially the idea is that you play with the scanline sync value until you can get 2 transparent white bars on the left at all times (or as often as you can). For me, at 120hz, with a ryzen 3600, 2060 super, and a 1080p monitor, -300 was the sweet spot for me if I had the dwm enabled. If I have the dwm disabled then you'd have to tune it on a per game basis, but I found most games worked fine for me at 870.

Here are examples to help you:
what you want:
https://i.imgur.com/g4SAoQW.jpg
See how there's two white bars but they're transparent? You can see a silhouette of some button and the rest of the map in the background, you want to keep it like this at all times, or at least most of the time.

what you don't want:
https://i.imgur.com/2XZ7g4l.jpg
This is what you don't want, it basically gives you obvious flickering and just doesn't look in-sync so to speak. One bar may look transparent whereas the other bar will look solid, e.g. in bottom of the picture, the right one looks transparent, whereas the left one looks solid, you want them both to be transparent all the time, and throughout the entire screen not just the lower half.

Keep in mind that these bars will actually behave differently at different fps and hz. I'm not entirely sure how they'll look like at 240hz, but should be something similar. Basically, if you don't notice the flickering, that's what you want to keep it at, if it flickers, then that's bad and you want to avoid that.

If you've gone through all the values and you still can't get it transparent stable, then there's something interfering with your general system, e.g. you have a big resource hog in the background, or lots of small resource hogs, or even something itself is wrong with windows, e.g. timer resolution problems etc...
It could also mean that your version of windows may be broken, or has been configured really badly (maybe an update broke something?) In which case we'll have to go through an elimination process, hopefully it won't come to this...
And finally, if you still can't get it stable, then your hardware isn't up to snuff, for that particular game at least.

BONUS:
This is what a tearline looks like, you won't have to worry about this though, unless you disable the dwm or run games in fullscreen exclusive:
https://i.imgur.com/h6aV0MG.jpg
Basically you have a type of "tear" that flickers in a specific spot (the spot can change, and the size can change too, could be half the screen), and it looks like the bad flickering I was talking about above, but at a specific spot on the bars.