microsoft / microsoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.
MIT License
6.37k stars 682 forks source link

High CPU Usage in WinUI App When Screen is Locked on Remote Desktop Due to DWMCOREI.dll #9703

Open ahmadkurdo opened 5 months ago

ahmadkurdo commented 5 months ago

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

  1. Connect to a remote desktop. Use the remote desktop app you can download it here.
  2. Install Xelion 8 using the following link: Xelion 8 Installer.
  3. Run the Xelion app.
  4. Log in to the Xelion app. For credentials, you may contact me.
  5. Open Task Manager.
  6. Lock the screen (e.g., press Windows + L).
  7. Unlock the screen.
  8. 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

Schermafbeelding 2024-06-05 165809 Schermafbeelding 2024-06-05 170817 Schermafbeelding 2024-06-05 171436 Schermafbeelding 2024-06-05 171456 Schermafbeelding 2024-06-05 171507 Schermafbeelding 2024-06-05 171617 Schermafbeelding 2024-06-05 172629 Schermafbeelding 2024-06-06 113530 Schermafbeelding 2024-06-06 123117

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

riverar commented 5 months ago

The linked thread indicates KB4522355 resolved the issue--are you still seeing the issue?

ahmadkurdo commented 5 months ago

The linked thread indicates KB4522355 resolved the issue--are you still seeing the issue?

Hi, i dont see KB4522355 anywhere. What do you mean by that?

kmgallahan commented 5 months ago

@ahmadkurdo

PROBLEM RESOLVED BY KB4522355 RELEASED OCTOBER 24TH 2019.

wbokkers commented 5 months ago

@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.

wbokkers commented 1 month ago

What is the status of this issue?

marticliment commented 1 month ago

Same here, a WinUI-based process randomly consumes high cpu, even when the window is closed or minimized.

This is what procexp shows: Image

marticliment commented 1 month ago

It looks PowerToys has had a similar issue: https://github.com/microsoft/PowerToys/pull/29665

marticliment commented 1 month ago

In fact, I have found this issue to happen on other WinUI3 apps, such as PowerToys. Image

Same thread, same start adress, high CPU usage after the program's window has loaded