Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot 4 with double precision support crashes when any project is opened #70879

Closed
codespren opened this issue Jan 3, 2023 · 4 comments · Fixed by #85822
Closed

Godot 4 with double precision support crashes when any project is opened #70879

codespren opened this issue Jan 3, 2023 · 4 comments · Fixed by #85822

Comments

@codespren
Copy link

codespren commented Jan 3, 2023

Godot version

4.0 double precision custom build (96f1204)

System information

macOS Ventura 13.1, AMD Radeon Pro 5500M

Issue description

I'm trying to compile the engine from the master-branch with mono and double precision enabled. Compiling works fine and the project list is displayed normally when the editor is opened but when I try to open any project I receive an error and the editor crashes:

Godot Engine v4.0.beta.mono.custom_build.96f12040c - https://godotengine.org
Vulkan API 1.2.236 - Using Vulkan Device #0: AMD - AMD Radeon Pro 5500M
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64B64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:0'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6393)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64B64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:0'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6393)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64B64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:0'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6393)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:1'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6393)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:1'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6393)
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:61)
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta.mono.custom_build (96f12040c9edc95a758e7c74760b3b2476136d18)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] sigsegv_handler(int, __siginfo*, void*)
[2] 2   libsystem_platform.dylib            0x00007ff805384c1d _sigtramp + 29
[3] 3   ???                                 0x0000000000000000 0x0 + 0
[4] ScriptDebugger::send_error(String const&, String const&, int, String const&, String const&, bool, ErrorHandlerType, Vector<ScriptLanguage::StackInfo> const&) (in godot.macos.editor.double.x86_64.mono) + 102
[5] godotsharp_internal_script_debugger_send_error (in godot.macos.editor.double.x86_64.mono) + 46
[6] 6   ???                                 0x000000012843d67f 0x0 + 4970501759
[7] 7   ???                                 0x000000012843d524 0x0 + 4970501412
[8] 8   ???                                 0x0000000128433f0e 0x0 + 4970462990
[9] 9   ???                                 0x000000012843357f 0x0 + 4970460543
[10] 10  ???                                 0x0000000127e6753e 0x0 + 4964382014
[11] CSharpScript::update_script_class_info(Ref<CSharpScript>) (in godot.macos.editor.double.x86_64.mono) + 187
[12] CSharpScript::reload_registered_script(Ref<CSharpScript>) (in godot.macos.editor.double.x86_64.mono) + 56
[13] godotsharp_internal_reload_registered_script (in godot.macos.editor.double.x86_64.mono) + 49
[14] 14  ???                                 0x0000000127e64440 0x0 + 4964369472
[15] 15  ???                                 0x0000000127e64392 0x0 + 4964369298
[16] 16  ???                                 0x0000000127e638c2 0x0 + 4964366530
[17] 17  ???                                 0x0000000127e636e2 0x0 + 4964366050
[18] 18  ???                                 0x0000000127e63417 0x0 + 4964365335
[19] 19  ???                                 0x0000000127e61cac 0x0 + 4964359340
[20] 20  ???                                 0x0000000127e619b6 0x0 + 4964358582
[21] 21  ???                                 0x0000000127e5c601 0x0 + 4964337153
[22] 22  ???                                 0x00000001283002d7 0x0 + 4969202391
[23] 23  libcoreclr.dylib                    0x000000012120f8e9 CallDescrWorkerInternal + 124
[24] CallDescrWorkerWithHandler(CallDescrData*, int)
[25] CallDescrWorkerReflectionWrapper(CallDescrData*, Frame*)
[26] RuntimeMethodHandle::InvokeMethod(Object*, Span<Object*>*, SignatureNative*, bool, bool)
[27] 27  ???                                 0x000000012761d93c 0x0 + 4955691324
[28] 28  ???                                 0x000000012761048d 0x0 + 4955636877
[29] 29  ???                                 0x0000000127e59ca4 0x0 + 4964326564
[30] CSharpLanguage::_editor_init_callback() (in godot.macos.editor.double.x86_64.mono) + 119
[31] EditorNode::EditorNode() (in godot.macos.editor.double.x86_64.mono) + 99628
[32] Main::start() (in godot.macos.editor.double.x86_64.mono) + 14163
[33] main (in godot.macos.editor.double.x86_64.mono) + 365
[34] 34  dyld                                0x00007ff805027310 start + 2432
-- END OF BACKTRACE --
================================================================

The command I used to compile it:

scons platform=macos arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu) precision=double module_mono_enabled=yes

Vulkan API version is 1.3.236.0

There was one warning during the build but not sure if it is related to the problem:

ld: warning: object file (/Users/XXXX/VulkanSDK/1.3.231.1/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64//libMoltenVK.a(libMoltenVK.a-x86_64-master.o)) was built for newer macOS version (10.13) than being linked (10.12)

I tried to compile it with older version of Vulkan API but the warning didn't go away.

I also made a build without double precision support with and without mono and both builds works so the problem occurs only when the double precision is enabled.

Steps to reproduce

  1. Compile latest master-branch on macOS with double-precision support
  2. Try to open any project -> crash.

Minimal reproduction project

N/A

@clayjohn
Copy link
Member

clayjohn commented Jan 3, 2023

Related #67575, #58333. This seems like a macOS issue coming from Metal not supporting double precision. We may have to create a fallback for macOS.

cc @bruvzg who may know more about what Metal supports

@bruvzg
Copy link
Member

bruvzg commented Jan 3, 2023

Metal does not support double-precision at all, even when used on GPU with double-precision support in hardware. But related issues seem to be on Linux, so I guess it's not a Metal only issue.

@clayjohn
Copy link
Member

clayjohn commented Jan 3, 2023

Okay, so we need to insert some macOS specific checks in doubles builds to ensure that vertex buffers always use single precision floating point formats

Or, I guess it may be possible to detect whether double precision is supported then fallback to single precision if not. That way we may be able to fix the crash on all platforms

@des1redState
Copy link

des1redState commented Dec 6, 2023

Still an issue in 4.2

Godot Engine v4.2.1.rc.custom_build.289472db8 - https://godotengine.org
Vulkan API 1.2.268 - Forward+ - Using Vulkan Device #0: Apple - Apple M1 Pro
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64B64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:0'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6531)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64B64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:0'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6531)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64B64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:0'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6531)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:1'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6531)
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R64G64_SFLOAT is not supported for vertex buffers on this device.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute vertex0(0) is missing from the vertex descriptor.
ERROR: vkCreateGraphicsPipelines failed with error -3 for shader 'CanvasOcclusionShaderRD:1'.
   at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6531)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants