Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20833 Discussions

Intel HD Graphics 4600 driver possible memory leak

Pavel_K_1
Beginner
3,770 Views

Hello!

I have encountered with Intel HD Graphics 4600 driver problem. My application uses Direct3D11 API. 

After successful device creation and futher resource allocations, Direct3D debug runtime outputs:

D3D11: Removing Device.

D3D11 WARNING: ID3D11Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DRIVER_INTERNAL_ERROR: There is strong evidence that the driver has performed an undefined operation; but it may be because the application performed an illegal or undefined operation to begin with.). [ EXECUTION WARNING #379: DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT]

 

System Setup Information:
-----------------------------------------

System Used: (Manufacturer/Model)
CPU SKU: i5-4570
GPU SKU: HD4600
Processor Line: 
System BIOS Version:
CMOS settings:
Graphics Driver Version: 20.19.15.4380
GOP/VBIOS Version:
Operating System: Windows 10
OS Version:10.0.10586.63
API: Direct3D 11
Occurs on non-Intel GPUs?: only on Intel 4th gen

Steps to Reproduce:
-------------------------------
1. Create hardware D3D11 device on Intel HD 4600 adapter
2. Write simple loop with creating and releasing the same resource (buffer or texture) inside it.
3. Build and run
 

Expected Results:
-------------------------------

Infinite iterations with creation and releasing D3D11 resource should be okay (no memory leaks)

Actual Results:
-------------------------------

~1500 iterations with 1Mb sized buffer resource and ~24500 iterations with 1Mb sized texture 2D resource leads to removing D3D11 device (possibly memory leaks)

Additional Information:
-------------------------------

I have run my own tests on Intel HD Graphics 4600 regarding memory allocation and can say that driver has problems with releasing resources. It simply does not do it after calling Release() D3D11 API method as it should be and device memory still stay allocated. Everyone can write and run test this issue simply creating a loop with D3D11 resource creating and releasing inside loop body. Buffer 1Mb sized resource creation fails after 1450-1550 iterations, texture 2D 1Mb sized resource creation fails after 24000 iterations. I have tested this on current HD 4600 driver (154010.4300) and beta (20.19.15.4380) which available for download here.

With the same tests my secondary AMD R7 265 works fine, correctly creating and releasing D3D11 resources. And even more it outputs debug message that device memory is exhausted:

D3D11 ERROR: ID3D11Device::CreateBuffer: CreateBuffer returning E_OUTOFMEMORY, meaning memory was exhausted. [ STATE_CREATION ERROR #70: CREATEBUFFER_OUTOFMEMORY_RETURN]

 

If someone need my test code snippets or any other details feel free to contact me. I hope Intel review this driver issue a soon as possible and fix it.

0 Kudos
1 Solution
Michael_C_Intel2
Employee
3,770 Views

Hi Pavel,

We have found the root cause of the issue and are working on a fix. In the meantime we suggest you flush the graphics context periodically when creating/releasing the resources. This can be done by adding: context->Flush(); at the end of the for(;;) loop. This will resolve the app crash and unblock your project while fix the issue in the driver. 

 

 

View solution in original post

0 Kudos
11 Replies
Michael_C_Intel2
Employee
3,770 Views

Hi Pavel,

We will investigate the issue and I will let you know what we find out, if it is a driver issue we will fix it of course. If you have a sample that can quickly reproduce the issue please get the to me, either by private message or attached to a post. It will make replication easier if we see how you are reproducing the problem.

Thanks,

-Michael

0 Kudos
Pavel_K_1
Beginner
3,770 Views

Hi Michael,

thanks for your quick response.

I've attached VS2015 solution with simple GPU test. It creates and releases D3D11 resources (buffers or textures) in a loop. Both cases lead to crash but it is only a matter of iterations quantity. In the x86 build buffer allocation fails after ~1700 create/release cycles and texture allocation fails after ~24000 create/release cycles. The x64 build causes both buffers and textures allocations to fail after ~24000 iterations.

Please, let me know about your testing results. We have over 400 workplaces with Intel HD Graphics 4600 and I cannot ship application to them due to this issue. 

0 Kudos
Michael_C_Intel2
Employee
3,771 Views

Hi Pavel,

We have found the root cause of the issue and are working on a fix. In the meantime we suggest you flush the graphics context periodically when creating/releasing the resources. This can be done by adding: context->Flush(); at the end of the for(;;) loop. This will resolve the app crash and unblock your project while fix the issue in the driver. 

 

 

0 Kudos
Pavel_K_1
Beginner
3,770 Views

Hi Michael,

first of all thanks for your feedback. I have added "Flush()" method call to my resource manager and it helps. I haven't noticed any performance issues despite Microsoft's D3D11 reference. So your suggestion suits well. Thank you! 

0 Kudos
Michael_C_Intel2
Employee
3,770 Views

Hi Pavel,

Glad to hear our suggestion helped, also we have a driver fix and it should be included in the next 15.40 driver release. 

-Michael

0 Kudos
Stefan_A_
Beginner
3,770 Views

Hello,

We still have this problem on some Intel HD cards. 

I've tried adding Flush() at various locations related to loading resources. Doesn't seem to help. Can you please give me more info on where the flush should be called and why this helps?

/Stefan 

0 Kudos
Stefan_A_
Beginner
3,770 Views

This doesn't seem to be resolved. We still have problems even after adding Flush() to our loop.

Only on Intel HD cards.

0 Kudos
Pavel_K_1
Beginner
3,770 Views

Hello Stefan,

I am sure that this bug has been fixed. I have run my test app attached earlier, and it successfully passed resource creation/releasing cycles in the loop. Intel HD Graphics version is 15.4531, Win10 x64, Intel Core i7-4790K. 

0 Kudos
Nikhil_T_
Beginner
3,770 Views

I have an issue, I am posting here because I am not finding how to put a new question:

 

Original Issue:

In our Win8 system we have a requirement to connect the Tablet to external display, Tablet has only “display port” and we can connect to any monitor which has display port.

Our System Support 1920x1080” resolution, We can connect to any HD TV /Projector through “Display Port to HDMI cable”.

The problem we were facing that the Tablet’s resolution changes to lower after connecting the system to projector/HD TV.

 Using Intel CUI libraries :

Our moto is to clone the primary display through “Duplicate mode”, to resolve the above issue we decided to clone the primary display to secondary display, for that I took the approach what were already using for one of our product.

 

Here first We get the ClSID for “IgfxExt.CUIExternal” then do a CoCreateInstance() for interface ID “IID_ICUIExternal8”, we initialize the intel libraries with this as first step.

This CoCreateInstance gives us a ICUIExternal8 * pointer, which actually use to do cloning and all.

I found that the CLSID for the “IgfxExt.CUIExternal” points to C:\Windows\System32\igfxext.exe.   (Used for switching graphics output from the native display to the external one).

 

We use below Apis for cloning workflow:

 

ICUIExternal6::

        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCloneRefreshRates(

            /* [in] */ UINT nSizeCfg,

            /* [size_is][in] */ BYTE *pDispCfg,

            /* [in] */ UINT nSizeRRArray,

            /* [size_is][out] */ BYTE *pPrimaryRR,

            /* [size_is][out] */ BYTE *pSecondaryRR,

            /* [out] */ DWORD *pExtraErrorCode) = 0;

 

        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCloneView(

            /* [in] */ UINT nSizeCfg,

            /* [size_is][in] */ BYTE *pDispCfg,

            /* [in] */ UINT nSizeRRStruct,

            /* [size_is][in] */ BYTE *pPrimRRToSet,

            /* [size_is][in] */ BYTE *pSecndRRToSet,

            /* [out] */ DWORD *pExtraErrorCode) = 0;

 

ICUIExternal3::

virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumAttachableDevices(

            /* [in] */ BSTR strDeviceName,

            /* [in] */ UINT nIndex,

            /* [out] */ DWORD *puidMonitor,

            /* [out][in] */ DWORD *pdwDeviceType,

            /* [out] */ DWORD *pdwStatus) = 0;

 

 

Issue  while using Intel CUI libraries:

 

1.With a ICUIExternal8 * pointer we call  ICUIExternal6::SetCloneView() to Clone the display. This Api works fine whenever we wants to clone the display.

 

2.To confirm, cloning happened or not we perform “2” loop iterations on “ICUIExternal3::EnumAttachableDevices()”.

 

    This function takes the device name and index (here 0 and 1) and gives the information of :

uidMonitor - id of the monitor being enumerated,

dwDeviceType - code for what type of device was enumerated,

dwStatus - error status.

 

The Device name comes from windows function EnumDisplayDevicesW(__in_opt LPCWSTR lpDevice,__in DWORD iDevNum,__inout PDISPLAY_DEVICEW lpDisplayDevice,__in DWORD dwFlags); ( we are calling it only once as EnumDisplayDevices(NULL, 0, &DISPLAY_DEVICE, 0) to get information on the display adapter.)

                                                                                                                               

3.During iterations for the second monitor, device type is ‘Display Port’ and “dwStatus” status coming as “IGFX_DISPLAY_DEVICE_SECONDARY” which indicates that the cloning is happening through “Extended mode” not the “Duplicate mode”.

Status should come as IGFX_DISPLAY_DEVICE_PRIMARY for correct cloning status which we treat as “Duplicate Mode”.

 

If we go to the control Panel -> Display -> Adjust Resolution and see the cloning is still as “Duplicate mode”, there is no issue with the cloning.

 

Observation:

                                                                                                                                                                                            

I have tested this on Win7,  there is no issue. Issue found when I starts using the same intel Apis for our  product, which is a Win-8 based machine.

0 Kudos
Nikhil_T_
Beginner
3,770 Views

I have an issue, I am posting here because I am not finding how to put a new question:

 

Original Issue:

In our Win8 system we have a requirement to connect the Tablet to external display, Tablet has only “display port” and we can connect to any monitor which has display port.

Our System Support 1920x1080” resolution, We can connect to any HD TV /Projector through “Display Port to HDMI cable”.

The problem we were facing that the Tablet’s resolution changes to lower after connecting the system to projector/HD TV.

 Using Intel CUI libraries :

Our moto is to clone the primary display through “Duplicate mode”, to resolve the above issue we decided to clone the primary display to secondary display, for that I took the approach what were already using for one of our product.

 

Here first We get the ClSID for “IgfxExt.CUIExternal” then do a CoCreateInstance() for interface ID “IID_ICUIExternal8”, we initialize the intel libraries with this as first step.

This CoCreateInstance gives us a ICUIExternal8 * pointer, which actually use to do cloning and all.

I found that the CLSID for the “IgfxExt.CUIExternal” points to C:\Windows\System32\igfxext.exe.   (Used for switching graphics output from the native display to the external one).

 

We use below Apis for cloning workflow:

 

ICUIExternal6::

        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCloneRefreshRates(

            /* [in] */ UINT nSizeCfg,

            /* [size_is][in] */ BYTE *pDispCfg,

            /* [in] */ UINT nSizeRRArray,

            /* [size_is][out] */ BYTE *pPrimaryRR,

            /* [size_is][out] */ BYTE *pSecondaryRR,

            /* [out] */ DWORD *pExtraErrorCode) = 0;

 

        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCloneView(

            /* [in] */ UINT nSizeCfg,

            /* [size_is][in] */ BYTE *pDispCfg,

            /* [in] */ UINT nSizeRRStruct,

            /* [size_is][in] */ BYTE *pPrimRRToSet,

            /* [size_is][in] */ BYTE *pSecndRRToSet,

            /* [out] */ DWORD *pExtraErrorCode) = 0;

 

ICUIExternal3::

virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumAttachableDevices(

            /* [in] */ BSTR strDeviceName,

            /* [in] */ UINT nIndex,

            /* [out] */ DWORD *puidMonitor,

            /* [out][in] */ DWORD *pdwDeviceType,

            /* [out] */ DWORD *pdwStatus) = 0;

 

 

Issue  while using Intel CUI libraries:

 

1.With a ICUIExternal8 * pointer we call  ICUIExternal6::SetCloneView() to Clone the display. This Api works fine whenever we wants to clone the display.

 

2.To confirm, cloning happened or not we perform “2” loop iterations on “ICUIExternal3::EnumAttachableDevices()”.

 

    This function takes the device name and index (here 0 and 1) and gives the information of :

uidMonitor - id of the monitor being enumerated,

dwDeviceType - code for what type of device was enumerated,

dwStatus - error status.

 

The Device name comes from windows function EnumDisplayDevicesW(__in_opt LPCWSTR lpDevice,__in DWORD iDevNum,__inout PDISPLAY_DEVICEW lpDisplayDevice,__in DWORD dwFlags); ( we are calling it only once as EnumDisplayDevices(NULL, 0, &DISPLAY_DEVICE, 0) to get information on the display adapter.)

                                                                                                                               

3.During iterations for the second monitor, device type is ‘Display Port’ and “dwStatus” status coming as “IGFX_DISPLAY_DEVICE_SECONDARY” which indicates that the cloning is happening through “Extended mode” not the “Duplicate mode”.

Status should come as IGFX_DISPLAY_DEVICE_PRIMARY for correct cloning status which we treat as “Duplicate Mode”.

 

If we go to the control Panel -> Display -> Adjust Resolution and see the cloning is still as “Duplicate mode”, there is no issue with the cloning.

 

Observation:

                                                                                                                                                                                            

I have tested this on Win7,  there is no issue. Issue found when I starts using the same intel Apis for our  product, which is a Win-8 based machine.

0 Kudos
Nikhil_T_
Beginner
3,770 Views

I have an issue, I am posting here because I am not finding how to put a new question:

 

Original Issue:

In our Win8 system we have a requirement to connect the Tablet to external display, Tablet has only “display port” and we can connect to any monitor which has display port.

Our System Support 1920x1080” resolution, We can connect to any HD TV /Projector through “Display Port to HDMI cable”.

The problem we were facing that the Tablet’s resolution changes to lower after connecting the system to projector/HD TV.

 Using Intel CUI libraries :

Our moto is to clone the primary display through “Duplicate mode”, to resolve the above issue we decided to clone the primary display to secondary display, for that I took the approach what were already using for one of our product.

 

Here first We get the ClSID for “IgfxExt.CUIExternal” then do a CoCreateInstance() for interface ID “IID_ICUIExternal8”, we initialize the intel libraries with this as first step.

This CoCreateInstance gives us a ICUIExternal8 * pointer, which actually use to do cloning and all.

I found that the CLSID for the “IgfxExt.CUIExternal” points to C:\Windows\System32\igfxext.exe.   (Used for switching graphics output from the native display to the external one).

 

We use below Apis for cloning workflow:

 

ICUIExternal6::

        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCloneRefreshRates(

            /* [in] */ UINT nSizeCfg,

            /* [size_is][in] */ BYTE *pDispCfg,

            /* [in] */ UINT nSizeRRArray,

            /* [size_is][out] */ BYTE *pPrimaryRR,

            /* [size_is][out] */ BYTE *pSecondaryRR,

            /* [out] */ DWORD *pExtraErrorCode) = 0;

 

        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCloneView(

            /* [in] */ UINT nSizeCfg,

            /* [size_is][in] */ BYTE *pDispCfg,

            /* [in] */ UINT nSizeRRStruct,

            /* [size_is][in] */ BYTE *pPrimRRToSet,

            /* [size_is][in] */ BYTE *pSecndRRToSet,

            /* [out] */ DWORD *pExtraErrorCode) = 0;

 

ICUIExternal3::

virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumAttachableDevices(

            /* [in] */ BSTR strDeviceName,

            /* [in] */ UINT nIndex,

            /* [out] */ DWORD *puidMonitor,

            /* [out][in] */ DWORD *pdwDeviceType,

            /* [out] */ DWORD *pdwStatus) = 0;

 

 

Issue  while using Intel CUI libraries:

 

1.With a ICUIExternal8 * pointer we call  ICUIExternal6::SetCloneView() to Clone the display. This Api works fine whenever we wants to clone the display.

 

2.To confirm, cloning happened or not we perform “2” loop iterations on “ICUIExternal3::EnumAttachableDevices()”.

 

    This function takes the device name and index (here 0 and 1) and gives the information of :

uidMonitor - id of the monitor being enumerated,

dwDeviceType - code for what type of device was enumerated,

dwStatus - error status.

 

The Device name comes from windows function EnumDisplayDevicesW(__in_opt LPCWSTR lpDevice,__in DWORD iDevNum,__inout PDISPLAY_DEVICEW lpDisplayDevice,__in DWORD dwFlags); ( we are calling it only once as EnumDisplayDevices(NULL, 0, &DISPLAY_DEVICE, 0) to get information on the display adapter.)

                                                                                                                               

3.During iterations for the second monitor, device type is ‘Display Port’ and “dwStatus” status coming as “IGFX_DISPLAY_DEVICE_SECONDARY” which indicates that the cloning is happening through “Extended mode” not the “Duplicate mode”.

Status should come as IGFX_DISPLAY_DEVICE_PRIMARY for correct cloning status which we treat as “Duplicate Mode”.

 

If we go to the control Panel -> Display -> Adjust Resolution and see the cloning is still as “Duplicate mode”, there is no issue with the cloning.

 

Observation:

                                                                                                                                                                                            

I have tested this on Win7,  there is no issue. Issue found when I starts using the same intel Apis for our  product, which is a Win-8 based machine.

0 Kudos
Reply