CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
917 stars 292 forks source link

Hardware RayTracing + Vulkan will lead crash in Windows with UE 5.3.2(Standalone mode) #1482

Open ZhengzhongSun opened 1 month ago

ZhengzhongSun commented 1 month ago

Plugin version: Cesium for Unreal v2.7.0

When I run my Unreal project in Standalone and try to load 3DTiles, it will crash mostly. But running in Unreal Editor, it runs well. In Standalone mode, Disable Hardware RayTracing or change RHI to DX12 will make it work well. So it seems the Standalone crash error occurs when using both Hardware RayTracing + Vulkan.

Any suggestion about it? Thanks!

Error log:

[2024.07.05-07.41.56:446][426]LogCesium: Warning: "Enable World Bounds Checks" in the world settings is currently enabled. Please consider disabling it to avoid potential issues.
[2024.07.05-07.41.56:446][426]LogCesium: Display: Caching Cesium requests in C:/Users/admin/AppData/Local/UnrealEngine/5.3/cesium-request-cache.sqlite
[2024.07.05-07.41.56:447][426]LogCesium: Loading tileset from URL 
[2024.07.05-07.41.56:447][426]LogCesium: Loading tileset from URL  done
[2024.07.05-07.41.56:451][426]LogCesium: Warning: "Enable World Bounds Checks" in the world settings is currently enabled. Please consider disabling it to avoid potential issues.
[2024.07.05-07.41.56:451][426]LogCesium: Loading tileset from URL http://192.168.36.145:8080/3DTiles/BigDataCenter/DEM/China_srtm_90m/layer.json
[2024.07.05-07.41.56:451][426]LogCesium: Loading tileset from URL http://192.168.36.145:8080/3DTiles/BigDataCenter/DEM/China_srtm_90m/layer.json done
[2024.07.05-07.41.57:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.41.58:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.41.58:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.41.59:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.41.59:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.00:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.00:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.01:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.01:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.02:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.02:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.03:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.03:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.04:306][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.04:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.05:137][464]LogVulkanRHI: Error: Result failed, VkResult=-4
 at D:\build\++UE5\Sync\Engine\Source\Runtime\VulkanRHI\Private\VulkanMemory.cpp:4669 
 with error VK_ERROR_DEVICE_LOST
[2024.07.05-07.42.05:137][464]LogWindows: Error: appError called: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\VulkanRHI\Private\VulkanUtil.cpp] [Line: 1130] 
Result failed, VkResult=-4
 at D:\build\++UE5\Sync\Engine\Source\Runtime\VulkanRHI\Private\VulkanMemory.cpp:4669 
 with error VK_ERROR_DEVICE_LOST
[2024.07.05-07.42.05:137][464]LogWindows: Windows GetLastError: 操作成功完成。 (0)
csciguy8 commented 1 month ago

Hi @ZhengzhongSun,

Sorry your project is crashing in this way, but from what I can tell the related logs don't look related to the cesium plugin at all.

[2024.07.05-07.42.04:806][464]LogRHI: Timed out while waiting for GPU to catch up on occlusion results. (0.5 s)
[2024.07.05-07.42.05:137][464]LogVulkanRHI: Error: Result failed, VkResult=-4
 at D:\build\++UE5\Sync\Engine\Source\Runtime\VulkanRHI\Private\VulkanMemory.cpp:4669 
 with error VK_ERROR_DEVICE_LOST
[2024.07.05-07.42.05:137][464]LogWindows: Error: appError called: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\VulkanRHI\Private\VulkanUtil.cpp] [Line: 1130] 
Result failed, VkResult=-4
 at D:\build\++UE5\Sync\Engine\Source\Runtime\VulkanRHI\Private\VulkanMemory.cpp:4669 
 with error VK_ERROR_DEVICE_LOST

I've never tried running with HW ray tracing myself, so I could be wrong though.

ZhengzhongSun commented 1 month ago

@csciguy8 Thank you for your response! Although the crash is caused by the time out of vulkan, but it always occurs after loading 3d tiles. So I think it should have relationshapes with Cesium plugin more or less. If possible, you can follow the simple instruction to reproduce it.

  1. Launch UE 5.3.2, Create a new blueprint project with Raytracing enabled.
  2. Enable Cesium for Unreal Version 2.7.0 plugin.
  3. Open Project Settings->Platforms->Windows, Switch the Default RHI to Vulkan, Enable the Vulkan Targeted Shader Formats->SM6(This need to be enabled in my newest test, enable SM5 will also lead to crash. When I disabled both SM5 and SM6, the crash disappeared, but result in poor rendering). Ensure Support Hardware Ray Tracing is also enabled in Rendering panel. Then restart the Editor.
  4. Add Blank 3D Tiles Tileset to your viewport from Cesium window, Switch Source to From Url and set the test Url(For me, I use the Dragon in 3d-tiles-samples, http://localhost:8003/1.0/TilesetWithDiscreteLOD/tileset.json).
  5. After adjust CesiumGeoreference, I will see the dragon in my editor viewport. But when I Play the game with Standalone Game mode, it will crash!

Hopeful to your feedback!

ZhengzhongSun commented 4 weeks ago

Update to UE 5.4.3 won't crash, this seems to be a bug unique to UE 5.3.

j9liu commented 3 weeks ago

Thanks for the update @ZhengzhongSun! Sorry about the delays in triaging this issue. I've formally added it to our task board so we can investigate this given the chance. Thank you for your patience :pray: