High CPU Usage in WinUI App When Screen is Locked on Remote Desktop Due to DWMCOREI.dll
Describe the bug
Environment: Operating System: See screenshots Driver version: See additional context
Description: When running Xelion, a WinUI application on a remote desktop, there is a significant increase in CPU usage when the screen is locked. After thorough investigation, the high CPU usage was traced back to the DWMCOREI.dll, which is used by the WinUI application. We have found a quick workaround to fix this. For more info about the workaround visit the following link
Steps to reproduce the bug
- Connect to a remote desktop. Use the remote desktop app you can download it here.
- Install Xelion 8 using the following link: Xelion 8 Installer.
- Run the Xelion app.
- Log in to the Xelion app. For credentials, you may contact me.
- Open Task Manager.
- Lock the screen (e.g., press Windows + L).
- Unlock the screen.
- Observe in Task Manager that the Xelion app initially uses a high amount of CPU power for a short period before decreasing. However, when the screen is locked, the app continues to consume a high amount of CPU power.
Expected behavior
The CPU usage of the WinUI app should remain consistent and not significantly increase when the screen is locked on a remote desktop.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.5.3: 1.5.240428000
Windows version
Windows 10 Enterprise for Virtual Desktops
Additional context
DeviceName DriverVersion
Audio Endpoint 10.0.19041.1 Generic Non-PnP Monitor 10.0.19041.4355 Microsoft Remote Display Adapter 10.0.19041.4355 Audio Endpoint 10.0.19041.1 Audio Endpoint 10.0.19041.1 Generic software device 10.0.19041.1 Generic software device 10.0.19041.1 Generic Non-PnP Monitor 10.0.19041.4355 Generic Non-PnP Monitor 10.0.19041.4355 Generic Non-PnP Monitor 10.0.19041.4355 Microsoft Remote Display Adapter 10.0.19041.4355 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Network Printer Connection 10.0.19041.1 Local Print Queue 10.0.19041.1 Network Printer Connection 10.0.19041.1 Local Print Queue 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Microsoft enhanced Point and Print driver 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Microsoft enhanced Point and Print driver 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Microsoft enhanced Point and Print driver 10.0.19041.1 Microsoft enhanced Point and Print driver 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Microsoft enhanced Point and Print driver 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Local Print Queue 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Network Printer Connection 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 Local Print Queue 10.0.19041.1 WAN Miniport (Network Monitor) 10.0.19041.1 WAN Miniport (IPv6) 10.0.19041.1 WAN Miniport (IP) 10.0.19041.1
WAN Miniport (PPPOE) 10.0.19041.1 WAN Miniport (PPTP) 10.0.19041.1 WAN Miniport (L2TP) 10.0.19041.1 WAN Miniport (IKEv2) 10.0.19041.1 WAN Miniport (SSTP) 10.0.19041.1 Generic software device 10.0.19041.1 Generic software device 10.0.19041.1 Generic software device 10.0.19041.1 Remote Desktop Device Redirector Bus 10.0.19041.1 Plug and Play Software Device Enumerator 10.0.19041.1 Microsoft System Management BIOS Driver 10.0.19041.1 NDIS Virtual Network Adapter Enumerator 10.0.19041.1 Microsoft Basic Render Driver 10.0.19041.3636 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 AMD Processor 10.0.19041.4355 System CMOS/real time clock 10.0.19041.3636 Microsoft Hyper-V Generation Counter 10.0.19041.1 Communications Port 10.0.19041.1 Mellanox ConnectX-4 Lx Virtual Etherne... 2.70.24728.0 Microsoft Hyper-V Virtual PCI Bus 10.0.19041.4355 Microsoft Hyper-V Network Adapter 10.0.19041.4355 Generic PnP Monitor 10.0.19041.4355 Microsoft Hyper-V Video 10.0.19041.3636 Microsoft Hyper-V Virtual Keyboard 10.0.19041.1 HID-compliant mouse 10.0.19041.1 Microsoft Hyper-V Input 10.0.19041.1 Microsoft Hyper-V Dynamic Memory 10.0.19041.1
Microsoft Hyper-V SCSI Controller 10.0.19041.3636 Disk drive 10.0.19041.4355 Microsoft Hyper-V SCSI Controller 10.0.19041.3636 Microsoft Hyper-V Time Synchronization 10.0.19041.1 Microsoft Hyper-V Guest Shutdown 10.0.19041.1 Microsoft Hyper-V Data Exchange 10.0.19041.1 Microsoft Hyper-V Heartbeat 10.0.19041.1
Microsoft Hyper-V Virtual Machine Bus 10.0.19041.4355 Advanced programmable interrupt contro... 10.0.19041.3636 ACPI Module Device 10.0.19041.3636 Microsoft ACPI-Compliant System 10.0.19041.4355 ACPI x64-based PC 10.0.19041.1 Remote Desktop Mouse Device 10.0.19041.1 Remote Desktop Keyboard Device 10.0.19041.1 UMBus Enumerator 10.0.19041.1 Remote Desktop Camera 10.0.19041.3636 UMBus Enumerator 10.0.19041.1 Remote Desktop USB Hub 10.0.19041.4355 UMBus Enumerator 10.0.19041.1 UMBus Enumerator 10.0.19041.1 Remote Desktop Mouse Device 10.0.19041.1 Remote Desktop Keyboard Device 10.0.19041.1 UMBus Enumerator 10.0.19041.1 UMBus Root Bus Enumerator 10.0.19041.1 Microsoft Kernel Debug Network Adapter 10.0.19041.1 Microsoft Storage Spaces Controller 10.0.19041.4355 Disk drive 10.0.19041.4355 Microsoft VHD Loopback Controller 10.0.19041.3930 Microsoft Virtual Drive Enumerator 10.0.19041.1 Composite Bus Enumerator 10.0.19041.1 Microsoft Hyper-V Virtualization Infra... 10.0.19041.4355 Microsoft Basic Display Driver 10.0.19041.3636 Volume 10.0.19041.1 Generic volume shadow copy 10.0.19041.1 Generic volume shadow copy 10.0.19041.1 Volume 10.0.19041.1 Volume 10.0.19041.1 Volume 10.0.19041.1 Volume 10.0.19041.1 Volume Manager 10.0.19041.3636
The linked thread indicates KB4522355 resolved the issue--are you still seeing the issue?
The linked thread indicates
KB4522355resolved the issue--are you still seeing the issue?
Hi, i dont see KB4522355 anywhere. What do you mean by that?
@ahmadkurdo
*** PROBLEM RESOLVED BY KB4522355 RELEASED OCTOBER 24TH 2019. ***
@riverar I think KB4522355 will not solve this issue. It happens in a later Windows version that was fully patched. Apart from that, the issue is somewhat different, although both related to DWM.
What is the status of this issue?
Same here, a WinUI-based process randomly consumes high cpu, even when the window is closed or minimized.
This is what procexp shows:
It looks PowerToys has had a similar issue: https://github.com/microsoft/PowerToys/pull/29665
In fact, I have found this issue to happen on other WinUI3 apps, such as PowerToys.
Same thread, same start adress, high CPU usage after the program's window has loaded
@Saharsh979 This issue was closed without any explanation. Could you please provide some context on why? When closing issues, a brief comment explaining the reasoning is standard practice across open source projects. Without the context, we're left guessing whether this was resolved, deprioritized, or closed in error. Thanks!
And why closing as not planned? Are unreasonable cpu usages when idle not going to be fixed?
Hi @riverar @marticliment The closure was automated when the linked internal ADO bug got marked resolved.
To add context: the investigation concluded that this behavior is due to a limitation in the current lifted compositor implementation it doesn’t have awareness of the screen on/off state. Because of that limitation, there isn’t anything WinUI can directly do in this scenario today. I’m following up internally to get more clarity and will update this issue so everyone tracking it has the right context. We can reopen this if additional info comes up or if this becomes a scenario the compositor starts supporting.
Sorry for the confusion caused by the auto-close!
@Saharsh979 This is unacceptable. We have many clients using our app on RDS complaining for over a year about this issue. Why isn't this issue escalated to the right level in your organization instead? I understand that another department is needed to fix this issue, but are the boundaries between MS departments this impenetrable?
Hello there @wbokkers! Sorry about the miscommunication on our part. With OSS of the repo in progress, we are trying to consolidate practices amongst several teams. I am currently the PM for composition. We are aware of this issue and trying to prioritize for timeline currently. Stay tuned.
@beth-panx Thanks for the clarification and the update. Much appreciated!