Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    My Unity 2020.1.8f1 crashes constantly, albeit randomly. Every few days. This is typically when I am doing a lighting burn on a level (various sizes and complexity) or using a procedural level generation tool (I use both CityScape and CityGen3D). It is getting annoying, and I am losing a lot of time rebooting to clear the RAM and redoing my lost work.

    Error PopUp:
    upload_2020-10-13_19-36-29.png

    Other than abandoning my paid for toolset, or not doing lighting burns, what course of action does unity offer?
    mark
     
  2. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    This can happen if something occupies the GPU for too long (I think the default is 2 seconds?). Windows will think something has crashed and try to reset the graphics card/drivers to keep the computer running. It is not uncommon for graphics tools like lightmappers to accidentally trigger this.

    You can read more about it here: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys . The relevant registry key is "TdrDelay". Try increasing that to something like 10 and see if that helps.
     
    V1R4J, OnatKorucu, honor0102 and 2 others like this.
  3. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Thanks @bobisgod234.
     
  4. surv0013

    surv0013

    Joined:
    Dec 9, 2018
    Posts:
    3
    Hi, have you found a solution to the problem? I just updated the drivers for the video card today and now I have the same error. :(

    UPD:
    Downgraded video-driver NVIDIA GEFORCE to the old version (456.71 → 440). Personally, it helped me. Everywhere they write different things, someone was helped by reinstalling Unity, someone was disabling Windows Defender.
     
    Last edited: Oct 26, 2020
    V1R4J and NorthSilva like this.
  5. Qhuhuit

    Qhuhuit

    Joined:
    Feb 17, 2018
    Posts:
    39
    I had the same crash 5 times over the last hour, getting worth and worth over the days !!!
    The TdrDelay trick didn't worked
     
    V1R4J likes this.
  6. Delvarn

    Delvarn

    Joined:
    Apr 6, 2020
    Posts:
    10
    Did this work for you? I'm, having the exact same problem and can't fix it.
     

    Attached Files:

  7. Ville907

    Ville907

    Joined:
    Aug 6, 2020
    Posts:
    1
    I'd really want to know too, and @Delvarn if you find a solution, please write it here. Thanks!
     
  8. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Sorry, I wiped my hard drive and re-installed. I haven't had the same issue since.
     
    SSUnity15June likes this.
  9. Qhuhuit

    Qhuhuit

    Joined:
    Feb 17, 2018
    Posts:
    39
    I read somewhere that it might be related to having too many polygons in the scene and I just had the same crash again, with literally one cylinder and 6 humanoids on it...
    TdrDelay didn't worked, nor Nvidia settings, nor the 2020.1.13f1

    Windows 10, Unity 2020.1.13f1, Unity Hub 2.4.2, good PC i7, 32Go Ram, 1080Ti... never had the issue before 2020.1 WTF Please fix this !!!
     
    V1R4J likes this.
  10. unity_75_Pu5g5eCYojw

    unity_75_Pu5g5eCYojw

    Joined:
    Jun 1, 2020
    Posts:
    3
    Migrated project from Unity 2019.3.15 to Unity 2020.1.13 and this error appeared out of nowhere. Just why?
     
  11. Animetra-LF

    Animetra-LF

    Joined:
    Nov 26, 2018
    Posts:
    5
    I have this Error as well and I can reproduce it:
    I have a SceneEditor- and a Game-Window open directly next to each other. When I move the seperator-line between them (so I change the size of both), this Error occures every time after a few seconds. It's nothing you need to do for several seconds at all, but I thought, I post it here for debugging reasons, since it's really reproducable, I tested it for about 6 times.
    My scene is not very complex.. a Terrain and some objects, maybe 10-15 lights.
     
    avenk2, Denizac and chadfranklin47 like this.
  12. Snouers

    Snouers

    Joined:
    Nov 21, 2020
    Posts:
    1
    In my case it was antivirus, so try to turn it off and reinstall Unity 2020.
     
  13. fastzhuzhu_dev

    fastzhuzhu_dev

    Joined:
    Dec 11, 2017
    Posts:
    1
    Problem solved! just update to the latest nvidia graphic driver.
     
    ichbinist likes this.
  14. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    28
    2020.1.4f1 same issue, Nvidia driver 457.30 on GTX 970. I'm suspecting the nvidia driver as I updated it recently and I've been using 2020.1.4f1 for months with no issues, have never had this error before updating driver.
     
  15. InfiBatnisGame

    InfiBatnisGame

    Joined:
    Jun 26, 2019
    Posts:
    17
    It crash all my day...Using Unity Hub 2.4.2, 2020.1.15f1,2020.1.14f1. Nvidia driver 457.30(latest ) on GTX 950. Pls Fix It
     
    Last edited: Dec 1, 2020
    semedqurbanov2005 likes this.
  16. unicesumar

    unicesumar

    Joined:
    Jul 11, 2019
    Posts:
    4
    Someone managed to get some solution. I have a Samsung Odyssey notebook with Geforce 1050 gpu. NVIDIA 457.30 driver. I've done everything, downgraded the driver version, already changed the TdrDelay. But the problem remains. Using Unity 2020.1.8f.
     
  17. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    207
    Same here, random crashes and work lost, 2-3 times per day. Unity 2020.1.16f1, geforce 1660, nvidia drivers 457.71.

    I was on older driver when the problem started, and updating didn't help.
     
    Last edited: Dec 4, 2020
  18. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    Yup, moving the separator line between game and scene window is guaranteed to cause the crash for me. Though I have gotten it sometimes in play mode and sometimes when just doing stuff the editor. Updated to the latest Nvidia Graphics Driver and still getting the error. Don't have an antivirus.

    Unity 2020.1.16, URP
    Win 10, RTX 2070 Super, Ryzen 9 3950x

    Update (things that seem to fix the issue for me):
    Not having both the game view and scene view open at the same time when moving the separator.
    Disabling HexPlanet GameObject (recently bought (https://assetstore.unity.com/packag...net-pro-spherically-tiled-world-builder-65466)). It has 2.8K triangles total spread over 162 child GameObjects and accounts for 640 batches and 5 SetPass calls. Not sure if this should be enough to "Occupy the GPU for too long."
    Those meshes mentioned above have mesh assets generated through script. Changing the mesh assigned to all the mesh filters to any mesh asset located in the project stops the error from occurring.
     
    Last edited: Dec 8, 2020
  19. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    207
    Since this problem started, our builds have begun to "hang" randomly. Similar random frequency than the error in editor play mode. Anyone else?
     
  20. jolix

    jolix

    Joined:
    May 22, 2016
    Posts:
    70
    I'm having the random swapchain crashes since Unity 2020 two to five times a day. Very frustrating.
    It happens randomly when changing code and then starting the game.
    But once it started, it doesn't crash for the current playsession.
     
  21. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    207
    If only some Unity support representative showed up in this thread... it's obvious there's an issue that isn't our fault.
     
    jolix and chadfranklin47 like this.
  22. whamer100

    whamer100

    Joined:
    May 27, 2019
    Posts:
    1
    i just got a 3060 ti and updated my drivers, and suddenly i cant even load unity, even on a blank project! Am using 2020.1.15f1
     
    jolix and chadfranklin47 like this.
  23. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    Any update on this? About to swap my 2070S for a 3080. That would not be good at all.
     
    Propagant likes this.
  24. alexanderlarsen

    alexanderlarsen

    Joined:
    Feb 26, 2015
    Posts:
    13
    I have the issue as well in 2020.1.16. TdrDelay and firewall exceptions doesn't work here either!
     
  25. apostro

    apostro

    Joined:
    Dec 5, 2012
    Posts:
    12
    If this might help someone; Had the same issue, constant crashes in Unity 2020.2.1f1, with silly small scenes in a fresh install. Managed to fix it (toi toi) by uninstalling the Nvidia Geforce Experience that came with my 3070. No crashes since.
     
  26. Blenderik

    Blenderik

    Joined:
    May 14, 2013
    Posts:
    146
    I just deleted the library, fixed the problem for me
     
    yinonezra likes this.
  27. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    The library folder in the project?
     
  28. Blenderik

    Blenderik

    Joined:
    May 14, 2013
    Posts:
    146
    Yes.
    It's a go-to fix. So very often (especially after upgrade) it fixes stuff like: Missing Monobehaviour, Messed up UI etc.
     
  29. TheXKing360

    TheXKing360

    Joined:
    Jan 27, 2021
    Posts:
    7
    please I need help
     
    Propagant and Amir_HKIRI like this.
  30. marlon_1_23

    marlon_1_23

    Joined:
    Mar 31, 2016
    Posts:
    1
    HI guys,
    I was getting this same message. Actually, even prior to getting that message, my unity would crash and I would have to restart UNity. FOUND THE SOLUTION TO BOTH ISSUES:
    I have an NVIDIA GETFORCE GTX 960...so I uploaded the most current drivers from nvidias driver site and now everything works - no more f'king crashes ! So, i have to thank some of you guys who had made the suggestion of updating to the most current graphic drivers.
     
  31. FrostedCookies

    FrostedCookies

    Joined:
    Mar 11, 2021
    Posts:
    1
    Had this problem with 2020.2.7f1 release (was not happening with the 2019 LTS version)
    I was using NVidia 460.89 drivers with the 2020.1, updated to current 461.72 (as of this day) and it seemed to stop
    (NVidia GTX 1660 Ti, intel i5-4570S)
     
  32. petesnoopz

    petesnoopz

    Joined:
    Aug 21, 2019
    Posts:
    4
    Hey has anyone figured this out for sure? I am having this issue now as well...
     
  33. petesnoopz

    petesnoopz

    Joined:
    Aug 21, 2019
    Posts:
    4
    I've tried making a whole new project in New LTS 2020 and 2019 and am still having this same crash with nothing even in my project.
     
  34. petesnoopz

    petesnoopz

    Joined:
    Aug 21, 2019
    Posts:
    4
    And I've also tried ever solution currently listed on this page.
     
  35. AnthonyJackson81

    AnthonyJackson81

    Joined:
    May 30, 2019
    Posts:
    32
    its mid march and this is still happening. I cant continue with this. I was really close to replacing my Graphics card, as everything else works.... but I cant afford that. Ive started to consider that Unreal is a more stable product and platform to developer for clients, with slower releases, but they are tested. Im tired of us being the test bed for new Versions. 2019 worked really well, now.... well it doesnt.
     
    Samos99 likes this.
  36. Soner-Sen

    Soner-Sen

    Unity Technologies

    Joined:
    Oct 13, 2016
    Posts:
    19
    the catch here is any GPU hang/crash would end up with the same error message in unity, as well as any driver issues would end up there too. unfortunately we dont have ability to catch the gpu hang/crash before present.

    Sometimes having a very complex mesh / compute shader etc may trigger windows GPU hang detection. Deleting library (especially if upgraded the unity versions) is another way to remove the corrupted mesh/shader data. and Updating to the latest drivers as the underlying issue may have been fixed.

    I could not find a bug filed with this problem. if you have a project or a repro case and file a bug for it, we will investigate it.
    thanks
     
    ZenUnity and Joe-Censored like this.
  37. dpcactus

    dpcactus

    Joined:
    Jan 13, 2020
    Posts:
    53
    Had the same issue for quite a while and was able to resolve it by deactivating the SVT mode in my UEFI. At first I had the Nvidia driver in mind as a culprit, but doing all the things mentioned here in the thread did not resolve the issue.
    For about 7 days now, I never had that issue again after disabling cpu svt (virtualisation). (Ryzen5 5600, Gigabyte B550)

    Maybe it helps others.
     
    Syn0_ and atomicjoe like this.
  38. Arycama

    Arycama

    Joined:
    May 25, 2014
    Posts:
    185
    This issue has only started to pop up with Unity 2020, so it is clearly due to something Unity changed, not GPU drivers or submitting excessive workloads to the GPU. I even have it occur during shader compilation at times.

    Unity seem to be putting all the blame on the user/OS/GPU/Drivers, when it's clearly only an issue that has started to pop up after upgrading -Unity-.

    I've had this occur with very simple compute shader workloads that complete in under 1ms, there's no way they could possibly be triggering the TDR. (They also only started becoming an issue when I upgraded)

    Examples of the problem only appearing since Unity 2020:

    Unity 2020:
    https://answers.unity.com/questions...1-swapchain.html?page=2&pageSize=5&sort=votes

    Unity 2020:
    https://answers.unity.com/questions/1771258/failed-to-present-d3d11-swapchain-due-to-device-re.html

    "Unity 2020"
    https://forum.unity.com/threads/rep...fferent-errors-i-cant-report-any-bugs.954333/
     
    nasos_333, Ducaticoder and Propagant like this.
  39. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,463
    Because Unity does 3 parallel releases without testing even the extreme basics of any of them

    This is really getting out of hand, why cant they focus on making just one version that works
     
    Arycama likes this.
  40. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,463
    Indeed, appeared to me just after port to 2021
     
  41. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,463
    But this did not happen prior to 2020 unity, so is something that was changed between versions

    BTW, i try to use a project i have in an Intel NUC with Iris 655 GPU and just cant, i used 2018 latest version and had a severe issue where the interface would just get stuck and mouse not press half the items in the unity screens, only the top menu is pressable, so have to kill Unity.

    Then tried 2019 latest and had it crash 4 times during initial conversion without any reason.

    Then 2021 which did convert and has this DX11 issue, note that 2018 was the only one that did work fine, until it got bugged in GUI few minutes after operation.

    At first i was frustrated, now i just have a nervous laughter at this experience.

    I did check and have the latest GPU drivers too.
     
    Last edited: Apr 6, 2021
  42. ahmedaniss

    ahmedaniss

    Joined:
    Sep 18, 2019
    Posts:
    98
    problem fixed here :
     
  43. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,463
    That is great to know it works that way, though should be fixed so can use both cards as is the normal operation, hopefully in next versions will be handled properly as well, this is a great way to keep working though, will check asap
     
  44. Miaunica

    Miaunica

    Joined:
    May 7, 2021
    Posts:
    1
    I keep getting this error everytime i boot up a project.
    I have ONLY the unity window opened
    And replacing,uninstalling and updating the graphic cards isn't an option
     
  45. madeofdinosaurs

    madeofdinosaurs

    Joined:
    Dec 1, 2015
    Posts:
    5
    I've been having this issue when my game scene gets a little busy (2020.2).
    I 'seem' to have fixed this (the game now gets past the point it would previously crash - but more testing is needed to be 100% sure) by turning off the Resolution & Presentation setting: 'Use DXGI Flip Mode Swapchain for D3D11'

    Hope that helps someone out there!
     
    honor0102, aquilis007 and nasos_333 like this.
  46. Rex338

    Rex338

    Joined:
    Apr 12, 2021
    Posts:
    1
    The only thing that worked for me was a system restore point I luckily had the day before the accident.
    I was working with 2019.4.25f1 DX11 version at the time.
    I have switched to UV Charts option which I believe caused it to crash due to having a lot of objects and light sources in the scene.

    Some of the solutions I tried:
    Disabling one graphic card worked but not optimal.
    I tried deleting the library folder but didn't work.
    I updated the drive but didn't seem to do anything at all.

    I was going to try using a driver uninstaller to completely remove the drive and update it again if the system restore point didn't work as I have seen a similar issue solved like this, so if nothing works might try this one out.

    I didn't try turning off the resolution & presentation setting, that might have worked too.
     
  47. comical23

    comical23

    Joined:
    Feb 20, 2018
    Posts:
    1
    I tried a number of options including updating graphics card drivers and changing TdrDelay value.

    One thing that worked for me is:
    In the list of Projects shown in Unity Hub, press on the 3 dots at the right of the project name
    Press 'Advanced Project Settings', an empty text area should appear.
    Type: -force-d3d12
    Press Done and open the Project

    It started working for me but at the bottom of the editor, it constantly shows
    'd3d12: Profiler is enabled, but stable power state is not. GPU timing errors are expected.'

    I shall update here if I face any further issues.
     
  48. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I haven't found a solution for this yet. Lately, it's been happening when I have Photoshop open at the same time with large files loaded (2GB+).
     
    Amir_HKIRI likes this.
  49. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,717
    Can you guys post computer specs on which you are running into these issues? Are these desktop machines? Laptops? Tablets?
     
  50. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Windows 10 desktop
    RTX 2060 6GB VRAM
    4K monitor
     
    YagirX likes this.