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.

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

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

  1. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    188
    Same happening constantly for me on 2021.3.9
     
  2. Valorware

    Valorware

    Joined:
    Aug 25, 2016
    Posts:
    87
    Do you use PostProcessing? does disabling Post Processing entirely help at all?
     
  3. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    I get this a lot from users of my assets now, Unity should declare all latest versions as experimental, as bugs like this should not have got through any Beta stage. This bug is known for years now and still there, and still Unity new releases are happening before this is fixed, which is unacceptable.

    It is either working or not, please focus on fixing the huge bugs in new Unity versions, no-one need new features and new Unity versions if Unity does not work.
     
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170






    Hi all,

    I recently got the swapchain issue on the HDRP version of my new LUMINA HDRP asset in Windows with DX11 and Nvidia 20xx and 30xx series.

    While it is defiantly a bug and the cards not working properly from Nvidia - Driver side, seems DX12 solves the issues (at least with LUMINA HDRP that i tested) which at least is a solution (and DX12 is the future anyway)

    Also Vulkan seems to work fine as well (tested in Linux, images above for reference), so leaving those here as two possible workaround on the issue.
     
  5. bharatbhandari

    bharatbhandari

    Joined:
    Sep 25, 2022
    Posts:
    1
    Hello tautvydas, iam also facing same issue .
    my pc spec :System Model: Inspiron 5400 AIO
    BIOS: 1.14.0 (type: UEFI)
    Processor: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 CPUs), ~2.4GHz
    Memory: 16384MB RAM
    Card name: NVIDIA GeForce MX330
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    Hi, does turning on DX12 or Vulkan solve it ?

    I think the new GPUs in 20xx series and above were made with DX12 in mind, that could explain how can have such a huge bug in DX11.
     
  7. bilalq

    bilalq

    Joined:
    Oct 13, 2022
    Posts:
    1




    This error comes due high load of graphics in the project.
    step1: open your project in unity
    step2:click "Edit" and then click "Project Settings"
    step3:click"Quality"
    step4:Then change levels to "low" then save it
    step5:Exit from unity
    step6:Restart your pc

    watch this youtube vedio till end and cant see this error
    click on link
    https:/
     
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    The issue is related to some change in Unity 2021 (maybe 2020 also), it never happened in Unity 2019 at any load or configuration.

    I just wish Unity could look into that, because is pity to create such a crazy instability to the system for nothing. It is great insecurity to know a above average load can crash Unity, is just not viable at this point and should be handled or regress to Unity 2019 backend and work up from there.
     
  9. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,685
    For me it started happening after updating the GPU driver. It happens on all Unity versions including 2019 and 2018, but also on other applications, not only with Unity. I tried everything suggested so far and nothing helped, until I changed in Windows 11 settings the preferred GPU from the high performance G-Force GPU to the on-CPU Intel low-performance GPU, for all Unity versions and for all other applications crashing the GPU driver.

    This isn’t ideal, I know, but it keeps this laptop working for now, and it also saves battery power.
     
  10. AFlamel

    AFlamel

    Joined:
    May 20, 2021
    Posts:
    15
    Yeah, been having this after updating to the latest Unity a few months ago. I've powered through it but it has definitely hurt my development time.

    I'm not going to pretend to be crazy about PC specs or that my PC is crazy amazing but I do have 16 gigs of of video memory and 64 gigs of ram. I'm crashing due to this with nearly nothing in the scene. My work around has been to hide the editor and the play screen when I'm developing them save before looking at the scene.

    Unity's main point is the real time editing of stuff I thought, but I'm basically spending 5 hours in development then 6 minutes over a 1 hour effort of constant crashing testing what I've worked on.

    I work on several projects at once some with basically nothing in them and I'll still get this. I've tried the fixes from folks about turning off the native driver but it just feels crazy at this point. XD Sorry for the rant but it just crashed on me again and I lost about 5 minutes of work. Those 5 minutes are adding up.
     
  11. AndreasAustPMX

    AndreasAustPMX

    Joined:
    Mar 2, 2014
    Posts:
    9
    In Unity HUB you can run some command lines for the specific Project, this lines worked for me:
    -force-d3d12, ‑ignorecompilererrors
     
  12. AFlamel

    AFlamel

    Joined:
    May 20, 2021
    Posts:
    15
    Thanks, I caught it at the moment of crashing:
    upload_2022-10-17_12-53-18.png

    The GPU spikes despite the GPU's memory usage never even reaching 2gigs. Shared usage got to about 2.5 gigs.

    CPU usage got to around 30% during the spike and memory usage wasn't even worth mentioning. Oddly my wifi spiked at around the same time.
     
  13. Splatypus

    Splatypus

    Joined:
    Jul 20, 2013
    Posts:
    4
    Windows 10 and 11 desktop (issue occurred before and after upgrade to windows 11)
    intel i9-10900 CPU
    64GB ram
    Intel r UHD 630 GPU
    1440p 144hz monitor
    Unity 2021.3.11f1
    Running a very lightweight 2d game, only about 6 sprites in the test scene which seems to always be running fine at 144 fps. Issue occurs approximately every hour. It feels like it happens more often while unity isn't the focused window, but that could just be because I spend most of my time coding.
     
  14. AABID965

    AABID965

    Joined:
    Sep 30, 2022
    Posts:
    5
    Have any body found the solution :/
     
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    Using DX12 solves it for me, or Vulkan

    Seems DX11 is no longer supported by NVIDIA for its latest cards at all and make sense since DX12 is around
     
  16. DangerIncreased

    DangerIncreased

    Joined:
    Jun 15, 2021
    Posts:
    11
    Gtx 1050 ti Ryzen 3500x 16 gigs
     
  17. DangerIncreased

    DangerIncreased

    Joined:
    Jun 15, 2021
    Posts:
    11
    No :"
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    Hi, does the DX12 or Vulkan modes resolve the issue ?
     
  19. DangerIncreased

    DangerIncreased

    Joined:
    Jun 15, 2021
    Posts:
    11
    I was using Directx 11 and even when I switched to directx12 it still occured, I just left the unity engine altogether, now im learning unreal
    Edit : I do see directX12 text at top of my unity
     
    nasos_333 likes this.
  20. DangerIncreased

    DangerIncreased

    Joined:
    Jun 15, 2021
    Posts:
    11
  21. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    Is there any official answer on the massive swapchain issue ?

    Unity is renderered unusable if we cant tell whether the created game will randomly crash on random user specs, with a 100% probability.
     
  22. nasos_333

    nasos_333

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

    It happens in my latest LUMINA GI HDRP asset, in DX11, in any nvidia in 20xx or 30xx series, in unity 2021.3 Lts

    Does not happen in dx12 or nvidia 1050gtx with unity 2021.3.6 where i develop it or in unity 2019.

    I had many reports on this, so should be repeatable i suppose with similar specs.

    So hopefully should be easy to recreate the bug.
     
    Last edited: Nov 4, 2022
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,151
    Can you file a bug report on that?
     
    nasos_333 likes this.
  24. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170

    Lumina hdrp running on 1050gtx

    I cant, because the issue does not happen on my 1050gtx gpu, all work fine there. I only got reports from multiple users that crashes with swapchain error with the newer gpus

    So you can download my asset LUMINA GI HDRP and test in any nvidia 20xx or 30xx gpu in dx11, should be able to recreate by open some of the demo scenes in unity 2021.3 lts

    Note that my systems runs in 30 fps in the 1050gtx laptop, so the shaders do not stall the GPU in general and would expect 20xx and 30xx series to have even less burdain on the gpu than cause this issue.

    That is why looks like a bug, just cant tell if is on unity or nvidia driver for dx11 side, or combination of both.

    I attach a video of the asset running in the 1050gtx above, for reference.
     
    Last edited: Nov 4, 2022
  25. AFlamel

    AFlamel

    Joined:
    May 20, 2021
    Posts:
    15
    Yeah, I'm trying really hard to work through it, but its so bad. Nothing seems to work, is there a way to put unity on DX12 if it isn't already using it.

    upload_2022-11-8_13-55-47.png
    upload_2022-11-8_14-0-12.png
    So my unity is using DX11 is there a way to change it to 12, the only video I see on it is from 6 years ago.
     
  26. AFlamel

    AFlamel

    Joined:
    May 20, 2021
    Posts:
    15
    Okay I figured it out, in command prompt I used two lines to get Unity to be on DX12.

    -allow-d3d12
    -force-d3d12

    Now I got the error while in dx 12 but I can see more information, according to the crash dump Unity attempted to get to something it didn't have the access rights to. So at least now I don't feel powerless X_X.

    --
    With all of that done, I found I could develop in a more stable environment if I run Unity as a window and not maximized.

    I've been running it for around 2 hours now in the editor without any crashing.
     
    Last edited: Nov 10, 2022
  27. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    I got the issue in Unity 2021.3 again today, in a project that worked fine in Unity 2019

    It is some bug for sure, related to how new Unity handle things. Of course i understand that Unity get worse and worse in time, 2021 is exponentially worse than 2019 and 2019 was so much slower than 2018 etc

    I just wish they took a step back, stop any and i mean ANY development further and go back to 2021.3 and fix that version, so we can work, then can do anything else.
     
  28. AFlamel

    AFlamel

    Joined:
    May 20, 2021
    Posts:
    15
    I'll post here also, the solution I found for this is to have Unity running in a non-maximized window.

    This has reduced occurrences of this crash to 2 times in a week instead of 6 times in an hour. It has something to do with Unity redrawing the editor, I am assuming it has to do with my PC's resolution vs whatever Unity is doing.

    Regardless it appears that Unity has an easier time making that call when not maximized window, this is despite the window only being marginally smaller than maximized.
     
  29. NoobCoderFake

    NoobCoderFake

    Joined:
    Nov 24, 2015
    Posts:
    36
    I reproduce this bug by this way:
    Open two unity editor instance;
    A large Hexagon tilemap with about 200x200 tiles in each editor, this prefab was attached below;
    create a prefab of this tilemap;
    reopen one editor and select this prefab asset in project window, there should be a preview in Inspector window, instead the editor crushed with "Unity InspectorWindow.Repaint Failed to present D3D11 swapchain due to ..."

    Unity version: 2020.3.33f1c1
    System: Windows 10 pro... (18363)
    DirectX: DirectX 12
    CPU: i5-12600K
    GPU: Intel UHD 770
    RAM: 32G
     

    Attached Files:

    Valorware and AFlamel like this.
  30. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    102
    I was having the same issue from yesterday after I started working on the VFX Graph
    My GPU instantly hits 100% if I am in the game view (Editor) and as VFX is running
    thus increasing the temps and Crash
    GPU drops to 4% as soon as I stop the VFX effect
     
  31. piginaust

    piginaust

    Joined:
    May 23, 2022
    Posts:
    14
    I had the same issue with unity 2022.2.0b16....

    It crashed a few times every hour.

    After testing, I realised the issue was due to multi-canvas in the scene. Although only one UI in one canvas was shown, and the other UIs in the same canvas and in other canvas are not active, the crash still arose.

    If i moved all UI into one canvas, the issue is gone. So, I am sure the issue is due to too many canvas running (althoug the UI within the canvas is not active).

    If you have the same issue and you have multiple canvas, you may want to test out......

    Note: I was too lazy to test if the crash could be gone if I disabled the canvas instead of the UI.
     
  32. desenholdb

    desenholdb

    Joined:
    Oct 4, 2012
    Posts:
    11
    Having this issue... Over and over on a 3070ti.
    latest drivers... unity2022
     
    nasos_333 likes this.
  33. Approximatte

    Approximatte

    Joined:
    Sep 11, 2022
    Posts:
    1
    This happens to me every single time I drag the line between my scene and game. Also, those windows are just black until my mouse enters.

    3060ti with latest drivers and dx12, Unity 2021.3.6. This is horrible and has completely prevented me from forward progress
    upload_2022-12-16_20-54-40.png
     
  34. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    102
    Hello,
    Can you confirm that in unity 2022.2.1f1 if the black screen in 1080p has high GPU usage or not?
     
  35. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    This issue is a Unity bug, did not and does not happen in Unity 2019, so is something introduced in 2020 and above.

    Since this is a showstopper, Unity should just stop any further work until is regressed back to 2019 state where this never happened.

    Trying to pretend this major show stopping issue does not exist wont lead anywhere.
     
  36. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    Hi, is there any update on this extremely critical issue ?
     
  37. theropodx

    theropodx

    Joined:
    May 1, 2011
    Posts:
    40
    Wow, yeah this is a pain. I swear these instability issues and unity license fees going up and up is pushing me to unreal. Just gotta finish my current project and then see you later. Really sad.
     
  38. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    I just wish yhey reverted back to unity 2019 editor, none of the issues was there, plus was exponentially faster.
     
  39. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
  40. unity_A9503295465D353CD4F7

    unity_A9503295465D353CD4F7

    Joined:
    Feb 15, 2021
    Posts:
    4
    Briefly speaking. guys, the whole point of the d3d11 error is that it is deleted in unity/your version of unity/editor/data/tools/UnityShaderCompiler.exe.
    When installing the unity editor, copy UnityPackageManager.exe, UnityShaderCompiler.exe and d3dCompiler_47.dll just in case.
    The garbage with tdrdelay does not work.
    Only reinstallation and further recovery of these files helps. Yes, and permission in the brandmauer is only a small step in solving the problem.
    I suffer with this garbage all the time. Submitting a bug report did nothing, Unity is unable to help.
    I hope someone could help, this method helps me.
     
  41. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    The thing is that it breaks only in some projects, when there is heavy load. If a file was missing would break every project is my guess.

    The above could of course be one cause of the issue, but is not for every case i suppose.

    Actually nothing works in the other cases i have seen because is a Unity bug, and they have to fix it.

    Given this issue does not happen in Unity 2019 or NVIDIA 1050GTX which are both perfectly stable at all times, means that is some major bug introduced in some of the new Unity or GPU drivers or both in combination.

    The biggest problem with this bug is that every thing may seem to be working fine on the developer's end and break in users of the game at random, without any way to know it. We just need stable graphics in Unity, like in older Unity versions.

    If cant solve this, better go back to Unity 2019 core and work from there again, as this bug is a game breaker.

    The reason why the tdrdelay trick does not work, is because this is not an actual GPU stall or problem, is a pure bug. There is nothing in my LUMINA HDPR system that delays the GPU for seconds as it runs 30fps in a 1050GTX GPU, so obviously is not an issue of regulating the GPU delay, but fixing the bug that breaks the GPU.

    Given that Unity in latest versions has massive delay issues in editor, could just be some editor routine that is used in new ways and breaks the GPU given a bigger GPU load etc

    This is certainly not a trivial issue to solve, so requires some regression and stop making new Unity versions before fix it, as it only adds complexity making it less possible to fix.

    If this goes unfixed i see Unity stop be used by anyone, as is not reliable to make something that may not work in 90% of PCs out there at random.

    This is hands down a life and death situation for Unity imo if goes unhandled.
     
    Last edited: Jan 8, 2023
  42. unity_A9503295465D353CD4F7

    unity_A9503295465D353CD4F7

    Joined:
    Feb 15, 2021
    Posts:
    4
    So I'm saying that this is a Unity error, and not window or viruses or something else on the user's side. since I ran both my heavy project and an absolutely empty project, the error is the same. By the way, I will try to switch to 2019, as you advise, because there really were no errors. But this method has the right to live. not mentioned anywhere and works flawlessly.
    My system, just in case:
    asus gl702vsk
    win11x64
    i7-7700hq
    gtx1070 8gb
    32GB RAM
    ssd256 3400mb/s
    Unity 2020.3.43f1/2021.3.16f1
     
    nasos_333 likes this.
  43. Lughinu

    Lughinu

    Joined:
    Nov 3, 2016
    Posts:
    11
    same here, a little old notebook
    Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 2.80 GHz
    16GB RAM
    Invidia Quadro 1200
    Unity 2021.3.14
     
  44. Valorware

    Valorware

    Joined:
    Aug 25, 2016
    Posts:
    87
    Completely agree with this. I was demo'ing my game at an event on a SteamDeck and it crashed from this error, and was the first time I saw this happen. It kept happening and obviously was extremely detrimental to the event and demo, leaving some bad impressions. My particular variation of the problem was solved by removing AO from Post Processing (was using built-in render pipeline) and since then i've not had it occur on any hardware.

    My game wasn't even that intensive.

    This is definitely a bug and I really hope it gets attention brought to it and hopefully fixed - I hate to think about the crashing on release for certain games.
     
    nasos_333 likes this.
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    I have already sent a bug report about it to Unity as well, hopefully they can recreate and try fix it asap
     
  46. lrg_mark

    lrg_mark

    Joined:
    Mar 16, 2015
    Posts:
    4
    We started seeing this issue after updating nvidia drivers to 528.02. We were also seeing regular crashes in builds with the error: "Device removed reason (887a0006)."

    Rolling back to 527.56 drivers seems to have resolved both issues. The issues were consistently seen on 5 devices with different Nvidia models all using 528.02 drivers. Rolling back the drivers fixed both issues on all devices as well.

    Is there anyone at Unity that can elevate this issue with Nvidia directly?
     
    nasos_333 likes this.
  47. DannyBoyOnline

    DannyBoyOnline

    Joined:
    Jul 1, 2017
    Posts:
    4
    I am also getting this error for a project upgraded from 2019 to 2022.2.1f1.
    Never happened ever with my 2019.3 or 2020.3 projects - only now for the "upgraded" one.

    Have not changed the hardware or drivers.
    I made a copy of the project before upgrading and it still works fine. So the hardware, drivers and OS environment are identical which indicates that the version of Unity is the culprit.
     
    nasos_333 likes this.
  48. nasos_333

    nasos_333

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

    Is there any update on the swapchain issue ?

    I had also sent a ticket below on this

    "New Incident created: IN-27763 - Crash of editor and build when using DX11 in Unity 2021.3.f1 and above in Nvidia 2060GTX or above, with Swapchain bug."

    Other threads on the issue
    https://forum.unity.com/threads/con...-to-device-removed.987834/page-4#post-8714637

    Thanks
     
  49. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,151
    I just pinged QA and asked them to prioritize them looking into it.
     
    Valorware and nasos_333 like this.
  50. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,170
    That is great, thanks