Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Constant Crashes - Failed to present D3D11 swapchain due to device removed.

Discussion in 'Editor & General Support' started by Mad_Mark, Oct 14, 2020.

  1. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
    Some good news, it seems the bug has now been looked at and confirmed by the relevant team and hopefully can address soon.

    Thanks for the help on this, is very appreciated

    "IN-27763 - Build stops responding when building the project using DirectX11 graphics API UPDATE: Internal ID created
    CASE IN-27763
    Thank you again for your bug report.
    Your bug report Build stops responding when building the project using DirectX11 graphics API has been confirmed and transferred to the appropriate internal development team at Unity. Your bug report has the following internal ID: UUM-25111"
     
    Lughinu and Valorware like this.
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,089
  3. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
  5. Lughinu

    Lughinu

    Joined:
    Nov 3, 2016
    Posts:
    11
    I just worked 8 hours without a problem, my "solution" was to manually set integrated card instead of nvidia.
    Fortunately I have a 2D game.

    upload_2023-1-26_16-13-38.png
     
  6. Valorware

    Valorware

    Joined:
    Aug 25, 2016
    Posts:
    87
    Just a temporary solution though, you shouldn't/can't release a game like that because it will still likely crash on random PCs
     
  7. Valorware

    Valorware

    Joined:
    Aug 25, 2016
    Posts:
    87
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
    Hi,

    Not sure on this, what GPU is this running on ?

    Also you got the swapchain bug or a general crash ?
     
  9. Valorware

    Valorware

    Joined:
    Aug 25, 2016
    Posts:
    87
    Its AMD something. I did get the error on my NVidia PC, but then when built, the crash also happened on the AMD Steam Deck.

    My particular variation of the problem was related to post-processing though.

    So I don't think it matters if its NVidia or AMD. Well, who knows whats going on really, its difficult to say

    *edit* it was Swapchain bug. same error as the topic title
     
    nasos_333 likes this.
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
    Indeed, Unity has also confirmed that can be a number of reasons, so will see, hopefully they can discover the problem and solve all.
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022





    An update, it seems after i updated my 1050GTX drivers get stuck in some of the most demanding scenes in LUMINA URP and HDRP in DX11. I never had any issues with previous drives in either versions in any scene.

    With DX12 both assets work fine as well.

    I post my new drivers details from DX Diag and Nvidia panels, in case can help.

    It is also apparent that Nvidia states Run time DX12 and DX Diag also reports DX12 use, thus i assume they have completely abandoned DX11 and thus the issues of random crashes.

    My laptop is a DELL XPS 15 9560, 1050GTX GPU.

    More info on the issue:
    https://forum.unity.com/threads/failed-to-present-d3d11-swapchain.1346855/#post-8753737
     
    Last edited: Jan 30, 2023
  12. grizzly101

    grizzly101

    Joined:
    Jan 4, 2017
    Posts:
    1
    Disabling the integrated graphics card worked for me too, thanks!
     
  13. Valorware

    Valorware

    Joined:
    Aug 25, 2016
    Posts:
    87
    Short-term fix, if you release your game its likely that it'll crash on many players PCs. You cant ask them all to disable integrated graphics and they may not have that option!
     
  14. Lughinu

    Lughinu

    Joined:
    Nov 3, 2016
    Posts:
    11
    apparently updating my nvidia driver, fixed this issue
     
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
    Nice, at least works in some configs.

    The issue with this is that is rather random, for me updating my 1050GTX driver made the issue appear and had to revert to DX12 mode to work with LUMINA.
     
  16. GamesbyJP

    GamesbyJP

    Joined:
    May 20, 2018
    Posts:
    55
    Valorware and nasos_333 like this.
  17. battletrance1st

    battletrance1st

    Joined:
    Jan 27, 2022
    Posts:
    1
    nasos_333 likes this.
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
    The issue with this is that the end user will still get a crash and cant be forced to use such modification.

    Also the other issue is that in my case the game runs in real time, there is certainly nowhere a 2 secs gpu delay, so the whole thing is off and is a bug that need to be resolved so crashes are globally avoided.

    Is also more clear that is a bug as happens only after a certain driver update version.

    The windows setting of responding at a 2 secs stalled GPU seems reasonable in general, is useful to know how to extend for editor purposes perhaps, but for run time should never expect a 2 secs GPU stall in general, so real time things should definitly not cause this issue.
     
    Valorware likes this.
  19. GamesbyJP

    GamesbyJP

    Joined:
    May 20, 2018
    Posts:
    55
    This is the task manager performance tab during 2 swapchain crashes.
    Both of the crashes are indicated by 2 sudden spikes in the 3D utilisation graph.
     

    Attached Files:

  20. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022
    GamesbyJP likes this.
  21. NathoSteveo

    NathoSteveo

    Joined:
    Dec 7, 2019
    Posts:
    6
    Happening to me a lot recently, I'm using 2022.2.8f1 very annoying.
     
  22. NathoSteveo

    NathoSteveo

    Joined:
    Dec 7, 2019
    Posts:
    6
    I managed to fix the problem (for me) by going to Registry Editor: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
    and changed 'TdrLevel' (which wasn't there, so I created the key) to 0, haven't had a crash since.
     
    ROBYER1 and nasos_333 like this.
  23. Alec-Slayden

    Alec-Slayden

    Joined:
    Dec 16, 2008
    Posts:
    100
    I'm getting this issue occasionally also. No heavy load, just some UI work in a scene. I was writing code in VS and the computer froze for between 15 and 30 seconds, then the error popped up. GPU is a 3090 and doesn't spike more than 6%.
     
    nasos_333 likes this.
  24. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,022

    Hi all, i have managed to fix the issue replacing a while loop in my shader with a for loop with specific iterations.

    The video shows LUMINA running in DX11 mode.
     
  25. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,420
  26. KangManJyn

    KangManJyn

    Joined:
    Sep 29, 2022
    Posts:
    1
    It is a Windows 10 platform app.
    If you don't use "Hardware Decoding", it seems to be solved.
    It seems to be a GPU compatibility issue, "Hardware Decoding" is disabled, so it works well.
     
  27. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,420
    In my specific case, I was using virtual desktop on an Intel XE Integrated GPU laptop to use the Oculus Quest Pro on unsupported hardware (the Oculus App told me the GPU was unsupported). But while using Virtual Desktop with SteamVR, Unity would have a TDR timeout crash on play with OpenXR. The next thing I need to figure out is that the VR tracking works in Unity and I can even mix Vive trackers + a base station with OVR Space Calibrator in a mixed playspace using this setup, but the actual VR view does not render in the headset which I have read around is a common Virtual Desktop + Unity issue that has workarounds using command line to launch the unity project with Virtual Desktop attached.
     
  28. unity_fTJWaumQjo0cXA

    unity_fTJWaumQjo0cXA

    Joined:
    Aug 10, 2018
    Posts:
    1
    The issue appeared for me when I updated the Nvidia drivers to latest ones. I've never seen this one before, but right after driver update I couldn't even open a fresh new project because of it. The fix of adding parameters to work with d3d12 is what fixed it for me. So it seems that there's a strong connection with latest drivers here
     
    nasos_333 likes this.
  29. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    This happens in Unreal engine too. In Unity it happens a few times a day, and 50 times in Unreal.
    So this is not engine issue. It also happens on different PCs.