Giter Site home page Giter Site logo

Comments (23)

TCROC avatar TCROC commented on September 17, 2024 1

I get this same error. I bisected and found the problematic pr and commit hash:

PR: #91769
Commit hash: https://github.com/godotengine/godot/commits/f2796fa06daf0004a462d48a10ab98800c8ff72d

Edit:

To clarify, I get @akien-mga's error

from godot.

MBCX avatar MBCX commented on September 17, 2024

That's so interesting, running your command on my build works just fine, the project manager launches.

.\windows_editor_x86_64_console.exe --rendering-driver d3d12 --debug

Though as soon as I close the project manager it crashes

Godot Engine v4.3.beta.custom_build.4d229ce00 (2024-06-19 12:50:19 UTC) - https://godotengine.org
D3D12 12_0 - Forward+ - Using Device #0: AMD - Radeon RX 580 Series
WARNING: PSO caching is not implemented yet in the Direct3D 12 driver.
     at: pipeline_cache_create (drivers/d3d12/rendering_device_driver_d3d12.cpp:4947)

ERROR: 1 shaders of type HddagiFilterShaderRD were never freed
   at: ~ShaderRD (servers/rendering/renderer_rd/shader_rd.cpp:845)
ERROR: Pages in use exist at exit in PagedAllocator: 25VersatileResourceTemplateIJN26RenderingDeviceDriverD3D1210BufferInfoENS0_11TeE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)

================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta.custom_build (4d229ce00019661706e147ac02e9e405be0ff0ea)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] error(-1): no debug info in PE/COFF executable
[2] error(-1): no debug info in PE/COFF executable
[3] error(-1): no debug info in PE/COFF executable
[4] error(-1): no debug info in PE/COFF executable
[5] error(-1): no debug info in PE/COFF executable
[6] error(-1): no debug info in PE/COFF executable
[7] error(-1): no debug info in PE/COFF executable
[8] error(-1): no debug info in PE/COFF executable
[9] error(-1): no debug info in PE/COFF executable
[10] error(-1): no debug info in PE/COFF executable
[11] error(-1): no debug info in PE/COFF executable
[12] error(-1): no debug info in PE/COFF executable
[13] error(-1): no debug info in PE/COFF executable
-- END OF BACKTRACE --
================================================================

from godot.

clayjohn avatar clayjohn commented on September 17, 2024

CC @DarioSamo

@TCROC @MBCX Can both of you provide a bit more information, namely:

  1. Your OS details + GPU details
  2. Your build configuration (most importantly, whether you built with the Agility SDK)
  3. What version of the directX shader compiler you are using (the dxc_***.dll)

from godot.

DarioSamo avatar DarioSamo commented on September 17, 2024

Unable to reproduce.

The relevant code is this.

ComPtr<ID3D12Resource> buffer;
ComPtr<D3D12MA::Allocation> allocation;
HRESULT res;
if (barrier_capabilities.enhanced_barriers_supported) {
	res = allocator->CreateResource3(
			&allocation_desc,
			&resource_desc,
			D3D12_BARRIER_LAYOUT_UNDEFINED,
			nullptr,
			0,
			nullptr,
			allocation.GetAddressOf(),
			IID_PPV_ARGS(buffer.GetAddressOf()));
} else {
	res = allocator->CreateResource(
			&allocation_desc,
			reinterpret_cast<const D3D12_RESOURCE_DESC *>(&resource_desc),
			D3D12_RESOURCE_STATE_COMMON,
			nullptr,
			allocation.GetAddressOf(),
			IID_PPV_ARGS(buffer.GetAddressOf()));
}

ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), BufferID(), "Can't create buffer of size: " + itos(p_size) + ", error " + vformat("0x%08ux", (uint64_t)res) + ".");

So basically, it could be failing to create a resource altogether as it goes through CreateResource3 instead of the older API. This could very well be the result of the driver reporting enhanced barriers are supported but the actual function itself misbehaving (CreateResource3 will only work properly on a driver that supports them but is clearly not working as intended given the error code).

If anyone with the error could break-point into the code and see what enhanced barriers supported returns, we can confirm pretty quickly that is the case. I had this very same problem with NVIDIA until they fixed the issue in a driver update, but if it's not reliable enough then we may want to opt to just disable enhanced barriers until the support is more stable.

And also, please try compiling with the latest version of the Agility SDK to see if it behaves any differently (your project must also have the corresponding version that you compiled the engine with for this to work).

from godot.

TCROC avatar TCROC commented on September 17, 2024

CC @DarioSamo

@TCROC @MBCX Can both of you provide a bit more information, namely:

1. Your OS details + GPU details

2. Your build configuration (most importantly, whether you built with the Agility SDK)

3. What version of the directX shader compiler you are using (the dxc_***.dll)

Here is the system info:

Godot v4.3.beta.mono (5e9f547ee) - Windows 10.0.19045 - d3d12 (Forward+) - dedicated AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 31.0.12027.9001) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)

I'm building godot-nir-static from source on master branch here: https://github.com/godotengine/godot-nir-static

Hopefully that answers your question on dxc_***.dll. If not, how do I find that?

from godot.

MBCX avatar MBCX commented on September 17, 2024

@TCROC For dxc_, see this instruction

from godot.

TCROC avatar TCROC commented on September 17, 2024

@TCROC For dxc_, see this instruction

Yep that's how I'm building it from source. But how do I tell what version it is? All I know is I'm on the master branch-

Oh I see! Lol I had it in my build script this whole time. Anywho:

v1.8.2403.1

That is the dxc version. And this is the command I'm using to build godot-nir-static:

    let extra_args = match $nu.os-info.name {
        "windows" => [
            "ARCOM=${TEMPFILE('$AR rcs $TARGET $SOURCES','$ARCOMSTR')}",
            "--ignore-errors"
        ],
        _ => []
    }

    (run-external "scons" 
        "platform=windows" 
        "arch=x86_64" 
        "use_llvm=true"
        "platform_tools=false"
        "import_env_vars=ZIG_GLOBAL_CACHE_DIR,ZIG_LOCAL_CACHE_DIR"
        "use_mingw=true"
        ...$extra_args
        ...(main zig cxx scons-vars $zig_target))

Which is slightly different from a normal scons build command. I have a draft PR in to give more flexibility to the build command and allow specifying different compilers such as the zig one I am using.

Will updating dxc potentially fix this?

from godot.

DarioSamo avatar DarioSamo commented on September 17, 2024

Will updating dxc potentially fix this?

No, please refer to gathering the information I posted about on my comment if you can.

If anyone with the error could break-point into the code and see what enhanced barriers supported returns, we can confirm pretty quickly that is the case.

Finding out if barrier_capabilities.enhanced_barriers_supported is reported as true or false is very important here.

The two pieces that are more relevant here are your driver being up to date and whether you're using the Agility SDK or not (and the Agility SDK version has to match the setting in the project as well).

from godot.

TCROC avatar TCROC commented on September 17, 2024

Unable to reproduce.

The relevant code is this.

ComPtr<ID3D12Resource> buffer;
ComPtr<D3D12MA::Allocation> allocation;
HRESULT res;
if (barrier_capabilities.enhanced_barriers_supported) {
	res = allocator->CreateResource3(
			&allocation_desc,
			&resource_desc,
			D3D12_BARRIER_LAYOUT_UNDEFINED,
			nullptr,
			0,
			nullptr,
			allocation.GetAddressOf(),
			IID_PPV_ARGS(buffer.GetAddressOf()));
} else {
	res = allocator->CreateResource(
			&allocation_desc,
			reinterpret_cast<const D3D12_RESOURCE_DESC *>(&resource_desc),
			D3D12_RESOURCE_STATE_COMMON,
			nullptr,
			allocation.GetAddressOf(),
			IID_PPV_ARGS(buffer.GetAddressOf()));
}

ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), BufferID(), "Can't create buffer of size: " + itos(p_size) + ", error " + vformat("0x%08ux", (uint64_t)res) + ".");

So basically, it could be failing to create a resource altogether as it goes through CreateResource3 instead of the older API. This could very well be the result of the driver reporting enhanced barriers are supported but the actual function itself misbehaving (CreateResource3 will only work properly on a driver that supports them but is clearly not working as intended given the error code).

If anyone with the error could break-point into the code and see what enhanced barriers supported returns, we can confirm pretty quickly that is the case. I had this very same problem with NVIDIA until they fixed the issue in a driver update, but if it's not reliable enough then we may want to opt to just disable enhanced barriers until the support is more stable.

And also, please try compiling with the latest version of the Agility SDK to see if it behaves any differently (your project must also have the corresponding version that you compiled the engine with for this to work).

I just tested before heading up north for the weekend. On my AMD GPU and AMD CPU windows machine, enhanced_barriers_supported is false.

Up north I have an NVIDIA Windows machine that I can test this against. Hopefully this helps tho! I won't be able to get any more info on my AMD machine until Tuesday.

from godot.

DarioSamo avatar DarioSamo commented on September 17, 2024

I just tested before heading up north for the weekend. On my AMD GPU and CPU windows machine, enhanced_barriers_supported is false.

If that's really the case I'm not entirely sure why resource creation would fail when it's false. There's two other changes that were made to that creation path.

  • reinterpret_cast<const D3D12_RESOURCE_DESC *>(&resource_desc) is used to pass DESC1 into it. As far as I know this should work perfectly fine as the structures have binary compatibility besides the new elements on DESC1.
  • initial_state was changed from being two possibilities (D3D12_RESOURCE_STATE_COPY_DEST or D3D12_RESOURCE_STATE_GENERIC_READ) into D3D12_RESOURCE_STATE_COMMON. This should be valid as far as I know but perhaps there's a chance an older driver has something against this change.

The change to initial_state was mostly to simplify the code paths a bit, but perhaps it's worth testing that in isolation to see if it fixes it. You can see the relevant changes around that code in the commit and attempt to restore them to see if it allows it to get past the buffer creation.

It'd also help if you can just enable --gpu-validation and see if the D3D12 Debug Layer gives you anything helpful. It's not triggering in my case at all when I force enhanced barriers to false so it does seem like a driver-dependent issue.

from godot.

MBCX avatar MBCX commented on September 17, 2024

@clayjohn Here's the information you requested:

OS + GPU Details (via msinfo32)

OS:

[System Summary]

Item	Value	
OS Name	Microsoft Windows 11 Pro	
Version	10.0.22631 Build 22631	
Other OS Description 	Not Available	
OS Manufacturer	Microsoft Corporation	
System Name	DESKTOP-JVJFCB7	
System Manufacturer	Micro-Star International Co., Ltd.	
System Model	MS-7B17	
System Type	x64-based PC	
System SKU	Default string	
Processor	Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz, 3696 Mhz, 6 Core(s), 6 Logical Processor(s)	
BIOS Version/Date	American Megatrends Inc. A.50, 26/03/2019	
SMBIOS Version	2.8	
Embedded Controller Version	255.255	
BIOS Mode	UEFI	
BaseBoard Manufacturer	Micro-Star International Co., Ltd.	
BaseBoard Product	MPG Z390 GAMING EDGE AC (MS-7B17)	
BaseBoard Version	2.0	
Platform Role	Desktop	
Secure Boot State	Off	
PCR7 Configuration	Elevation Required to View	
Windows Directory	C:\WINDOWS	
System Directory	C:\WINDOWS\system32	
Boot Device	\Device\HarddiskVolume3	
Locale	United Kingdom	
Hardware Abstraction Layer	Version = "10.0.22621.2506"	
Username	DESKTOP-JVJFCB7\PC	
Time Zone	SA Western Standard Time	
Installed Physical Memory (RAM)	32.0 GB	
Total Physical Memory	31.9 GB	
Available Physical Memory	23.0 GB	
Total Virtual Memory	65.9 GB	
Available Virtual Memory	54.8 GB	
Page File Space	34.0 GB	
Page File	C:\pagefile.sys	
Kernel DMA Protection	Off	
Virtualisation-based security	Not enabled	
Windows Defender Application Control policy	Enforced	
Windows Defender Application Control user mode policy	Off	
Device Encryption Support	Elevation Required to View	
Hyper-V - VM Monitor Mode Extensions	Yes	
Hyper-V - Second Level Address Translation Extensions	Yes	
Hyper-V - Virtualisation Enabled in Firmware	Yes	
Hyper-V - Data Execution Protection	Yes	

GPU:

[Display]

Item	Value	
Name	Radeon RX 580 Series	
PNP Device ID	PCI\VEN_1002&DEV_67DF&SUBSYS_2378148C&REV_E7\4&1931349B&0&0008	
Adapter Type	AMD Radeon Graphics Processor (0x67DF), Advanced Micro Devices, Inc. compatible	
Adapter Description	Radeon RX 580 Series	
Adapter RAM	(1,048,576) bytes	
Installed Drivers	C:\WINDOWS\System32\DriverStore\FileRepository\u0400376.inf_amd64_fdce69582fa3a6b8\B400781\aticfx64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\u0400376.inf_amd64_fdce69582fa3a6b8\B400781\aticfx64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\u0400376.inf_amd64_fdce69582fa3a6b8\B400781\aticfx64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\u0400376.inf_amd64_fdce69582fa3a6b8\B400781\amdxc64.dll	
Driver Version	31.0.21912.14	
INF File	oem53.inf (ati2mtag_Polaris10 section)	
Colour Planes	Not Available	
Colour Table Entries	4294967296	
Resolution	1920 x 1080 x 59 hertz	
Bits/Pixel	32	
Memory Address	0x90000000-0xDFFFFFFF	
Memory Address	0xA0000000-0xA01FFFFF	
I/O Port	0x00003000-0x000030FF	
Memory Address	0xA0400000-0xA043FFFF	
IRQ Channel	IRQ 4294967284	
I/O Port	0x000003B0-0x000003BB	
I/O Port	0x000003C0-0x000003DF	
Memory Address	0xA0000-0xBFFFF	
Driver	C:\WINDOWS\SYSTEM32\DRIVERSTORE\FILEREPOSITORY\U0400376.INF_AMD64_FDCE69582FA3A6B8\B400781\AMDKMDAG.SYS (31.0.21912.14, 101.46 MB (106,387,880 bytes), 07/04/2024 10:58)	

Your build configuration (Debian 13-Trixie VM)

scons -j4 platform="windows" arch="x86_64" precision="single" use_mingw="yes" use_llvm="yes" \
    module_text_server_fb_enabled="yes" \
    steamapi="yes" \
    d3d12="yes" \
    agility_sdk_multi_arch="yes" \
    use_pix="yes" \
    dxc_path=$HOME/Documents/d3d12/dxc \
    mesa_libs=$HOME/sources/godot-nir-static \
    agility_sdk_path=$HOME/Documents/d3d12/agilitysdk \
    pix_path=$HOME/Documents/d3d12/pix \
    angle_libs=$HOME/sources/godot-angle-static/bin

Version of DirectX Shader Compiler used

v1.8.2403.2

from godot.

TCROC avatar TCROC commented on September 17, 2024

Interesting to note that both @MBCX and I are using AMD Radeon GPUs. I will be very curious to see how the NVIDIA gpu performs tomorrow

from godot.

matheusmdx avatar matheusmdx commented on September 17, 2024
System Info
OS Name	Microsoft Windows 10 Pro
Version	10.0.19045 Build 19045
Other OS Description 	Not Available
OS Manufacturer	Microsoft Corporation
System Name	DESKTOP-QLESDLJ
System Manufacturer	System manufacturer
System Model	System Product Name
System Type	x64-based PC
System SKU	SKU
Processor	AMD Ryzen 5 3600 6-Core Processor, 3600 Mhz, 6 Core(s), 12 Logical Processor(s)
BIOS Version/Date	American Megatrends Inc. 6210, 9/4/2023
SMBIOS Version	3.3
Embedded Controller Version	255.255
BIOS Mode	UEFI
BaseBoard Manufacturer	ASUSTeK COMPUTER INC.
BaseBoard Product	PRIME A320M-K/BR
BaseBoard Version	Rev X.0x
Platform Role	Desktop
Secure Boot State	Off
PCR7 Configuration	Binding Not Possible
Windows Directory	C:\Windows
System Directory	C:\Windows\system32
Boot Device	\Device\HarddiskVolume1
Locale	Brazil
Hardware Abstraction Layer	Version = "10.0.19041.3636"
User Name	DESKTOP-QLESDLJ\Matheus
Time Zone	E. South America Standard Time
Installed Physical Memory (RAM)	16.0 GB
Total Physical Memory	15.9 GB
Available Physical Memory	8.79 GB
Total Virtual Memory	20.8 GB
Available Virtual Memory	9.89 GB
Page File Space	4.88 GB
Page File	C:\pagefile.sys
Kernel DMA Protection	Off
Virtualization-based security	Running
Virtualization-based security Required Security Properties	
Virtualization-based security Available Security Properties	Base Virtualization Support, DMA Protection, Secure Memory Overwrite, UEFI Code Readonly, Mode Based Execution Control
Virtualization-based security Services Configured	
Virtualization-based security Services Running	
Device Encryption Support	Reasons for failed automatic device encryption: PCR7 binding is not supported, Un-allowed DMA capable bus/device(s) detected
A hypervisor has been detected. Features required for Hyper-V will not be displayed.	
GPU Info
Name	AMD Radeon RX 580 2048SP
PNP Device ID	PCI\VEN_1002&DEV_6FDF&SUBSYS_0B311002&REV_EF\4&1FC990D7&0&0019
Adapter Type	AMD Radeon Graphics Processor (0x6FDF), Advanced Micro Devices, Inc. compatible
Adapter Description	AMD Radeon RX 580 2048SP
Adapter RAM	(1,048,576) bytes
Installed Drivers	C:\Windows\System32\DriverStore\FileRepository\u0402263.inf_amd64_1366da2d694c570c\B400781\aticfx64.dll,C:\Windows\System32\DriverStore\FileRepository\u0402263.inf_amd64_1366da2d694c570c\B400781\aticfx64.dll,C:\Windows\System32\DriverStore\FileRepository\u0402263.inf_amd64_1366da2d694c570c\B400781\aticfx64.dll,C:\Windows\System32\DriverStore\FileRepository\u0402263.inf_amd64_1366da2d694c570c\B400781\amdxc64.dll
Driver Version	31.0.21912.14
INF File	oem32.inf (ati2mtag_Polaris10 section)
Color Planes	Not Available
Color Table Entries	4294967296
Resolution	1920 x 1080 x 60 hertz
Bits/Pixel	32
Memory Address	0x0000-0x1FFFFF
I/O Port	0x0000EF00-0x0000EFFF
Memory Address	0xFCE00000-0xFCEFFFFF
IRQ Channel	IRQ 4294967270
Driver	C:\WINDOWS\SYSTEM32\DRIVERSTORE\FILEREPOSITORY\U0402263.INF_AMD64_1366DA2D694C570C\B400781\AMDKMDAG.SYS (31.0.21912.14, 101.46 MB (106,387,864 bytes), 6/12/2024 5:18 PM)

Compilation Info:

scons target=editor dev_build=yes d3d12=yes use_pix=yes agility_sdk_multi_arch="no" dxc_path="C:\Users\Matheus\Downloads\Godot Utils\dxc_2024_05_24" mesa_libs="C:\Users\Matheus\Downloads\Godot Utils\godot-nir-23.1.9" agility_sdk_path="C:\Users\Matheus\Downloads\Godot Utils\microsoft.direct3d.d3d12.1.614.0" pix_path="C:\Users\Matheus\Downloads\Godot Utils\winpixeventruntime.1.0.240308001"


Running godot on powershell
PS C:\Users\Matheus\Downloads\Godot Source\bin> ./godot.windows.editor.dev.x86_64 --rendering-driver d3d12 --debug --verbose
PS C:\Users\Matheus\Downloads\Godot Source\bin> Godot Engine v4.3.beta.custom_build.cae2f853d (2024-06-27 15:08:26 UTC) - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Devices:
  #0: AMD AMD Radeon RX 580 2048SP - Supported, Discrete
  #1: Microsoft Microsoft Basic Render Driver - Supported, CPU
- Shader:
  model: 6.5
- D3D12 Variable Rate Shading not supported
- D3D12 multiview supported:
  max view count: 4
- Relaxed casting not supported
- D3D12 16-bit ops supported: no
D3D12 12_0 - Forward+ - Using Device #0: AMD - AMD Radeon RX 580 2048SP
ERROR: Can't create buffer of size: 262144, error 0x80070057.
   at: (drivers\d3d12\rendering_device_driver_d3d12.cpp:920)
ERROR: Condition "!block.driver_id" is true. Returning: ERR_CANT_CREATE
   at: RenderingDevice::_insert_staging_block (servers\rendering\rendering_device.cpp:242)
ERROR: Condition "err != OK" is true. Continuing.
   at: RenderingDevice::initialize (servers\rendering\rendering_device.cpp:5510)
ERROR: Can't create buffer of size: 262144, error 0x80070057.
   at: (drivers\d3d12\rendering_device_driver_d3d12.cpp:920)
ERROR: Condition "!block.driver_id" is true. Returning: ERR_CANT_CREATE
   at: RenderingDevice::_insert_staging_block (servers\rendering\rendering_device.cpp:242)
ERROR: Condition "err != OK" is true. Continuing.
   at: RenderingDevice::initialize (servers\rendering\rendering_device.cpp:5510)
WARNING: PSO caching is not implemented yet in the Direct3D 12 driver.
     at: RenderingDeviceDriverD3D12::pipeline_cache_create (drivers\d3d12\rendering_device_driver_d3d12.cpp:4944)
Using "winink" pen tablet driver...
Creating D3D12MA small objects pool for heap type 1 and heap flags 68
ERROR: FATAL: Index p_index = 0 is out of bounds (size() = 0).
   at: CowData<struct RenderingDevice::StagingBufferBlock>::get (C:\Users\Matheus\Downloads\Godot Source\core/templates/cowdata.h:205)

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.beta.custom_build (cae2f853dcd1ecc26ca68de08cec62089dee1f26)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] CowData<RenderingDevice::StagingBufferBlock>::get (C:\Users\Matheus\Downloads\Godot Source\core\templates\cowdata.h:205)
[1] Vector<RenderingDevice::StagingBufferBlock>::operator[] (C:\Users\Matheus\Downloads\Godot Source\core\templates\vector.h:97)
[2] RenderingDevice::_staging_buffer_allocate (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_device.cpp:261)
[3] RenderingDevice::_texture_update (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_device.cpp:1228)
[4] RenderingDevice::texture_create (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_device.cpp:826)
[5] RendererRD::TextureStorage::TextureStorage (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\renderer_rd\storage_rd\texture_storage.cpp:114)
[6] RendererCompositorRD::RendererCompositorRD (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\renderer_rd\renderer_compositor_rd.cpp:306)
[7] RendererCompositorRD::_create_current (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\renderer_rd\renderer_compositor_rd.h:138)
[8] RendererCompositor::create (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\renderer_compositor.cpp:43)
[9] RenderingServerDefault::_init (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_server_default.cpp:220)
[10] RenderingServerDefault::init (C:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_server_default.cpp:261)
[11] Main::setup2 (C:\Users\Matheus\Downloads\Godot Source\main\main.cpp:2833)
[12] Main::setup (C:\Users\Matheus\Downloads\Godot Source\main\main.cpp:2465)
[13] widechar_main (C:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:165)
[14] _main (C:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:206)
[15] main (C:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:220)
[16] WinMain (C:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:234)
[17] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[18] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================


Running godot on vscode

"args": [ "--rendering-driver", "d3d12", "--debug", "--verbose"]


KernelBase.dll!00007fffeac1ba99() (Unknown Source:0)
ucrtbase.dll!00007fffeab2da1d() (Unknown Source:0)
D3D12Core.dll!00007fffc2ffc615() (Unknown Source:0)
D3D12Core.dll!00007fffc2ffc2ca() (Unknown Source:0)
D3D12MA::AllocatorPimpl::CreatePlacedResourceWrap(ID3D12Heap * pHeap, unsigned __int64 HeapOffset, const D3D12MA::CREATE_RESOURCE_PARAMS & createParams, const _GUID & riidResource, void * * ppvResource) Line 6975 (c:\Users\Matheus\Downloads\Godot Source\thirdparty\d3d12ma\D3D12MemAlloc.cpp:6975)
D3D12MA::BlockVector::CreateResource(unsigned __int64 size, unsigned __int64 alignment, const D3D12MA::ALLOCATION_DESC & allocDesc, const D3D12MA::CREATE_RESOURCE_PARAMS & createParams, D3D12MA::Allocation * * ppAllocation, const _GUID & riidResource, void * * ppvResource) Line 8694 (c:\Users\Matheus\Downloads\Godot Source\thirdparty\d3d12ma\D3D12MemAlloc.cpp:8694)
D3D12MA::AllocatorPimpl::CreateResource(const D3D12MA::ALLOCATION_DESC * pAllocDesc, const D3D12MA::CREATE_RESOURCE_PARAMS & createParams, D3D12MA::Allocation * * ppAllocation, const _GUID & riidResource, void * * ppvResource) Line 7080 (c:\Users\Matheus\Downloads\Godot Source\thirdparty\d3d12ma\D3D12MemAlloc.cpp:7080)
D3D12MA::Allocator::CreateResource(const D3D12MA::ALLOCATION_DESC * pAllocDesc, const D3D12_RESOURCE_DESC * pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE * pOptimizedClearValue, D3D12MA::Allocation * * ppAllocation, const _GUID & riidResource, void * * ppvResource) Line 10186 (c:\Users\Matheus\Downloads\Godot Source\thirdparty\d3d12ma\D3D12MemAlloc.cpp:10186)
RenderingDeviceDriverD3D12::buffer_create(unsigned __int64 p_size, BitField<enum RenderingDeviceDriver::BufferUsageBits> p_usage, RenderingDeviceDriver::MemoryAllocationType p_allocation_type) Line 911 (c:\Users\Matheus\Downloads\Godot Source\drivers\d3d12\rendering_device_driver_d3d12.cpp:911)
RenderingDevice::_insert_staging_block() Line 241 (c:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_device.cpp:241)
RenderingDevice::initialize(RenderingContextDriver * p_context, int p_main_window) Line 5509 (c:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_device.cpp:5509)
DisplayServerWindows::DisplayServerWindows(const String & p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, unsigned int p_flags, const Vector2i * p_position, const Vector2i & p_resolution, int p_screen, DisplayServer::Context p_context, Error & r_error) Line 5877 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\display_server_windows.cpp:5877)
DisplayServerWindows::create_func(const String & p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, unsigned int p_flags, const Vector2i * p_position, const Vector2i & p_resolution, int p_screen, DisplayServer::Context p_context, Error & r_error) Line 5928 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\display_server_windows.cpp:5928)
DisplayServer::create(int p_index, const String & p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, unsigned int p_flags, const Vector2i * p_position, const Vector2i & p_resolution, int p_screen, DisplayServer::Context p_context, Error & r_error) Line 1177 (c:\Users\Matheus\Downloads\Godot Source\servers\display_server.cpp:1177)
Main::setup2() Line 2741 (c:\Users\Matheus\Downloads\Godot Source\main\main.cpp:2741)
Main::setup(const char * execpath, int argc, char * * argv, bool p_second_phase) Line 2465 (c:\Users\Matheus\Downloads\Godot Source\main\main.cpp:2465)
widechar_main(int argc, wchar_t * * argv) Line 165 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:165)
_main() Line 206 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:206)
main(int argc, char * * argv) Line 220 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:220)
WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 234 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:234)

Captura 2024-06-28 07-11-03-262282

Captura 2024-06-28 07-13-34-131379



Running godot on vscode with gpu validation

"args": [ "--rendering-driver", "d3d12", "--gpu-validation"]


d3d12SDKLayers.dll!00007ffd8b0ffb84() (Unknown Source:0)
d3d12SDKLayers.dll!00007ffd8b0ff655() (Unknown Source:0)
d3d12SDKLayers.dll!00007ffd8b0ff779() (Unknown Source:0)
D3D12Core.dll!00007ffddb560593() (Unknown Source:0)
D3D12.dll!00007ffddf8743e6() (Unknown Source:0)
D3D12.dll!00007ffddf87429d() (Unknown Source:0)
D3D12.dll!00007ffddf8720f3() (Unknown Source:0)
D3D12.dll!00007ffddf871ff5() (Unknown Source:0)
D3D12Core.dll!00007ffddb560593() (Unknown Source:0)
D3D12Core.dll!00007ffddb5626ab() (Unknown Source:0)
D3D12Core.dll!00007ffddb562f01() (Unknown Source:0)
D3D12.dll!00007ffddf876d40() (Unknown Source:0)
D3D12.dll!00007ffddf8768ec() (Unknown Source:0)
RenderingDeviceDriverD3D12::_initialize_device() Line 6337 (c:\Users\Matheus\Downloads\Godot Source\drivers\d3d12\rendering_device_driver_d3d12.cpp:6337)
RenderingDeviceDriverD3D12::initialize(unsigned int p_device_index, unsigned int p_frame_count) Line 6694 (c:\Users\Matheus\Downloads\Godot Source\drivers\d3d12\rendering_device_driver_d3d12.cpp:6694)
RenderingDevice::initialize(RenderingContextDriver * p_context, int p_main_window) Line 5386 (c:\Users\Matheus\Downloads\Godot Source\servers\rendering\rendering_device.cpp:5386)
DisplayServerWindows::DisplayServerWindows(const String & p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, unsigned int p_flags, const Vector2i * p_position, const Vector2i & p_resolution, int p_screen, DisplayServer::Context p_context, Error & r_error) Line 5877 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\display_server_windows.cpp:5877)
DisplayServerWindows::create_func(const String & p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, unsigned int p_flags, const Vector2i * p_position, const Vector2i & p_resolution, int p_screen, DisplayServer::Context p_context, Error & r_error) Line 5928 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\display_server_windows.cpp:5928)
DisplayServer::create(int p_index, const String & p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, unsigned int p_flags, const Vector2i * p_position, const Vector2i & p_resolution, int p_screen, DisplayServer::Context p_context, Error & r_error) Line 1177 (c:\Users\Matheus\Downloads\Godot Source\servers\display_server.cpp:1177)
Main::setup2() Line 2741 (c:\Users\Matheus\Downloads\Godot Source\main\main.cpp:2741)
Main::setup(const char * execpath, int argc, char * * argv, bool p_second_phase) Line 2465 (c:\Users\Matheus\Downloads\Godot Source\main\main.cpp:2465)
widechar_main(int argc, wchar_t * * argv) Line 165 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:165)
_main() Line 206 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:206)
main(int argc, char * * argv) Line 220 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:220)
WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 234 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:234)
[Inline Frame] invoke_main() Line 102 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:102)
__scrt_common_main_seh() Line 288 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
kernel32.dll!00007ffe119f7344() (Unknown Source:0)
ntdll.dll!00007ffe12c1cc91() (Unknown Source:0)

Captura 2024-06-28 07-10-22-441302

Captura 2024-06-28 07-10-35-990597

from godot.

MBCX avatar MBCX commented on September 17, 2024

@DarioSamo barrier_capabilities.enhanced_barriers_supported is false on my testing here

image

from godot.

DarioSamo avatar DarioSamo commented on September 17, 2024

@DarioSamo barrier_capabilities.enhanced_barriers_supported is false on my testing here

Yeah I think we can abandon that theory.

When you ran it with the debugging layer you're getting an error way earlier than that during device creation.

  • Did you compile the engine with the Agility SDK?
  • What version of the Agility SDK?
  • Did you ever configure your project to use a particular version of the Agility SDK?
  • If you comment out these lines (
    ID3D12SDKConfiguration *sdk_config = nullptr;
    if (SUCCEEDED(d3d_D3D12GetInterface(CLSID_D3D12SDKConfigurationGodot, IID_PPV_ARGS(&sdk_config)))) {
    ID3D12SDKConfiguration1 *sdk_config1 = nullptr;
    if (SUCCEEDED(sdk_config->QueryInterface(&sdk_config1))) {
    if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, agility_sdk_path.ascii().get_data(), IID_PPV_ARGS(device_factory.GetAddressOf())))) {
    d3d_D3D12GetInterface(CLSID_D3D12DeviceFactoryGodot, IID_PPV_ARGS(device_factory.GetAddressOf()));
    } else if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, ".\\", IID_PPV_ARGS(device_factory.GetAddressOf())))) {
    d3d_D3D12GetInterface(CLSID_D3D12DeviceFactoryGodot, IID_PPV_ARGS(device_factory.GetAddressOf()));
    }
    sdk_config1->Release();
    }
    sdk_config->Release();
    }
    ) and rebuild, does it stop failing?
  • Do you have D3D12 DLLs on your Godot binary path (D3D12Core.dll and such) from the Agility SDK and have you tried removing them?

from godot.

MBCX avatar MBCX commented on September 17, 2024

@DarioSamo

Did you compile the engine with the Agility SDK?

Yes (as shown before in my build script)

scons -j4 platform="windows" arch="x86_64" precision="single" use_mingw="yes" use_llvm="yes" \
    module_text_server_fb_enabled="yes" \
    steamapi="yes" \
    d3d12="yes" \
    agility_sdk_multi_arch="yes" \ # Here
    use_pix="yes" \
    dxc_path=$HOME/Documents/d3d12/dxc \
    mesa_libs=$HOME/sources/godot-nir-static \
    agility_sdk_path=$HOME/Documents/d3d12/agilitysdk \ # And Here
    pix_path=$HOME/Documents/d3d12/pix \
    angle_libs=$HOME/sources/godot-angle-static/bin

What version of the Agility SDK?

v1.613.2

Did you ever configure your project to use a particular version of the Agility SDK?

Never. The default value is 613 and I haven't touch it, ever.

Do you have D3D12 DLLs on your Godot binary path (D3D12Core.dll and such) from the Agility SDK and have you tried removing them?

Yes and no.

If you comment out these lines (...) and rebuild, does it stop failing?

Yes I removed them, and now neither (removed and not removed) are failing anymore (on a separate master, and on my custom fork).

On a separate note, I have a custom fork of Godot here in which I merge some in-development features to test out (one of is HDDAGI, etc.) and recently, a draft of Mesh Shaders (and to my disappointment, it appears my GPU is not supported).

The reason I mention this is because it was my custom fork that has/had that weird error before device creation, though I tested it again and is not failing 🤷. So, I guess that was a fluke? Not sure though...

from godot.

MBCX avatar MBCX commented on September 17, 2024

Though now I tried opening one of my projects (not with my custom build) and I force the driver to be d3d12, and now I get this when I exit

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.beta.custom_build (04bf7d4cade645a5923cc80d87ac1c6109e2cdfe)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] Microsoft::WRL::ComPtr<ID3D12DeviceFactory>::InternalRelease (C:\Program Files (x86)\Windows Kits\10\include\10.0.2)
[1] Microsoft::WRL::ComPtr<ID3D12DeviceFactory>::~ComPtr<ID3D12DeviceFactory> (C:\Program Files (x86)\Windows Kits\10\i)
[2] RenderingContextDriverD3D12::~RenderingContextDriverD3D12 (E:\Repos\godot\drivers\d3d12\rendering_context_driver_d3)
[3] RenderingContextDriverD3D12::`scalar deleting destructor'
[4] memdelete<RenderingContextDriver> (E:\Repos\godot\core\os\memory.h:119)
[5] DisplayServerWindows::~DisplayServerWindows (E:\Repos\godot\platform\windows\display_server_windows.cpp:6029)
[6] DisplayServerWindows::`scalar deleting destructor'
[7] memdelete<DisplayServer> (E:\Repos\godot\core\os\memory.h:119)
[8] finalize_display (E:\Repos\godot\main\main.cpp:351)
[9] Main::cleanup (E:\Repos\godot\main\main.cpp:4321)
[10] widechar_main (E:\Repos\godot\platform\windows\godot_windows.cpp:186)
[11] _main (E:\Repos\godot\platform\windows\godot_windows.cpp:206)
[12] main (E:\Repos\godot\platform\windows\godot_windows.cpp:220)
[13] WinMain (E:\Repos\godot\platform\windows\godot_windows.cpp:234)
[14] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[15] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================

from godot.

DarioSamo avatar DarioSamo commented on September 17, 2024

Yes I removed them, and now neither (removed and not removed) are failing anymore (on a separate master, and on my custom fork).

If the unmodified build works, wouldn't that imply something else changed in your setup? Perhaps the existence of the Agility SDK DLLs in the Godot path?

from godot.

MBCX avatar MBCX commented on September 17, 2024

If I remove the DLLs from my build and master I first, won't have access to the D3D12 driver and second Godot won't start because of pix (I compile with pix, and is absolutely required for the DLL to be there).

from godot.

TCROC avatar TCROC commented on September 17, 2024

I tested on my Windows 10 NVIDIA 1050-TI and can confirm this crash still occurs. I'll gather additional system info / stacktraces when I wake up :) Thanks to everyone helping out and looking into this! :)

from godot.

TCROC avatar TCROC commented on September 17, 2024

I tested on my Windows 10 NVIDIA 1050-TI and can confirm this crash still occurs. I'll gather additional system info / stacktraces when I wake up :) Thanks to everyone helping out and looking into this! :)

I was mistaken. The GPU is actually an NVIDIA 1070. Here's the system info and stacktrace:

System Info

Godot v4.3.beta.mono (5e9f547ee) - Windows 10.0.19045 - d3d12 (Forward+) - dedicated NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.1694) - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads)

Stack Trace

C:\Users\charl\source\repos\godot\BlockyBallOT\submodules\godot/bin/godot.windows.editor.double.x86_64.llvm.steam.mono.exe -e C:\Users\charl\source\repos\godot\BlockyBallOT/blockyball-godot/project.godot
Godot Engine v4.3.beta.mono.custom_build.5e0a51c8f (2024-06-27 12:56:54 UTC) - https://godotengine.org
D3D12 12_0 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce GTX 1070
ERROR: Can't create buffer of size: 262144, error 0x80070057.
   at: (drivers\d3d12\rendering_device_driver_d3d12.cpp:920)
ERROR: Condition "!block.driver_id" is true. Returning: ERR_CANT_CREATE
   at: _insert_staging_block (servers\rendering\rendering_device.cpp:242)
ERROR: Condition "err != OK" is true. Continuing.
   at: initialize (servers\rendering\rendering_device.cpp:5510)
ERROR: Can't create buffer of size: 262144, error 0x80070057.
   at: (drivers\d3d12\rendering_device_driver_d3d12.cpp:920)
ERROR: Condition "!block.driver_id" is true. Returning: ERR_CANT_CREATE
   at: _insert_staging_block (servers\rendering\rendering_device.cpp:242)
ERROR: Condition "err != OK" is true. Continuing.
   at: initialize (servers\rendering\rendering_device.cpp:5510)
WARNING: PSO caching is not implemented yet in the Direct3D 12 driver.
     at: pipeline_cache_create (drivers\d3d12\rendering_device_driver_d3d12.cpp:4944)
ERROR: FATAL: Index p_index = 0 is out of bounds (size() = 0).
   at: get (./core/templates/cowdata.h:205)

================================================================
CrashHandlerException: Program crashed with signal 4
Engine version: Godot Engine v4.3.beta.mono.custom_build (5e0a51c8fd55444ce9d5da503c1536fa8e5d81ff)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] RenderingDevice::_staging_buffer_allocate(unsigned int, unsigned int, unsigned int&, unsigned int&, RenderingDevice::StagingRequiredAction&, bool) (servers\rendering/rendering_device.cpp:0)
[2] RenderingDevice::_texture_update(RID, unsigned int, Vector<unsigned char> const&, bool, bool) (servers\rendering/rendering_device.cpp:1228)
[3] RenderingDevice::texture_create(RenderingDeviceCommons::TextureFormat const&, RenderingDevice::TextureView const&, Vector<Vector<unsigned char>> const&) (servers\rendering/rendering_device.cpp:825)
[4] RendererRD::TextureStorage::TextureStorage() (servers\rendering\renderer_rd\storage_rd/texture_storage.cpp:114)
[5] RendererCompositorRD::RendererCompositorRD() (servers\rendering\renderer_rd/renderer_compositor_rd.cpp:306)
[6] RendererCompositorRD::_create_current() (./servers/rendering/renderer_rd/renderer_compositor_rd.h:138)
[7] RenderingServerDefault::_init() (servers\rendering/rendering_server_default.cpp:220)
[8] Main::setup2() (main/main.cpp:2830)
[9] Main::setup(char const*, int, char**, bool) (main/main.cpp:2464)
[10] widechar_main(int, wchar_t**) (platform\windows/godot_windows.cpp:165)
[11] _main() (platform\windows/godot_windows.cpp:206)
[12] main (platform\windows/godot_windows.cpp:225)
-- END OF BACKTRACE --
================================================================

from godot.

RandomShaper avatar RandomShaper commented on September 17, 2024

@TCROC, that stack trace looks like predating #93706. Can you try with #93706 itself (it would still error but at least handle it more grafecully) or with #93707, that should fix the issue altogether?

from godot.

TCROC avatar TCROC commented on September 17, 2024

Can confirm the PR fixes both AMD and NVIDIA issues on Windows 10

from godot.

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.