godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.93k stars 21.15k forks source link

Windows 11 Crashes Just opening a project/create node #96563

Open joshualawson opened 2 months ago

joshualawson commented 2 months ago

Tested versions

4.3 stable

System information

Windows 11

Issue description

Constant errors in console showing the following:

Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 560.94 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 3080

Editing project: C:/Users/Joshua/Documents/tutorial
Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
Vulkan 1.3.280 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3080

ERROR: Condition "err != VK_SUCCESS && err != VK_SUBOPTIMAL_KHR" is true. Returning: FAILED
   at: command_queue_execute_and_present (drivers/vulkan/rendering_device_driver_vulkan.cpp:2344)
ERROR: Condition "err != VK_SUCCESS && err != VK_SUBOPTIMAL_KHR" is true. Returning: FAILED
   at: command_queue_execute_and_present (drivers/vulkan/rendering_device_driver_vulkan.cpp:2344)
ERROR: Condition "err != VK_SUCCESS && err != VK_SUBOPTIMAL_KHR" is true. Returning: FAILED
   at: command_queue_execute_and_present (drivers/vulkan/rendering_device_driver_vulkan.cpp:2344)
ERROR: Condition "err != VK_SUCCESS && err != VK_SUBOPTIMAL_KHR" is true. Returning: FAILED
   at: command_queue_execute_and_present (drivers/vulkan/rendering_device_driver_vulkan.cpp:2344)

Steps to reproduce

Open a project, click + Add Node

Minimal reproduction project (MRP)

A brand new empty project

AThousandShips commented 2 months ago

It looks like your project uses Forward+ but your computer doesn't support Vulkan, can you try creating a new project with the Compatibility renderer and try opening it?

joshualawson commented 2 months ago

Creating a project with the Compatibility renderer works, but Vulkun should be supported on my RTX3080? Latest drivers etc.

AThousandShips commented 2 months ago

Please provide your system specs, unsure why this would happen, but more details is needed

Zireael07 commented 2 months ago

People have had their Vulkan support break e.g. by uninstalling stuff that injects their own Vulkan layers, e.g. Epic Games

bitmammoth commented 1 month ago

Fwiw I'm having this same issue but for me its intermittent and just started happening.

joshualawson commented 1 month ago

AMD Ryzen 7 7800X3D 64GB of ram RTX 3080

I do have Unreal installed and Unreal engine... plus a lot of games etc, other than that, I only use my windows PC for gaming really... Does uninstalling UE help at all?

I attempted to install the Vulkun SDK and it installs correctly, but if I install just the Vulkun runtime only, it fails will access permission problems to what looks like existing Vulkun files on my system

joshualawson commented 1 month ago

Uninstalled UE and same issue, still unable to install the Vulkan Runtime also

Error opening file for writing:

C:\Windows\System32\vulkan-1.dll
joshualawson commented 1 month ago

what other details can I supply?

ducklin5 commented 1 day ago

You can use the Vulkan SDK to find out which layers might be affecting Godot:

https://github.com/godotengine/godot/issues/96563#issuecomment-2330917057

People have had their Vulkan support break e.g. by uninstalling stuff that injects their own Vulkan layers, e.g. Epic Games

https://github.com/godotengine/godot/issues/81670#issuecomment-1720270768:

Do you have any third-party Vulkan layers installed, such as RTSS, Epic Games Launcher/Rockstar Games Launcher, or software that injects itself into processes in general?

I think Vulkan Configurator (which is part of the Vulkan SDK) can display a list of those.

You might have to clean out the registry to remove layers (I had to do so for MedalTV layer)

Also try: Enabling validation layers


ERROR: Condition "err != VK_SUCCESS && err != VK_SUBOPTIMAL_KHR" is true. Returning: FAILED
   at: command_queue_execute_and_present (drivers/vulkan/rendering_device_driver_vulkan.cpp:2344)

This error from your console comes from command_queue_execute_and_present [1]

err is the result of a call to device_functions.QueuePresentKHR == vkQueuePresentKHR [2] [3] According to the vulkan docs [4]: vkQueuePresentKHR returns one of these error values:

On success, this command returns:

  • VK_SUCCESS
  • VK_SUBOPTIMAL_KHR

On failure, this command returns:

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_DEVICE_LOST
  • VK_ERROR_OUT_OF_DATE_KHR
  • VK_ERROR_SURFACE_LOST_KHR
  • VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT

Note: VK_ERROR_OUT_OF_DATE_KHR is already handled in command_queue_execute_and_present. So the error has to be one of these:

AFAIK, the only way to find out which one it is, would be to build the engine from source with debug symbols

I'm also running into this error when using wgpu<Vulkan> for tensor operations via GdExtension. Unfortunately, I'd need to build the engine to troubleshoot.

@joshualawson Your case might be a different err from mine. This error message might not be the issue at all for you because my engine/game doesn't crash from this error (I just happen to get this error alot) Try uninstalling any unneeded layers before building from source.

Sources:

  1. https://github.com/godotengine/godot/blob/77dcf97d82cbfe4e4615475fa52ca03da645dbd8/drivers/vulkan/rendering_device_driver_vulkan.cpp#L2344
  2. https://github.com/godotengine/godot/blob/77dcf97d82cbfe4e4615475fa52ca03da645dbd8/drivers/vulkan/rendering_device_driver_vulkan.cpp#L2312
  3. https://github.com/godotengine/godot/blob/77dcf97d82cbfe4e4615475fa52ca03da645dbd8/drivers/vulkan/rendering_device_driver_vulkan.cpp#L987
  4. Vulkan vkQueuePresentKHR docs: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html
ducklin5 commented 1 day ago

I've made a PR here to add more descriptive error checks: https://github.com/godotengine/godot/pull/98883#issue-2637113163