Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX 9 Device Creation Failing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Shenjoku   Members   -  Reputation: 160

Like
0Likes
Like

Posted 11 August 2012 - 02:49 PM

A client is having some issues trying to run our app on a Windows XP machine, wherein the device creation process is repeatedly failing. I don't have access to the computer yet so I know nothing about the hardware specs other than that they said, "The graphics card is rather new". I'm a little skeptical but that's a different problem Posted Image

They sent me a log and the error messages they're getting look like this:

Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
Direct3D9: (WARN) :driver set D3DDEVCAPS_TEXTURENONLOCALVIDMEM w/o DDCAPS2_NONLOCALVIDMEM:turning off D3DDEVCAPS_TEXTURENONLOCALVIDMEM
D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO
Direct3D9: (WARN) :driver set D3DDEVCAPS_TEXTURENONLOCALVIDMEM w/o DDCAPS2_NONLOCALVIDMEM:turning off D3DDEVCAPS_TEXTURENONLOCALVIDMEM
Direct3D9: (ERROR) :Device cannot perform hardware processing. ValidateCreateDevice failed.
Direct3D9: (WARN) :driver set D3DDEVCAPS_TEXTURENONLOCALVIDMEM w/o DDCAPS2_NONLOCALVIDMEM:turning off D3DDEVCAPS_TEXTURENONLOCALVIDMEM
Direct3D9: (WARN) :driver set D3DDEVCAPS_TEXTURENONLOCALVIDMEM w/o DDCAPS2_NONLOCALVIDMEM:turning off D3DDEVCAPS_TEXTURENONLOCALVIDMEM

Direct3D9: (INFO) :======================= Hal SWVP device selected
Direct3D9: (INFO) :HalDevice Driver Style 8
Direct3D9: (ERROR) :Failed to create driver surface
Direct3D9: (ERROR) :Failed to initialize primary swapchain
Direct3D9: (ERROR) :Failed to initialize Framework Device. CreateDevice Failed.

Now I've been looking into the problem for a whlie and I can't seem to find any solid conclusions as to what is causing the problem. The device creation is indeed first trying to create with the D3DCREATE_HARDWARE_VERTEXPROCESSING, and then if that fails it's changing it to D3DCREATE_SOFTWARE_VERTEXPROCESSING and trying again, or at least it should be.

So can anyone shine some light on this problem? Is this just purely a hardware thing? I'll know more once I get a chance to check out the machine but for now I'm just trying to draw some conclusions so I know what to test out.

Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7431

Like
0Likes
Like

Posted 11 August 2012 - 05:29 PM

How are you initializing your present parameters? My gut feeling is that there's something in there - a format or similar - that the driver is unhappy with. If you could post the code where you set these up, it will help with diagnosing this.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 Shenjoku   Members   -  Reputation: 160

Like
0Likes
Like

Posted 11 August 2012 - 06:44 PM

Sure thing. I'm just going to post the parameters being used though since a lot of the initialization stuff is engine code I really shouldn't be posting. Taken directly from the watch window in VC9.

  BackBufferWidth 3862
  BackBufferHeight 1222
  BackBufferFormat D3DFMT_X8R8G8B8
  BackBufferCount 1
  MultiSampleType D3DMULTISAMPLE_NONMASKABLE
  MultiSampleQuality 2
  SwapEffect D3DSWAPEFFECT_DISCARD
  hDeviceWindow 0x000201c2 {unused=0 }
  Windowed 1
  EnableAutoDepthStencil 1
  AutoDepthStencilFormat D3DFMT_D16
  Flags 0
  FullScreen_RefreshRateInHz 0
  PresentationInterval 2147483648

Though these are just the values I'm getting on my system. I can't really know what they are getting, but I don't see any reason it would be different.

I want to remind you also that this is only happening on their computers. We have plenty of other computers running Windows XP and Windows 7 and none of them have issues. So it has to be some hardware limitation but I don't really know where to look for something like that since I'm not really a harware guru or anything.

Also of note is that I thought it might be the AutoDepthStencilFormat, but I already added error checking before setting the value that queries the device via CheckDeviceFormat and CheckDepthStencilMatch to make damn sure it's supported and that isn't failing on their system. Unless my error checking function is broken somehow. I copied it directly from MSDN though:

iTruth mIsDepthFormatSupported(D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat)
{
iTruth result = kFalse;

if (f_pD3D == NULL)
{
   f_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
}

if (f_pD3D != NULL)
{
   // Verify that the depth format exists.
   HRESULT hr = f_pD3D->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, adapterFormat,  D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, depthStencilFormat);

   if (SUCCEEDED(hr))
   {
	// Verify that the depth format is compatible.
	hr = f_pD3D->CheckDepthStencilMatch(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, adapterFormat, renderTargetFormat,  depthStencilFormat);

	result = SUCCEEDED(hr);
   }
}
return result;
}

P.S. In case you're wondering about the massive backbuffer size, it's because I have rather large dual monitors and our engine is creating the buffer to fill the entire space in order to avoid having to recreate it every time the window gets resized.

Edited by Shenjoku, 11 August 2012 - 06:55 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS