Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High memory consumption or memory leak on Intel integrated graphics #7704

Open
EdiWang opened this issue Apr 11, 2023 · 17 comments
Open

High memory consumption or memory leak on Intel integrated graphics #7704

EdiWang opened this issue Apr 11, 2023 · 17 comments
Labels
Investigate Requires further investigation by the WPF team. Performance Performance related issue
Milestone

Comments

@EdiWang
Copy link

EdiWang commented Apr 11, 2023

Description

WPF application running on some Intel integrated graphics card is taking a lot more memory than it should. Even a pure empty WPF app takes 165.2 MB on startup.

3aedc63e2047a93783dd15d5ac35848

On other machine without Intel graphics, or disabling intel graphics card, or use software rendering, the memory consumption is normal.

1ea5fdd519f495d74ada897df20fedb

There are two threads on Intel community site describing the same issue. But I am not sure if this is a WPF issue or Intel issue.

https://community.intel.com/t5/Graphics/Net-WPF-Application-high-memory-consumption/td-p/1434020
https://community.intel.com/t5/Graphics/UHD710-High-memory-usage-and-memory-leak-issues-with-WPF/m-p/1471504

Reproduction Steps

  • Prepare a computer with i9-13900H CPU with Iris XE graphics (Other intel graphic may also have the issue)
    • Install latest RTM driver 31.0.101.4255
    • (Or) install latest beta driver 31.0.101.4257
    • (Or) install old driver 31.0.101.4032 / 31.0.101.4091
  • Create an empty WPF application with VS2022, .NET 6.0 or 7.0
  • Publish the application using Release build
  • Run the application
  • Observe memory usage in task manager

Expected behavior

Memory usage is around 10-30 MB

Actual behavior

Memory usage is around 150 MB

Regression?

No response

Known Workarounds

Set the WPF app to use software rendering.

public partial class App : Application
{
    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);

        RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
    }
}

Impact

Users with some type of Intel graphics will have much more memory usage and potentially slow down their system.

Configuration

  • .NET 6.0 / 7.0
  • Windows 11 Pro 22621.1485 x64

Other information

This issue does not happen to

  • i7-1185G7 with Intel Iris Xe Graphics (e.g. Surface Pro 8)
  • i7-1065G7 with Intel lris Plus Graphics (e.g. Surface Laptop 3, Driver version 27.20.100.9621)
  • i7-10700T with Intel UHD 630 Graphics (Driver version 31.0.101.2114)
  • i7-8665U with Intel UHD 620 Graphics (Driver version 30.0.101.1404)

Attaching the WPF app used for testing this

WpfApp1.zip

Memory consumption also has something to do with monitors:

  • Using laptop screen only or just one external monitor: ~95MB (which is still considered to be abnormal)
  • Using two external monitors: ~160MB
  • Using laptop screen + two external monitors: ~245MB

It doesn't matter which screen the App is on, the more screens, the more memory usage.

No response

@Anduin2017
Copy link
Member

Looks good on my machine....

1b684de70856fac3e6e36d05342480c

adbff5c72f64d9bb4f311c76babb400

@EdiWang
Copy link
Author

EdiWang commented Apr 11, 2023

@Anduin2017 You are using NVIDIA GPU, so you don't have this issue. It only happens to a few Intel CPU with integrated GPU.

@singhashish-wpf singhashish-wpf added the Investigate Requires further investigation by the WPF team. label Apr 12, 2023
@singhashish-wpf singhashish-wpf added this to the Future milestone Apr 12, 2023
@Credhat
Copy link

Credhat commented Apr 20, 2023

I am also confused about this issue.
It is difficult to understand why a simple Net6.0 WPF application would result in such high memory consumption.

Here is some additional information. I hope this issue can be resolved.
WPF
Task Manager

Dxdiag Info

@singhashish-wpf singhashish-wpf added the Performance Performance related issue label Apr 24, 2023
@phreishauer
Copy link

We have the same issue on a few recent Dell Laptops with 12th Gen Intel CPUs. In our case (32bit application) it leads to OutOfMemory and other exceptions in strange places.

@qkevin
Copy link

qkevin commented Jul 18, 2023

i can confirm this issue happens with my 12th Gen Intel CPU 12500 with integrated GPU 770, i created an empty wpf app, can confirm it consumes 100mb more memory in task manager.
Snipaste_2023-07-18_14-01-56

@allopatin
Copy link

We are also encountering this issue. It's not only limited to what you described. In our case a static Image source is breaking the application completely in addition to exploding memory usage. The error we sometimes are able to catch is System.Runtime.InteropServices.COMException: 'UCEERR_RENDERTHREADFAILURE (Exception from HRESULT: 0x88980406)' which could suggest a driver issue.
On a machine with 31.0.101.3251 Intel driver the implementation does not show this behaviour and works without issues.

@eduardoghi
Copy link

eduardoghi commented Sep 28, 2023

The problem is happening to me too

image

image

image

image

@Xulunix
Copy link

Xulunix commented Sep 29, 2023

We have escalated this issue through our hardware distributor to Intel and Microsoft.
Sadly, it looks like none of them are ready do acknowledge the issue and instead try to blame the other party for it and hope to wait it out.

As it is only a problem on Intel GPUs with the Intel drivers enabled, i would suggest to contact Intel support if you are affected.
Responding to the existing forum threads does not work as threads get ignored after a few weeks. Use a new thread or other channels and reference this issue.
Maybe things start to move if enough report it.

@pchaurasia14
Copy link
Contributor

We are currently following with the DirectX team internally for this bug.
It looks like there is an issue with D3D9On12 abstraction which is causing the spike in memory usage.

We will update you as soon as we know more.

@DanielF95
Copy link

DanielF95 commented Oct 18, 2023

The problems are so obviously! - (and after 2 hours of research you can see that the problem comes at the time when microsoft changes the concept to the new wrapper D3D9On12).
I can't understand why microsoft or/and intel ignores this bug. Many user have this problem since over one year !

@shennig
Copy link

shennig commented Oct 19, 2023

We are currently following with the DirectX team internally for this bug. It looks like there is an issue with D3D9On12 abstraction which is causing the spike in memory usage.

We will update you as soon as we know more.

Do you have news from this issue? We are currently struggeling with this problem and it is very urgent, that we get a solution! We will appreciate every kind of help.

@PsychoDad9999
Copy link

Memory consumption of a Fullscreen WPF application on a 4K UHD Display + Intel GPU is insane. Using Software rendering fixes the issues, but we would prefer a better solution.

Our telemetrics currently shows a lot of OutOfMemory and RenderThreadFailure Exceptions and the majority of our target devices are using these gpus. Hope this will be fixed soon.

@Onnotjee
Copy link

Onnotjee commented Nov 2, 2023

Same issue here.

Hardware:

  • Intel Core i7-12800H
  • Intel Iris Xe Graphics G7 96EUs

Software:

  • Windows 10 Pro 22H2
  • VS2022 .net6 or .net7 WPF application
  • Driver Intel UHD Graphics 31.0.101.4255

The workaround solution mentioned to use software rendering works indeed, but is not preferred.

@sm99sensors
Copy link

We have the same problem
Out of memory issues with our WPF based software.
At both x32 and x64 builds, .NET 4.8.

Device specs:
image

image

Test WpfApp consumes abnormal 345 MB
image

@CrazyWinner
Copy link

Same thing on UHD630. It's a driver issue. Anything that uses GPU will leak memory no matter what(Tried with Qt and glfw). We have been having problems with Intel igpu's since 2021 and seems like Intel just doesn't care. What a trash company

@Tracy-P
Copy link

Tracy-P commented Dec 2, 2023

I see the same happening on a Dell All-in-One with the Intel Iris Xe Graphics hardware.

Operating System: Microsoft Windows 11 Home 10.0.22621
IGCC Version: 1.100.5237.0
Language: en-US
Physical Memory: 63.7 GB 
Current Resolution: 1920x1080

Processor: 12th Gen Intel(R) Core(TM) i7-1255U
Processor Speed: 1700 MHz
GFX Driver Name: Intel® Iris® Xe Graphics
Shader Version: 5.1
OpenCL* Version: 3.0
* Microsoft DirectX* *
Runtime Version: 12
Hardware-Supported Version: 12
Vendor ID: 8086
Device ID: 46A8
Device Revision: 0C
GFX Driver Version: 31.0.101.4502
Dedicated RAM: 128 MB
Shared RAM: 32 GB
Max Supported Displays: 4
GFX Vulcan: 1.3.250
GFX GOP: 21.0.1046

The project is a new WPF .NET 6 with no modifications.
image

and with

RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;

image

@lindexi
Copy link
Contributor

lindexi commented Dec 15, 2023

Reference microsoft/D3D9On12#72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team. Performance Performance related issue
Projects
None yet
Development

No branches or pull requests