Intel® Graphics Performance Analyzers (Intel® GPA)
Improve your game's performance by quickly specifying problem areas

GPA 2.1: CreateVertexDeclaration Crash with Multi-Threading

jagoon2
Beginner
1,197 Views
Following source code crashes gpa v2.1 even if D3DCREATE_MULTITHREADED used.

[cpp]#pragma omp parallel
{
D3DVERTEXELEMENT9 elem[] =
{
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
{0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0},
{0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
D3DDECL_END()
};

#pragma omp for
for( int i = 0; i < 1000000; i++ )
{
IDirect3DVertexDeclaration9* decl = NULL;

if( FAILED( mpD3DDevice->CreateVertexDeclaration( elem, &decl ) ) )
{
*(int*)0 = 0;
}

decl->Release();
}
}[/cpp]


Environment:
(Intel R GPA System Inspector)
Windows Vista, 64-bit DEP enabled
Num Processors: 4
Memory: 8189MB
Driver 0:
Device: ATI Radeon HD 4800 Series
Provider: ATI Technologies Inc.
Date: 8-13-2009
Version: 8.650.0.0
VendorId: 1002
ProductId: 9442
Stepping: 0
No support for GPA Instrumentation
GPA install directory: D:Program Files (x86)IntelGPA v2.1
GPA version: 2.1.74801 (2.1.1.9265)
0 Kudos
1 Solution
Neal_Pierman
Valued Contributor I
1,195 Views
Hello,

I did some more checking, and it ends up that GPA has the following limitation (as documented in the Release Notes for the product): "Capture may fail, or other errors may occur, when applications use multiple threads to access the Direct3D devices for rendering."

Since it appears that GPA works with your application when run without multi-threading, the multi-threading limitation would appear to be the underlying reason that GPA cannot instrument/profile your application.

Though this obviously doesn't help you today, I can put in a request to the development team to see if they could support this feature in a future release of GPA.

Regards,

Neal




View solution in original post

0 Kudos
3 Replies
Neal_Pierman
Valued Contributor I
1,197 Views
Hello,

Thanks for reporting this issue through the support forum for GPA.

However, I'll need your help with a couple of questions before we can track down what might be causing this issue:
  1. I'm assuming that you received this error when running System Analyzer, and I'm assuming that the code runs successfully when not running the program with System Analyzer?
  2. You indicated that running this program crashed GPA... did GPA produce an XML "dump file" and/or print an error message (and if so, please include that here)?
  3. Did you build/run this as a 32-bit or 64-bit application?
  4. Did you try the code on devices other that the ATI Radeon you mentioned and/or on other cpu's and/or other versions of Windows (such as 32-bit Vista)?
  5. Does the error occur immediately, or only with large values of the loop index <i>?
  6. Is there any difference in behavior if you don't use the #pragma option?
  7. Were you running GPA in single-machine or remote/server mode?
Thanks!

Neal
0 Kudos
jagoon2
Beginner
1,194 Views
Thanks for reply.

  1. Your assumption is right.
  2. Xmlattached: http://software.intel.com/file/23167
  3. I'm using 32bit application. I tried to run x64 build, but following error message displayed: The profiling of 64-bit applications is not supported.
  4. No. But I have a plan tobuy a new machine which has GMA X4500, and will be able to test with it.
  5. OpenMP's static scheduling shows meaningless result, so I changed it to dynamic scheduling. The variables of i is: 17327, 29471, 13123, 9141, 18948...
  6. Without OpenMP, the source code works fine.
  7. Single Machine.

Thanks

0 Kudos
Neal_Pierman
Valued Contributor I
1,196 Views
Hello,

I did some more checking, and it ends up that GPA has the following limitation (as documented in the Release Notes for the product): "Capture may fail, or other errors may occur, when applications use multiple threads to access the Direct3D devices for rendering."

Since it appears that GPA works with your application when run without multi-threading, the multi-threading limitation would appear to be the underlying reason that GPA cannot instrument/profile your application.

Though this obviously doesn't help you today, I can put in a request to the development team to see if they could support this feature in a future release of GPA.

Regards,

Neal




0 Kudos
Reply