Jump to content

D3D11 SwapChain Error Fix


SevenLZ
Go to solution Solved by SevenLZ,

Recommended Posts

  • Solution

Copied from Discord:

"Hello, everyone. I am a Gaia Pro customer working on a newly built computer (Ryzen 5600X 6 core @3.9ghz, 128gb ddr4, 1tb M.2, Radeon RX 6700XT 12gb). I am receiving an error about a D3D11 swapchain when I try to follow the tutorial. I have tried using the very newest version of Unity, and I have also tried the LTS version 2020.3.25f1. I have poked around online, and it seems like this is a pretty common error that is thrown in a lot of situations, but the only one I encounter it in is when using Gaia Pro, specifically when spawning the biome."

 

After posting this message in the discord, I continued to troubleshoot using the many fixes I found elsewhere online until I came on the one that worked, which I was later asked to document here for the benefit of the community. Here's what I learned today.

 

The fix: 

https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys

Either setting the TdrLevel registry key to 0, or creating it with a level of 0 stops this error if it is being thrown because Gaia Pro is sending heavy workloads to the GPU.

Please note, you may find some fixes online that reference the TdrDelay registry key. This did not have any effect on the issue I encountered.

 

The reason this works:

Since Windows 8, Microsoft developers have increasingly begun to tackle the problem of the operating system becoming unstable because of a crashed or infinitely looping program that is using resources on the GPU. In previous versions of Windows, the blocked GPU could not be used by the operating system when it wanted to render itself over the unresponsive program, resulting in those bad crashes you sometimes got when gaming that required you to hold the power button or flip the surge protector in order to get the computer running again. They decided to fix this by essentially resetting the graphics driver when it is detected that the underlying device has been unresponsive for too long. The default period of unresponsiveness is 2 seconds before Windows detects this fault and reacts, which is more than enough for an environment with primarily CPU-heavy tasks (like an office or a server room), but is not enough for some legitimate GPU-heavy tasks, like image editing, 3d modeling, and some generation tasks in packages like Gaia Pro. Gaia is capable of sending enough work to even a very fast modern GPU to occupy it for more than 2 seconds (large textures, complex shaders), even with the built-in pipeline selected. The TdrLevel registry key simply controls how Windows behaves regarding this condition, and the value of 0 simply means "don't even try to detect it anymore, just let the GPU go." While this could potentially expose your system to those hangs that result from real errors, it will definitely resolve the issue of Gaia crashing Unity because of a false positive in Windows' GPU responsiveness test.

 

The reason this doesn't seem to work for everybody, or for every manifestation of this problem:

Unity seems to throw an identical error at any time the graphics driver is reset in this way while it is running, no matter what was being done or what the cause was. The TDR behavior is not the only Windows behavior that can prompt a graphics driver reset, which can potentially be caused by the GPU being sent invalid instructions because it has old or incorrect drivers, or things like overheating, insufficient power or voltage from the PSU or wall, or other kinds of intermittent failure. The GPU may also be set up to do computational tasks, such as if it runs CUDA, or if there are compute shaders in the scene, and this can cause some unexpected behavior regarding the driver. There is also the possibility that there may be a cascading failure, such as a memory issue that causes the driver to require a reload. This could possibly be the case when running graphics card management services that need to be paged because the memory load is very high, or which have some management features which are designed to interact with TDR (such as some NVidia cards). Some people report resolving this error by doing even more esoteric things, like disabling a VPN, for instance, or copying over an older version of a specific DLL. Everyone seems to be at their wits end with it, everywhere I looked.

 

Hopefully this helps someone down the road, because it doesn't seem like anyone at Gaia or Unity has much power over it, and I have no idea if it's even on Microsoft's radar. Though maybe some people with a little more clout than I have could put it there if it becomes enough of a problem. Either way, thanks to everyone who supports Gaia, I'm loving it so far, now that I have gotten past this one.

Edited by SevenLZ
add dll reference
  • Like 3
Link to comment
Share on other sites

Thank you very much for taking the time for typing this down for the other users! I was personally not affected by this, but I was aware of the error message and the (potential) fix for this error, but did not know about this error in that depth of detail yet.

Link to comment
Share on other sites

I am having the same Gaia Error and Crash 

But I don't understand what to do to fix this issue 

I also got my Latest Graphic drives 

Please explain how to do this 

Thank you 

Error01.PNG

Link to comment
Share on other sites

I honestly don't know what the issue is with how the fix works. I quote from the solution: 

Quote

The fix: 

https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys

Either setting the TdrLevel registry key to 0, or creating it with a level of 0 stops this error if it is being thrown because Gaia Pro is sending heavy workloads to the GPU.

Please note, you may find some fixes online that reference the TdrDelay registry key. This did not have any effect on the issue I encountered.

  1. Click on the link
  2. Open the registry editor with administrative rights
  3. Go to the path they mention on the website
  4. Make a new entry with the details mentioned on the website
  5. Set the value to either 0 or 1, as described in the solution here
Link to comment
Share on other sites

  • Ben Black locked this topic
Guest
This topic is now closed to further replies.
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...