Search Unity

Unity keeps crashing when switching between dx9 and dx11

Discussion in 'Editor & General Support' started by eskovas, Nov 14, 2013.

  1. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Hello,
    This is a problem that i've had for a long time, even made a thread about that and sent a bug report but nothing changed.
    I suspect it's something inside the project folder but i never found what it was.

    here's the log when it tries to switch between dx versions:
    Code (csharp):
    1.  
    2. .
    3. .
    4. .
    5. GfxDevice: creating device client; threaded=1
    6. Direct3D:
    7.     Version:  Direct3D 11.0 [level 11.0]
    8.     Renderer: NVIDIA GeForce GTX 650 (ID=0xfc6)
    9.     Vendor:   NVIDIA
    10.     VRAM:     965 MB
    11. Unsupported: Hidden/TerrainEngine/Splatmap/Lightmap-AddPass
    12. Unsupported: Hidden/TerrainEngine/Splatmap/Lightmap-AddPass
    13. System memory in use before: 289.1 MB.
    14. Unloading 149 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    15. System memory in use after: 274.9 MB.
    16.  
    17. Unloading 103 unused Assets to reduce memory usage. Loaded Objects now: 32107.
    18. Total: 31.860464 ms (FindLiveObjects: 1.465834 ms CreateObjectMapping: 0.988894 ms MarkObjects: 12.049968 ms  DeleteObjects: 2.351794 ms)
    19.  
    20. GfxDevice: creating device client; threaded=1
    21. Direct3D:
    22.     Version:  Direct3D 9.0c [nvd3dum.dll 9.18.13.3165]
    23.     Renderer: NVIDIA GeForce GTX 650
    24.     Vendor:   NVIDIA
    25.     VRAM:     965 MB (via DXGI)
    26.     Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0
    27. Crash!!!
    28. .
    29. .
    30. .
    and later on the editor log there's this (don't know if it has anything to do with it):
    Code (csharp):
    1.  
    2.  
    3. ========== OUTPUTING STACK TRACE ==================
    4.  
    5. (0x00900C91) c:\buildagent\work\d3d49558e4d408f4\external\shaderlab\library\intshader.cpp (235 + 0x0): ShaderLab::IntShader::ResolveFallback + 0x31
    6. (0x0091122B) c:\buildagent\work\d3d49558e4d408f4\external\shaderlab\library\shaderparser.cpp (122 + 0x0): ShaderLab::IntShader::CreateFromParsedShader + 0x1cb
    7. (0x009113E2) c:\buildagent\work\d3d49558e4d408f4\external\shaderlab\library\shaderparser.cpp (591 + 0x1b): ShaderFromParseShader + 0x192
    8. (0x00911512) c:\buildagent\work\d3d49558e4d408f4\external\shaderlab\library\shaderparser.cpp (637 + 0xe): ParseShader + 0x72
    9. (0x008C1567) c:\buildagent\work\d3d49558e4d408f4\runtime\shaders\shader.cpp (445 + 0x0): Shader::Parse + 0xf7
    10. (0x008C2102) c:\buildagent\work\d3d49558e4d408f4\runtime\shaders\shader.cpp (685 + 0x17): Shader::RecreateAllShaders + 0x42
    11. (0x006BE814) c:\buildagent\work\d3d49558e4d408f4\runtime\gfxdevice\gfxdevicerecreate.cpp (240 + 0x39): RecreateAllGfxDeviceResources + 0xb4
    12. (0x00F6AB09) c:\buildagent\work\d3d49558e4d408f4\editor\src\application.cpp (1163 + 0x0): Application::TickTimer + 0xa9
    13. (0x01008252) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\wineditormain.cpp (336 + 0x0): MainMessageLoop + 0x1c2
    14. (0x01009197) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\wineditormain.cpp (848 + 0x0): WinMain + 0xe37
    15. (0x011221B4) f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c (275 + 0x1c): __tmainCRTStartup + 0x11a
    16. (0x762F850D) (KERNEL32): (filename not available): BaseThreadInitThunk + 0xe
    17. (0x7790BF39) (ntdll): (filename not available): RtlInitializeExceptionChain + 0x85
    18. (0x7790BF0C) (ntdll): (filename not available): RtlInitializeExceptionChain + 0x58
    19.  
    20. ========== END OF STACKTRACE ===========
    21.  
    Even deleting folder by folder until i don't have anything in the project can fix it, and if i have dx11 shaders, the scene window can't even render the scene...

    Does anyone have any idea on how to fix this?
     
  2. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Really need some help with this, maybe someone from Unity could see this and help me figure this out...

    Here are the known issues that are probably all connected:
    - Unity always crashes when switching between dx9 and dx11,
    - Having dx11 shaders in the project folder will make it impossible to render anything in the scene view and game view even if those shaders aren't being used,
    - RTP V3 doesn't compile new shaders,

    Here are some things i've tried but all failed:
    - export everything to a completely new project,
    - delete folder by folder until i have nothing left,
    - delete all shaders,
    - delete the library folder and everything on the root of the project folder (except the folders).


    This is probably something related to shaders. I do have some strumpy shaders, but i already tried to delete them and it's still the same.
    A long time ago i downloaded the unity built-in shaders from the official place for some unknown reason, don't know if that could be the problem but i downloaded the latest built-in shaders and nothing changed.

    Any ideas i could try?

    EDIT:
    Here's a new update, i've been deleting folder by folder and switching between dx9 and dx11 every time i did it (crashing every time). This last time something different appeared:

    Code (csharp):
    1. GfxDevice: creating device client; threaded=1
    2. Direct3D:
    3.     Version:  Direct3D 11.0 [level 11.0]
    4.     Renderer: NVIDIA GeForce GTX 650 (ID=0xfc6)
    5.     Vendor:   NVIDIA
    6.     VRAM:     965 MB
    7. System memory in use before: 221.6 MB.
    8. Unloading 91 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    9. System memory in use after: 214.2 MB.
    10.  
    11. Unloading 2 unused Assets to reduce memory usage. Loaded Objects now: 29272.
    12. Total: 22.465057 ms (FindLiveObjects: 1.452552 ms CreateObjectMapping: 0.875093 ms MarkObjects: 10.338720 ms  DeleteObjects: 0.077578 ms)
    13.  
    14. GfxDevice: creating device client; threaded=1
    15. Direct3D:
    16.     Version:  Direct3D 9.0c [nvd3dum.dll 9.18.13.3165]
    17.     Renderer: NVIDIA GeForce GTX 650
    18.     Vendor:   NVIDIA
    19.     VRAM:     965 MB (via DXGI)
    20.     Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0
    21. System memory in use before: 213.1 MB.
    22. Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    23. System memory in use after: 213.7 MB.
    24.  
    25. Unloading 1 unused Assets to reduce memory usage. Loaded Objects now: 29277.
    26. Total: 13.676693 ms (FindLiveObjects: 1.775845 ms CreateObjectMapping: 0.919466 ms MarkObjects: 10.057386 ms  DeleteObjects: 0.073955 ms)
    27.  
    28. Gfx command not handled: 981467136 (Last command: 10020)
    29.  
    30. (Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2078)
    31.  
    32. Gfx command not handled: 1065353216 (Last command: 981467136)
    33.  
    34. (Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2078)
    35.  
    36. Gfx command not handled: 1149239296 (Last command: 1065353216)
    37.  
    38. (Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2078)
    39.  
    40. Gfx command not handled: 1065353216 (Last command: 1149239296)
    41.  
    42. (Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2078)
    43.  
    44. Gfx command not handled: 637427800 (Last command: 1065353216)
    45.  
    46. (Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2078)
    47.  
    48. Crash!!!
    Any ideas?



    EDIT 2



    Well couldn't find the problem again, so i started to delete folder by folder from the beginning again. This time it didn't crash at first but crashed when i switched for the 3rd time...

    Code (csharp):
    1.  
    2. GfxDevice: creating device client; threaded=1
    3. Direct3D:
    4.     Version:  Direct3D 9.0c [nvd3dum.dll 9.18.13.3165]
    5.     Renderer: NVIDIA GeForce GTX 650
    6.     Vendor:   NVIDIA
    7.     VRAM:     965 MB (via DXGI)
    8.     Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0
    9. System memory in use before: 122.2 MB.
    10. Unloading 4 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    11. System memory in use after: 120.3 MB.
    12.  
    13. Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 27626.
    14. Total: 14.488999 ms (FindLiveObjects: 1.358070 ms CreateObjectMapping: 0.584099 ms MarkObjects: 11.186646 ms  DeleteObjects: 0.556932 ms)
    15.  
    16. GfxDevice: creating device client; threaded=1
    17. Direct3D:
    18.     Version:  Direct3D 11.0 [level 11.0]
    19.     Renderer: NVIDIA GeForce GTX 650 (ID=0xfc6)
    20.     Vendor:   NVIDIA
    21.     VRAM:     965 MB
    22. Unsupported: Hidden/TerrainEngine/Splatmap/Lightmap-AddPass
    23. System memory in use before: 129.4 MB.
    24. Unloading 12 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    25. System memory in use after: 124.8 MB.
    26.  
    27. Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 27914.
    28. Total: 18.209127 ms (FindLiveObjects: 1.257550 ms CreateObjectMapping: 0.615795 ms MarkObjects: 10.759212 ms  DeleteObjects: 0.641755 ms)
    29.  
    30. GfxDevice: creating device client; threaded=1
    31. Direct3D:
    32.     Version:  Direct3D 9.0c [nvd3dum.dll 9.18.13.3165]
    33.     Renderer: NVIDIA GeForce GTX 650
    34.     Vendor:   NVIDIA
    35.     VRAM:     965 MB (via DXGI)
    36.     Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0
    37. Crash!!!
     
    Last edited: Nov 14, 2013
  3. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Seriously, i can't even understand how this is still happening...
    I literally deleted everything from the project and it still keeps crashing...
    It can't be because of the graphics card, because the same thing was also happening when i was using my laptop months ago...
    $crash.jpg
     
  4. forest-berry

    forest-berry

    Joined:
    Dec 4, 2013
    Posts:
    1
    Happens to me too when i transition from 11 to 9. Try having the editor camera not looking at the level geometry. You may avoid the crash some times..