Two runtime problems...

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Two runtime problems...

      Hi all,

      I have the book v3.0, but since I have yet to manage to compile the source code there with VS2010, I'm trying v4.0 of the code. I will pick up the 4.0 book if I can get this to work.

      the v4.0 code compiles with no errors, but I get two problems when trying to run:

      1/ When I try to start the game from VS2010, I get "Failed creating the Direct3D device". From reading google, it seems this is due to VS2010 trying to use my Intel HD graphics insted of the Nvidia GTX675M. The only workaroundI can find is to manually start the application from the Source/Lib/Win32Debug directory. Anyone know of a cleaner workaround?

      2/ When I start from the Win32Debug directory, I get:

      [ERROR] Failed to initialize resource cache! Are your paths set up correctly?
      Function: GameCodeApp::InitInstance

      I have set the Configuration Properties->Debugging Working Directory to ..\..\..\Game. I also followed all the othe instructions in the README.

      Any idea what's wrong please? Feels like I'm soo close....

      thanks,
      Paul
    • RE: Two runtime problems...

      Originally posted by PaulieIrish
      1/ When I try to start the game from VS2010, I get "Failed creating the Direct3D device". From reading google, it seems this is due to VS2010 trying to use my Intel HD graphics insted of the Nvidia GTX675M. The only workaroundI can find is to manually start the application from the Source/Lib/Win32Debug directory. Anyone know of a cleaner workaround?

      I assume you have the latest version of DirectX?

      I'm sure this is a case of the engine not handling multiple video cards correctly. Check out GameCode.cpp around line 1053. This is a callback that gets called when DXUT is asking if a particular device is valid. We just return true here. A more robust approach would be to allow the user to choose or to do some additional checking to ensure it's compatible with the actual format we're trying to create.

      Mike wrote the graphics system so he might be able to answer this directly. However, if you want to try to get this working, I would set a breakpoint in this function and dig into those data structures. Something in there should allow you to reject the Intel HD card.

      Another thing you can try is to enable Direct3D debugging in the DIrectX SDK Tools. This should give you more information as to what exactly is failing.

      Intel HD cards are a nightmare. Our graphics programmer on The Sims Medieval spent weeks trying to get it to work. :-/


      2/ When I start from the Win32Debug directory, I get:

      [ERROR] Failed to initialize resource cache! Are your paths set up correctly?
      Function: GameCodeApp::InitInstance

      I have set the Configuration Properties->Debugging Working Directory to ..\..\..\Game. I also followed all the othe instructions in the README.

      Any idea what's wrong please? Feels like I'm soo close....

      When you run the executable directly, it doesn't have any way to find your compiler settings. It just uses the current directory. You can copy & paste this file into the Game directory to try from there, but I'm sure you'll get the same issue.

      -Rez
    • Yes, I'm using the latest version of DirectX.

      I modified the GameCode.cpp code to return false for Intel grfx:

      bool CALLBACK GameCodeApp::IsD3D11DeviceAcceptable( const CD3D11EnumAdapterInfo *AdapterInfo, UINT Output, const CD3D11EnumDeviceInfo *DeviceInfo,
      DXGI_FORMAT BackBufferFormat, bool bWindowed, void* pUserContext )
      {
      if(wcsncmp(AdapterInfo->AdapterDesc.Description, L"Intel", 5) == 0)
      return false;
      else
      return true;
      }


      Now it only returns true when it seems my Nvidia card during enumeration.

      However, I still get the "Failed creating the Direct3D device" error (followed by the "Failed to init resource cache error - even in VS2010)...
    • Here's what the Output Window shows:

      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll'
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll'
      d:\projectssvn\gamecode4\dev\source\gcc4\3rdparty\dxut11\core\dxut.cpp(3557): D3D11CreateDevice hr=E_INVALIDARG (0x80070057)
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\xinput1_3.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\MMDevAPI.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\propsys.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\AudioSes.dll', Cannot find or open the PDB file
      c:\c++\gamecoding4\source\gcc4\audio\directsoundaudio.cpp(129): SetFormat hr=DSERR_ALLOCATED (0x8878000a)
      D3DX11: CAsyncTextureProcessor::Initialize - pDevice must be non-NULL.
    • I'm not convinced this is the case anymore. I think there's some setting that your video card doesn't like. Do you have the DirectX SDK installed? If so, open up the DirectX Control Panel and enable all the debugging output. This should give you much better output and hopefully explain the issue.

      -Rez
    • Here's the full output when I add TeapotWars_2010Win32Debug.exe to DX10/11 debug:



      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\C++\GameCoding4\Source\Lib\Win32Debug\TeapotWars_2010Win32Debug.exe', Symbols loaded.
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\D3dx9d_43.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\D3DX11d_43.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\C++\GameCoding4\Source\Lib\Win32Debug\luaplus51-1201.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\dsound.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\D3DCompiler_43.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll', Cannot find or open the PDB file
      Growing memory pool: [PathingNode:32] = 1
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
      Unrecognized flag: C:\C++\GameCoding4\Source\TeapotWars\Msvc\..\..\Lib\Win32Debug\TeapotWars_2010Win32Debug.exe'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Program Files\Logitech\SetPoint\x86\lgscroll.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\msvcr80.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\ntmarta.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\Wldap32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\profapi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3d11.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\dxgi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3d8thk.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\nvumdshim.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\nvapi.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll'
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3d10warp.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll'
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll'
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\d3dx10_40.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
      'TeapotWars_2010Win32Debug.exe': Unloaded 'C:\Windows\SysWOW64\d3dx10_40.dll'
      d:\projectssvn\gamecode4\dev\source\gcc4\3rdparty\dxut11\core\dxut.cpp(3557): D3D11CreateDevice hr=E_INVALIDARG (0x80070057)
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
      'TeapotWars_2010Win32Debug.exe': Loaded 'C:\Windows\SysWOW64\xinput1_3.dll', Cannot find or open the PDB file

      The post was edited 1 time, last by PaulieIrish ().

    • Yeah, D3D11CreateDevice() doesn't like one or more of the arguments.

      I'm wondering if your card supports DirectX 11. Check out line 261 of GameCode.cpp. The comment there talks about older video cards. Follow those instructions and see if that works. That will run the game with DirectX 9 intead of DirectX 11, which should be much more compatible.

      -Rez
    • According to NVIDIA his card should support DirectX 11. We're probably just missing something trivial unless his card has a factory defect which i highly doubt it does.

      @PaulieIrish: Have you tested the project in DirectX 9 yet? Also check these following suggestions if any of these works for the DX11 one.

      * Have you installed any older versions of the DirectX SDK prior to installing the June 2010 SDK? If you did, have you uninstalled the older version before installing the new one? If you didn't try uninstalling then reinstalling the latest version again.

      * Try opening up the DirectX sample browser and run some DX11 samples in there. The sample browser can be found in start->program files->Microsoft DirectX SDK(...)->DirectX Sample Browser. This is more of a test to see if your problem persists in all other DX11 app or just a localized one in GCC.

      * Double check your GameCodeApp::IsD3D11DeviceAcceptable method. Since you're now checking if the adapter is an Intel Graphics, check if it even returns an adapter that is not an Intel HG Graphics. I checked mine and it never returned my actual ATI graphics card's adapter and all intel graphics instead.

      * This isn't a right fix and we shouldn't really touch anything in DXUT but just wanted you to try this anyways. Try opening DXUT.cpp in GCC\Source\GCC4\3rdparty\DXUT11\Core\DXUT.cpp. In line 3528 check that the 1st parameter is a non-null pointer and the 2nd parameter, ddt, is D3D_DRIVER_TYPE_UNKNOWN. If the 1st parameter is null then check if the 2nd parameter is NOT D3D_DRIVER_TYPE_UNKNOWN. If this works, consider this as a temporary hack fix for now until someone finds the correct solution.

      The post was edited 2 times, last by BrentChua ().

    • Hi guys,

      *this is a pretty new (4 weeks) Alienware m17x with nvidia gtx675m card, so I'm pretty sure it's dx11 compatible. It works fine for DX10 on DDO and whichever DX version GW2 uses...

      *It's also the first/only version of the SDK that I've installed.

      *Most of the DX samples work - some also give the 'failed to create device' error. Not sure if they too are trying to run on the Intel HD grfx or not. E.g DynamicShaderLinkageFX11 works fine, FluidCS11 does not...

      *I put a break point in the DeviceAcceptable code. It calls it multiple times. It returns false for Intel now, and I also see it returning true for the Nvidia card.

      I willl try the DX9 test, and also the DXUT.cpp test you suggested...

      Thanks again for the help!
      Paul
    • 1/ DX9 mode works fine! I see teapots!

      2/ In DXUT.cpp line3528, 1st param is non Null, ddt = D3D_DRIVER_TYPE_UNKNOWN.

      First param looks like:
      pAdapter : 0x0058d090
      IDXGIAdapter : {...}
      IDXGIObject : {...}
      IUnknown : {...}
      _vfptr : 0x50511550
      [0] : 0x50511a7a
      [1] : 0x505115a0
      [2] : 0x505118f3
    • More arguments to above:

      arg3 : 0
      arg4 Createflags : 2
      arg5 DeviceFeatureLevel : 0

      I'm guessing the last one may be the problem?

      I wonder if we need to do full/proper enumeration and select the correct device (rather than the first one that passes the DeviceAcceptable test)?
    • THe GTX675M definatley supports DX11, I have the same card in my laptop. I think you'd have to go way back to the 300 series to lose DX11 support. The questionable aspect here is the Intel HD integrated graphics. If you have one of the newer Ivy Bridge chips then it will support DX11. But I don't think the previous generation chipsets supported DX11.
    • Yes, it's an Ivybridge i7-3610QM processor, so it should support DX11 using Intel grfx.

      I found an option in the Nvidia control panel:
      Manage 3D Settings:Global Settings : Preferred Grpahics Processor

      which I changed from Auto-Seclect to High-Performance Nvidia Processor.

      However, no change when running the application in DX11 mode - still get Failed to Create Device....
    • That is odd. You have basically the exact same setup as my Samsung Series 7 laptop. I7 Ivybridge and nVidia 675M.

      However, I have had no issues with visual studio and DX11. Although I don't believe I have tried to run the GCC4 engine and Teapot Wars on it yet. If I remember, i'll try running them when I get home tonight.

      As a litmus test, try running the latest DX11 tutorial code form Microsoft.
      code.msdn.microsoft.com/window…D-Tutorial-Win32-829979ef

      If those tutorials run ok, then my guess is that it's an issue with DXUT.
      DXUT was never meant for anything more than a helper tool for the tutorials. Which is one of the reasons that you won't find it in the latest DX tutorials.