Giter Site home page Giter Site logo

Bug: DX3D12 crash in Debug mode about bgfx HOT 7 CLOSED

etodanik avatar etodanik commented on May 28, 2024
Bug: DX3D12 crash in Debug mode

from bgfx.

Comments (7)

etodanik avatar etodanik commented on May 28, 2024 1

There is bug in those validation layers. So you can disable validation and it will work.

I see. Yeah, I can see that this change here makes D3D12 in debug mode completely crash:

// debug1->SetEnableGPUBasedValidation(true);

debug1->SetEnableSynchronizedCommandQueueValidation(false); seems to be the culprit. If I revert that change and just have debug1->SetEnableGPUBasedValidation(true) on, everything works great & debug doesn't have to be off.

It seems that this fix broke D3D12 completely in debug mode.

from bgfx.

kingscallop avatar kingscallop commented on May 28, 2024 1

Hi!

Hey @kingscallop do you know how to find text of this bug number? It seems their Discord channel is gone.
(436b7fa?diff=unified#r127893892)

The discord server can be reached here: discord.gg/directx

I went there and asked about the status of the bug '26131261' here is the reply:

Adam Miles
Jesse pointed me to the archive. The bug was fixed in July 2020, so, long since fixed in both Windows and Agility SDKs.

Jesse Natalie
I expect a fix date around then would mean fixed in Win11, but not Win10
Unless using the Agility SDK of course

From their reply it seems the bug has been fixed, so these lines can be reverted from:

//				debug1->SetEnableGPUBasedValidation(true);

				// https://discordapp.com/channels/590611987420020747/593519198995742733/703642988345032804
				// D3D12 Bug Number: 26131261
				// There is a bug in the D3D12 validation that causes example-21 to fail when using UAV
				// Setting this function below to false avoids the bug
				debug1->SetEnableSynchronizedCommandQueueValidation(false);

to:

//				debug1->SetEnableGPUBasedValidation(true);
//				debug1->SetEnableSynchronizedCommandQueueValidation(true);

from bgfx.

bkaradzic avatar bkaradzic commented on May 28, 2024

This issue is related to #3059 which for some reason was erroneously disregarded as not a bug and moved to discussions as a question. This is most certainly, however, a bug.

Provide full stack.

from bgfx.

etodanik avatar etodanik commented on May 28, 2024
 	ucrtbase.dll!abort()	Unknown
 	ucrtbase.dll!terminate()	Unknown
 	ucrtbase.dll!FindHandler<__FrameHandler3>()	Unknown
 	ucrtbase.dll!__InternalCxxFrameHandler<class __FrameHandler3>(struct EHExceptionRecord *,unsigned __int64 *,struct _CONTEXT *,struct _xDISPATCHER_CONTEXT *,struct _s_FuncInfo const *,int,unsigned __int64 *,unsigned char)	Unknown
 	ucrtbase.dll!__CxxFrameHandler3()	Unknown
 	ntdll.dll!RtlpExecuteHandlerForException()	Unknown
 	ntdll.dll!RtlDispatchException()	Unknown
 	ntdll.dll!KiUserExceptionDispatch()	Unknown
 	KernelBase.dll!RaiseException()	Unknown
 	ucrtbase.dll!_CxxThrowException()	Unknown
 	d3d12SDKLayers.dll!std::_Throw_bad_optional_access(void)	Unknown
 	d3d12SDKLayers.dll!NDebug::CCommandQueue::ValidateResourceStateBarriers(class NDebug::CInterfaceSentinel::CFunctionSentinel &,class NDebug::CCastableCommandList<struct ID3D12CommandList> *,class NDebug::CCastableCommandList<struct ID3D12CommandList> *)	Unknown
 	d3d12SDKLayers.dll!NDebug::CCommandQueue::ExecuteCommandListsImpl(class NDebug::CInterfaceSentinel::CFunctionSentinel &,unsigned int,struct ID3D12CommandList * const *,class NDebug::CCastableCommandList<struct ID3D12CommandList> * const *)	Unknown
 	d3d12SDKLayers.dll!NDebug::CCommandQueue::ExecuteCommandLists(unsigned int,struct ID3D12CommandList * const *)	Unknown
>	example-00-helloworldDebug.exe!bgfx::d3d12::CommandQueueD3D12::kick() Line 4043	C++
 	example-00-helloworldDebug.exe!bgfx::d3d12::RendererContextD3D12::submit(bgfx::Frame * _render, bgfx::ClearQuad & __formal, bgfx::TextVideoMemBlitter & _textVideoMemBlitter) Line 6498	C++
 	example-00-helloworldDebug.exe!bgfx::Context::renderFrame(int _msecs) Line 2471	C++
 	example-00-helloworldDebug.exe!bgfx::renderFrame(int _msecs) Line 1491	C++
 	example-00-helloworldDebug.exe!entry::Context::run(int _argc, const char * const * _argv) Line 523	C++
 	example-00-helloworldDebug.exe!main(int _argc, const char * const * _argv) Line 1192	C++
 	example-00-helloworldDebug.exe!invoke_main() Line 79	C++
 	example-00-helloworldDebug.exe!__scrt_common_main_seh() Line 288	C++
 	example-00-helloworldDebug.exe!__scrt_common_main() Line 331	C++
 	example-00-helloworldDebug.exe!mainCRTStartup(void * __formal) Line 17	C++
 	kernel32.dll!BaseThreadInitThunk()	Unknown
 	ntdll.dll!RtlUserThreadStart()	Unknown


image

EDIT:
If it's helpful, I'm also attaching my DXDiag output
DxDiag.txt

EDIT 2:
The same project builds and runs absolutely fine on D3D12 on Release configuration:
image

from bgfx.

bkaradzic avatar bkaradzic commented on May 28, 2024

There is bug in those validation layers. So you can disable validation and it will work.

Here:

 	KernelBase.dll!RaiseException()	Unknown
 	ucrtbase.dll!_CxxThrowException()	Unknown
 	d3d12SDKLayers.dll!std::_Throw_bad_optional_access(void)	Unknown
>>>> 	d3d12SDKLayers.dll!NDebug::CCommandQueue::ValidateResourceStateBarriers(class NDebug::CInterfaceSentinel::CFunctionSentinel &,class NDebug::CCastableCommandList<struct ID3D12CommandList> *,class NDebug::CCastableCommandList<struct ID3D12CommandList> *)	Unknown
 	d3d12SDKLayers.dll!NDebug::CCommandQueue::ExecuteCommandListsImpl(class NDebug::CInterfaceSentinel::CFunctionSentinel &,unsigned int,struct ID3D12CommandList * const *,class NDebug::CCastableCommandList<struct ID3D12CommandList> * const *)	Unknown
 	d3d12SDKLayers.dll!NDebug::CCommandQueue::ExecuteCommandLists(unsigned int,struct ID3D12CommandList * const *)	Unknown

from bgfx.

bkaradzic avatar bkaradzic commented on May 28, 2024

It seems that this fix broke D3D12 completely in debug mode.

That fix was introduced 3 years ago. Don't assume that things are static... And bug is inside D3D12, not bgfx, this was work around another issue.

436b7fa#diff-001017d02e7808ecc953fdb7b17a87e856a26ba6a3b153dd10dcfee90b60f011

from bgfx.

etodanik avatar etodanik commented on May 28, 2024

Ah, yes. Not making any assumptions. Just observing that rolling back the fix makes Debug work fine.

from bgfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.