<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Intel G41 Chipset Direct3D Process handle leak (sample code inc in Developing Games on Intel Graphics</title>
    <link>https://community.intel.com/t5/Developing-Games-on-Intel/Intel-G41-Chipset-Direct3D-Process-handle-leak-sample-code/m-p/764050#M7</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The G41 Express chipset is not being actively supported by the driver team, although they will continue to make and release drivers with planned improvements.&lt;BR /&gt;&lt;BR /&gt;But, I will send your sample to our product support team and see if we can give you some guidance.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Ganesh&lt;BR /&gt;</description>
    <pubDate>Mon, 20 Dec 2010 22:40:37 GMT</pubDate>
    <dc:creator>Doraisamy_G_Intel</dc:creator>
    <dc:date>2010-12-20T22:40:37Z</dc:date>
    <item>
      <title>Intel G41 Chipset Direct3D Process handle leak (sample code included)</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/Intel-G41-Chipset-Direct3D-Process-handle-leak-sample-code/m-p/764049#M6</link>
      <description>Intel G41 Express Chipset&lt;DIV&gt;Driver Date: 09/21/2010&lt;/DIV&gt;&lt;DIV&gt;Driver Version: 6.14.5303&lt;/DIV&gt;&lt;DIV&gt;OS: Windows XP Pro 32bit&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;I have an application that is used for videosurveillancethat is experiencing large memory leaks when using this chipset. I thought maybe it would be resolved by updating to the latest driver version (as of yesterday) which I listed above and that didn't seem to help. In fact, if anything I think it's now leaking more. What happens is that every time we call Direct3DCreate9() it will create 85 process handles and every time we call CreateDevice() to create our Direct3D device it will create an additional 171 process handles.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;I've tried experimenting with different things. If I call Direct3DCreate9() and immediately release it then it will still leak the 85 handles. Similarly if I simply release the Direct3D device immediately after calling CreateDevice() without doing anything all those handles leak as well.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;If I simply don't release either and leave re-use them for the duration of the application then no further process handles will be created. This part is a small improvement over my previously reported issue with the Intel 945 chipset drivers:&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=77291"&gt;http://software.intel.com/en-us/forums/showthread.php?t=77291&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;I'm reusing the same sample code from that issue to duplicate this here as well. I'm also using the SysInternals program handle in order to monitor the handles created by my application and determine what type of handles they are.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;For convenience here is the sample code to reproduce the issue:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;void PerformDirect3DTest(HWND hWnd)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;HRESULT hr = S_OK;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CComPtr&lt;IDIRECT3D9&gt; d3d = NULL;&lt;/IDIRECT3D9&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CComPtr&lt;IDIRECT3DDEVICE9&gt; d3d_device = NULL;&lt;/IDIRECT3DDEVICE9&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3d.Attach(Direct3DCreate9(D3D_SDK_VERSION));&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// see what we can do with the graphics hardware before we try to do anything&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;D3DCAPS9 dxcaps;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;D3DDEVTYPE devtype = D3DDEVTYPE_HAL;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;DWORD dwFlags = D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;hr = d3d-&amp;gt;GetDeviceCaps(D3DADAPTER_DEFAULT, devtype, &amp;amp;dxcaps);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// If device doesn't support HW T&amp;amp;L or doesn't support 1.1 vertex&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// shaders in HW, then switch to SWVP.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;if (((dxcaps.DevCaps &amp;amp; D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0) || (dxcaps.VertexShaderVersion &amp;lt; D3DVS_VERSION(1,1)))&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;dwFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;else&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;dwFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Try to create the D3D device we need&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;D3DPRESENT_PARAMETERS d3dParam;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;memset(&amp;amp;d3dParam, 0, sizeof(D3DPRESENT_PARAMETERS));&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.Windowed = true;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// since we use an additional swap chain we don't need the default backbuffer to be very big&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.BackBufferWidth = 1;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.BackBufferHeight = 1;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.BackBufferCount = 1;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.SwapEffect = D3DSWAPEFFECT_DISCARD;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// this is the window handle of the renderer's video window&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.hDeviceWindow = hWnd;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// try to create a device to use based on the type and behaviour we figured out back in the constructor&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;hr = d3d-&amp;gt;CreateDevice(D3DADAPTER_DEFAULT, devtype, NULL, dwFlags, &amp;amp;d3dParam, &amp;amp;d3d_device);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;if (FAILED(hr))&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;return;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Turn off alpha blending&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;if (FAILED(hr = d3d_device-&amp;gt;SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE)))&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;DXTRACE_ERR(TEXT("DirectX call SetRenderState failed"), hr);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Set a larger backbuffer size for creating our swap chains&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.BackBufferWidth = 1920;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3dParam.BackBufferHeight = 1080;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Create swap chains until we run out of memory&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CComPtr&lt;IDIRECT3DSWAPCHAIN9&gt; *pSwapChains = new CComPtr&lt;IDIRECT3DSWAPCHAIN9&gt;[256];&lt;/IDIRECT3DSWAPCHAIN9&gt;&lt;/IDIRECT3DSWAPCHAIN9&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;for (int i = 0; i &amp;lt; 256; i++)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Create a new swap chain to use&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;hr = d3d_device-&amp;gt;CreateAdditionalSwapChain(&amp;amp;d3dParam, &amp;amp;pSwapChains&lt;I&gt;);&lt;/I&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;if (FAILED(hr))&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;DXTRACE_ERR(TEXT("DirectX call CreateAdditionalSwapChain failed"), hr);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;break;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;}&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;}&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Delete our array of swap chains which will also release them&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;delete [] pSwapChains;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;pSwapChains = NULL;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;// Not necessary since we're going out of scope, but we'll release anyway&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3d_device.Release();&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;d3d.Release();&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;}&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Dec 2010 20:11:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/Intel-G41-Chipset-Direct3D-Process-handle-leak-sample-code/m-p/764049#M6</guid>
      <dc:creator>Steve_Browne</dc:creator>
      <dc:date>2010-12-15T20:11:33Z</dc:date>
    </item>
    <item>
      <title>Intel G41 Chipset Direct3D Process handle leak (sample code inc</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/Intel-G41-Chipset-Direct3D-Process-handle-leak-sample-code/m-p/764050#M7</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The G41 Express chipset is not being actively supported by the driver team, although they will continue to make and release drivers with planned improvements.&lt;BR /&gt;&lt;BR /&gt;But, I will send your sample to our product support team and see if we can give you some guidance.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Ganesh&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Dec 2010 22:40:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/Intel-G41-Chipset-Direct3D-Process-handle-leak-sample-code/m-p/764050#M7</guid>
      <dc:creator>Doraisamy_G_Intel</dc:creator>
      <dc:date>2010-12-20T22:40:37Z</dc:date>
    </item>
  </channel>
</rss>

