godotengine / godot

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

Vulkan Driver doesn't work on drivers that lack cubemap array support, such as iOS simulator and 1st-gen iPad Pro #74227

Open gumaciel opened 1 year ago

gumaciel commented 1 year ago

Godot version

4.0 stable

System information

Mac OS Monterey (12.6), Vulkan API 1.2.231, iOS 16.2 Simulator (iPhone 14 Pro), Intel chip CPU

Issue description

When trying to export an empty game to run in the Xcode simulator, it gives an error:

USER ERROR: Condition "!_start_success" is true. Returning: false
USER ERROR: Unable to create DisplayServer, all display drivers failed.
USER ERROR: Failed to create Vulkan window.

Should that be normal? Since on my Desktop running the application it works normally

full log:

2023-03-02 08:15:14.046921-0300 EmptyProject40stableMobile[21879:415340] Metal GPU Frame Capture Enabled
2023-03-02 08:15:14.047283-0300 EmptyProject40stableMobile[21879:415340] Metal API Validation Enabled
*********** main.m
running app main
2023-03-02 08:15:14.164637-0300 EmptyProject40stableMobile[21879:415340] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
2023-03-02 08:15:14.164846-0300 EmptyProject40stableMobile[21879:415340] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
Path: /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/91040C82-2B49-40F9-8FB2-E8BEE67EE6B6/data/Containers/Bundle/Application/17A2E2CE-D93E-4B79-9907-8D6B2912F4BB/EmptyProject40stableMobile.app
godot_ios /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/91040C82-2B49-40F9-8FB2-E8BEE67EE6B6/data/Containers/Bundle/Application/17A2E2CE-D93E-4B79-9907-8D6B2912F4BB/EmptyProject40stableMobile.app/EmptyProject40stableMobile
cwd /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/91040C82-2B49-40F9-8FB2-E8BEE67EE6B6/data/Containers/Bundle/Application/17A2E2CE-D93E-4B79-9907-8D6B2912F4BB/EmptyProject40stableMobile.app
os created
setup 0
******** setting up keyboard input view
******** adding observer for keyboard show/hide
2023-03-02 08:15:14.336630-0300 EmptyProject40stableMobile[21879:415340] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000016581c0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
start animation!
2023-03-02 08:15:14.398352-0300 EmptyProject40stableMobile[21879:415340] USER ERROR: AudioOutputUnitStart failed, code: -50
2023-03-02 08:15:14.398488-0300 EmptyProject40stableMobile[21879:415340]    at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:251)
USER ERROR: AudioOutputUnitStart failed, code: -50
   at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:251)
2023-03-02 08:15:14.403985-0300 EmptyProject40stableMobile[21879:415340] Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
[mvk-info] MoltenVK version 1.2.0, supporting Vulkan version 1.2.231.
    The following 82 Vulkan extensions are supported:
        VK_KHR_16bit_storage v1
        VK_KHR_8bit_storage v1
        VK_KHR_bind_memory2 v1
        VK_KHR_buffer_device_address v1
        VK_KHR_create_renderpass2 v1
        VK_KHR_dedicated_allocation v3
        VK_KHR_depth_stencil_resolve v1
        VK_KHR_descriptor_update_template v1
        VK_KHR_device_group v4
        VK_KHR_device_group_creation v1
        VK_KHR_driver_properties v1
        VK_KHR_dynamic_rendering v1
        VK_KHR_external_fence v1
        VK_KHR_external_fence_capabilities v1
        VK_KHR_external_memory v1
        VK_KHR_external_memory_capabilities v1
        VK_KHR_external_semaphore v1
        VK_KHR_external_semaphore_capabilities v1
        VK_KHR_fragment_shader_barycentric v1
        VK_KHR_get_memory_requirements2 v1
        VK_KHR_get_physical_device_properties2 v2
        VK_KHR_get_surface_capabilities2 v1
        VK_KHR_imageless_framebuffer v1
        VK_KHR_image_format_list v1
        VK_KHR_maintenance1 v2
        VK_KHR_maintenance2 v1
        VK_KHR_maintenance3 v1
        VK_KHR_multiview v1
        VK_KHR_portability_subset v1
        VK_KHR_push_descriptor v2
        VK_KHR_relaxed_block_layout v1
        VK_KHR_sampler_mirror_clamp_to_edge v3
        VK_KHR_sampler_ycbcr_conversion v14
        VK_KHR_separate_depth_stencil_layouts v1
        VK_KHR_shader_draw_parameters v1
        VK_KHR_shader_float_controls v4
        VK_KHR_shader_float16_int8 v1
        VK_KHR_shader_subgroup_extended_types v1
        VK_KHR_spirv_1_4 v1
        VK_KHR_storage_buffer_storage_class v1
        VK_KHR_surface v25
        VK_KHR_swapchain v70
        VK_KHR_swapchain_mutable_format v1
        VK_KHR_timeline_semaphore v2
        VK_KHR_uniform_buffer_standard_layout v1
        VK_KHR_variable_pointers v1
        VK_EXT_buffer_device_address v2
        VK_EXT_debug_marker v4
        VK_EXT_debug_report v10
        VK_EXT_debug_utils v2
        VK_EXT_descriptor_indexing v2
        VK_EXT_fragment_shader_interlock v1
        VK_EXT_host_query_reset v1
        VK_EXT_image_robustness v1
        VK_EXT_inline_uniform_block v1
        VK_EXT_memory_budget v1
        VK_EXT_metal_objects v1
        VK_EXT_metal_surface v1
        VK_EXT_post_depth_coverage v1
        VK_EXT_private_data v1
        VK_EXT_robustness2 v1
        VK_EXT_sample_locations v1
        VK_EXT_scalar_block_layout v1
        VK_EXT_separate_stencil_usage v1
        VK_EXT_shader_stencil_export v1
        VK_EXT_shader_viewport_index_layer v1
        VK_EXT_subgroup_size_control v2
        VK_EXT_swapchain_colorspace v4
        VK_EXT_texel_buffer_alignment v1
        VK_EXT_texture_compression_astc_hdr v1
        VK_EXT_vertex_attribute_divisor v3
        VK_AMD_gpu_shader_half_float v2
        VK_AMD_negative_viewport_height v1
        VK_AMD_shader_image_load_store_lod v1
        VK_AMD_shader_trinary_minmax v1
        VK_IMG_format_pvrtc v1
        VK_INTEL_shader_integer_functions2 v1
        VK_GOOGLE_display_timing v1
        VK_MVK_ios_surface v3
        VK_MVK_moltenvk v36
        VK_NV_fragment_shader_barycentric v1
        VK_NV_glsl_shader v1
[mvk-info] GPU device:
        model: Apple iOS simulator GPU
        type: Integrated
        vendorID: 0x106b
        deviceID: 0x100203ea
        pipelineCacheUUID: 000027D8-1002-03EA-0000-000000000000
    supports the following Metal Versions, GPU's and Feature Sets:
        Metal Shading Language 3.0
        GPU Family Apple 2
        GPU Family Apple 1
        GPU Family Common 1
        iOS GPU Family 2 v5
        iOS GPU Family 2 v4
        iOS GPU Family 2 v3
        iOS GPU Family 2 v2
        iOS GPU Family 2 v1
        iOS GPU Family 1 v5
        iOS GPU Family 1 v4
        iOS GPU Family 1 v3
        iOS GPU Family 1 v2
        iOS GPU Family 1 v1
[mvk-info] Created VkInstance for Vulkan version 1.2.0, as requested by app, with the following 3 Vulkan extensions enabled:
        VK_KHR_get_physical_device_properties2 v2
        VK_KHR_surface v25
        VK_MVK_ios_surface v3
2023-03-02 08:15:14.659866-0300 EmptyProject40stableMobile[21879:415340] Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple iOS simulator GPU
Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple iOS simulator GPU
2023-03-02 08:15:14.660182-0300 EmptyProject40stableMobile[21879:415340] USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot.
2023-03-02 08:15:14.660330-0300 EmptyProject40stableMobile[21879:415340]    at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1336)
USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot.
   at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1336)
2023-03-02 08:15:14.660551-0300 EmptyProject40stableMobile[21879:415340] USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
2023-03-02 08:15:14.660689-0300 EmptyProject40stableMobile[21879:415340]    at: _window_create (drivers/vulkan/vulkan_context.cpp:1681)
USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
   at: _window_create (drivers/vulkan/vulkan_context.cpp:1681)
2023-03-02 08:15:14.661281-0300 EmptyProject40stableMobile[21879:415340] USER ERROR: Failed to create Vulkan window.
2023-03-02 08:15:14.661446-0300 EmptyProject40stableMobile[21879:415340]    at: DisplayServerIOS (platform/ios/display_server_ios.mm:84)
USER ERROR: Failed to create Vulkan window.
   at: DisplayServerIOS (platform/ios/display_server_ios.mm:84)
2023-03-02 08:15:14.661595-0300 EmptyProject40stableMobile[21879:415340] USER ERROR: Unable to create DisplayServer, all display drivers failed.
2023-03-02 08:15:14.661731-0300 EmptyProject40stableMobile[21879:415340]    at: setup2 (main/main.cpp:2013)
USER ERROR: Unable to create DisplayServer, all display drivers failed.
   at: setup2 (main/main.cpp:2013)
2023-03-02 08:15:14.665820-0300 EmptyProject40stableMobile[21879:415340] USER ERROR: Condition "!_start_success" is true. Returning: false
2023-03-02 08:15:14.665977-0300 EmptyProject40stableMobile[21879:415340]    at: start (main/main.cpp:2381)
USER ERROR: Condition "!_start_success" is true. Returning: false
   at: start (main/main.cpp:2381)

Steps to reproduce

Just create a Empty project as "Mobile" Render option and try to export

Minimal reproduction project

EmptyProject40stableMobile.zip

ra669180 commented 1 year ago

I got this same exact error today. I wonder if it is a Godot 4 thing or Xcode or M1

gumaciel commented 1 year ago

@ra669180 your computer is M1? My computer is a Intel chip

ra669180 commented 1 year ago

@gumaciel yes, m1 and m1 pro getting the same error. The game loads on the simulator but gets stuck on the Godot Splash page and errors out.

Calinou commented 1 year ago

I'm not sure if MoltenVK is compiled for x86, so the Vulkan renderer may not work at all on the iOS simulator running on an Intel Mac. It should be possible to get it working on Apple Silicon though.

ra669180 commented 1 year ago

@Calinou How do you get it running? I am on Apple Silicon and getting the same error.

gumaciel commented 1 year ago

@ra669180 to be able to run on my Intel, i needed to change to Compatibility render option Captura de Tela 2023-03-02 às 19 05 08

ra669180 commented 1 year ago

@gumaciel you got it to run? Did you change the Compatibility render option in Xcode or Godot?

Calinou commented 1 year ago

@gumaciel you got it to run? Did you change the Compatibility render option in Xcode or Godot?

This is in the top-right corner of the Godot editor. However, beware of https://github.com/godotengine/godot/pull/72461: you'll want to change the .mobile override for the Rendering Method project setting manually to gl_compatibility.

sandydunlop commented 1 year ago

I'm getting the exact same error on an Intel Mac and the iPhone 14 Pro simulator.

cchipont commented 1 year ago

Same here, this was done with the Godot Engine v4.1.dev1 "Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot." Compiling in M1 pro first gen and IPAD pro first gen 12 inches Recommend chainging the title to "Vulkan Driver doesn't work on iOS 16.2" as mine an ipad pro physical device.

Here is the debug log:

2023-05-05 09:50:44.317410-0300 networh[937:346758] Metal GPU Frame Capture Enabled
2023-05-05 09:50:44.318714-0300 networh[937:346758] Metal API Validation Enabled
2023-05-05 09:50:44.676623-0300 networh[937:346758] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
2023-05-05 09:50:44.676757-0300 networh[937:346758] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
2023-05-05 09:50:44.676863-0300 networh[937:346758] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
2023-05-05 09:50:44.805542-0300 networh[937:346758] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
2023-05-05 09:50:44.866585-0300 networh[937:346758] USER ERROR: AudioOutputUnitStart failed, code: -50
2023-05-05 09:50:44.866666-0300 networh[937:346758]    at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:251)
USER ERROR: AudioOutputUnitStart failed, code: -50
   at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:251)
2023-05-05 09:50:44.882300-0300 networh[937:346758] Godot Engine v4.1.dev1.official.db1302637 - https://godotengine.org
Godot Engine v4.1.dev1.official.db1302637 - https://godotengine.org
[mvk-info] MoltenVK version 1.2.0, supporting Vulkan version 1.2.231.
    The following 82 Vulkan extensions are supported:
        VK_KHR_16bit_storage v1
        VK_KHR_8bit_storage v1
        VK_KHR_bind_memory2 v1
        VK_KHR_buffer_device_address v1
        VK_KHR_create_renderpass2 v1
        VK_KHR_dedicated_allocation v3
        VK_KHR_depth_stencil_resolve v1
        VK_KHR_descriptor_update_template v1
        VK_KHR_device_group v4
        VK_KHR_device_group_creation v1
        VK_KHR_driver_properties v1
        VK_KHR_dynamic_rendering v1
        VK_KHR_external_fence v1
        VK_KHR_external_fence_capabilities v1
        VK_KHR_external_memory v1
        VK_KHR_external_memory_capabilities v1
        VK_KHR_external_semaphore v1
        VK_KHR_external_semaphore_capabilities v1
        VK_KHR_fragment_shader_barycentric v1
        VK_KHR_get_memory_requirements2 v1
        VK_KHR_get_physical_device_properties2 v2
        VK_KHR_get_surface_capabilities2 v1
        VK_KHR_imageless_framebuffer v1
        VK_KHR_image_format_list v1
        VK_KHR_maintenance1 v2
        VK_KHR_maintenance2 v1
        VK_KHR_maintenance3 v1

        VK_KHR_multiview v1
        VK_KHR_portability_subset v1
        VK_KHR_push_descriptor v2
        VK_KHR_relaxed_block_layout v1
        VK_KHR_sampler_mirror_clamp_to_edge v3
        VK_KHR_sampler_ycbcr_conversion v14
        VK_KHR_separate_depth_stencil_layouts v1
        VK_KHR_shader_draw_parameters v1
        VK_KHR_shader_float_controls v4
        VK_KHR_shader_float16_int8 v1
        VK_KHR_shader_subgroup_extended_types v1
        VK_KHR_spirv_1_4 v1
        VK_KHR_storage_buffer_storage_class v1
        VK_KHR_surface v25
        VK_KHR_swapchain v70
        VK_KHR_swapchain_mutable_format v1
        VK_KHR_timeline_semaphore v2
        VK_KHR_uniform_buffer_standard_layout v1
        VK_KHR_variable_pointers v1
        VK_EXT_buffer_device_address v2
        VK_EXT_debug_marker v4
        VK_EXT_debug_report v10
        VK_EXT_debug_utils v2
        VK_EXT_descriptor_indexing v2
        VK_EXT_fragment_shader_interlock v1
        VK_EXT_host_query_reset v1
        VK_EXT_image_robustness v1
        VK_EXT_inline_uniform_block v1
        VK_EXT_memory_budget v1
        VK_EXT_metal_objects v1
        VK_EXT_metal_surface v1
        VK_EXT_post_depth_coverage v1
        VK_EXT_private_data v1
        VK_EXT_robustness2 v1
        VK_EXT_sample_locations v1
        VK_EXT_scalar_block_layout v1
        VK_EXT_separate_stencil_usage v1
        VK_EXT_shader_stencil_export v1
        VK_EXT_shader_viewport_index_layer v1
        VK_EXT_subgroup_size_control v2
        VK_EXT_swapchain_colorspace v4
        VK_EXT_texel_buffer_alignment v1
        VK_EXT_texture_compression_astc_hdr v1
        VK_EXT_vertex_attribute_divisor v3
        VK_AMD_gpu_shader_half_float v2
        VK_AMD_negative_viewport_height v1
        VK_AMD_shader_image_load_store_lod v1
        VK_AMD_shader_trinary_minmax v1
        VK_IMG_format_pvrtc v1
        VK_INTEL_shader_integer_functions2 v1
        VK_GOOGLE_display_timing v1
        VK_MVK_ios_surface v3
        VK_MVK_moltenvk v36
        VK_NV_fragment_shader_barycentric v1
        VK_NV_glsl_shader v1
[mvk-info] GPU device:
        model: Apple A9X GPU
        type: Integrated
        vendorID: 0x106b
        deviceID: 0x100303eb
        pipelineCacheUUID: 000027D8-1003-03EB-0000-000000000000
    supports the following Metal Versions, GPU's and Feature Sets:
        Metal Shading Language 3.0
        GPU Family Apple 3
        GPU Family Apple 2
        GPU Family Apple 1
        GPU Family Common 2
        GPU Family Common 1
        iOS GPU Family 3 v4
        iOS GPU Family 3 v3
        iOS GPU Family 3 v2
        iOS GPU Family 3 v1
        iOS GPU Family 2 v5
        iOS GPU Family 2 v4
        iOS GPU Family 2 v3
        iOS GPU Family 2 v2
        iOS GPU Family 2 v1
        iOS GPU Family 1 v5
        iOS GPU Family 1 v4
        iOS GPU Family 1 v3
        iOS GPU Family 1 v2
        iOS GPU Family 1 v1
[mvk-info] Created VkInstance for Vulkan version 1.2.0, as requested by app, with the following 3 Vulkan extensions enabled:
        VK_KHR_get_physical_device_properties2 v2
        VK_KHR_surface v25
        VK_MVK_ios_surface v3
2023-05-05 09:50:45.067405-0300 networh[937:346758] Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple A9X GPU
Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple A9X GPU
2023-05-05 09:50:45.067509-0300 networh[937:346758] USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot.
2023-05-05 09:50:45.067581-0300 networh[937:346758]    at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1336)
USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot.
   at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1336)
2023-05-05 09:50:45.067622-0300 networh[937:346758] USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
2023-05-05 09:50:45.067651-0300 networh[937:346758]    at: _window_create (drivers/vulkan/vulkan_context.cpp:1681)
USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
   at: _window_create (drivers/vulkan/vulkan_context.cpp:1681)
2023-05-05 09:50:45.067896-0300 networh[937:346758] USER ERROR: Failed to create Vulkan window.
2023-05-05 09:50:45.067925-0300 networh[937:346758]    at: DisplayServerIOS (platform/ios/display_server_ios.mm:84)
USER ERROR: Failed to create Vulkan window.
   at: DisplayServerIOS (platform/ios/display_server_ios.mm:84)
2023-05-05 09:50:45.067979-0300 networh[937:346758] USER ERROR: Unable to create DisplayServer, all display drivers failed.
2023-05-05 09:50:45.068369-0300 networh[937:346758]    at: setup2 (main/main.cpp:2066)
USER ERROR: Unable to create DisplayServer, all display drivers failed.
   at: setup2 (main/main.cpp:2066)
2023-05-05 09:50:45.168861-0300 networh[937:346758] USER ERROR: Condition "!_start_success" is true. Returning: false
2023-05-05 09:50:45.168953-0300 networh[937:346758]    at: start (main/main.cpp:2445)
USER ERROR: Condition "!_start_success" is true. Returning: false
   at: start (main/main.cpp:2445)
Calinou commented 1 year ago

@cchipont Please surround large blocks of text with triple backticks like this:

``` text here ```

This prevents them from taking too much space and also makes sure issue references aren't accidentally created. I edited your comment, but remember to do this next time :slightly_smiling_face:


First-gen iPad Pro lacks full MoltenVK support, like the iOS simulator. Use the Compatibility rendering method when targeting old hardware in general.

We could disable the check for 2D projects, but lacking support for cubemap arrays will break any shaded 3D rendering (as cubemap arrays are used to store the radiance maps for PBR). If you want to try this on your own, remove the check in the source code then compile an iOS export template.

clayjohn commented 1 year ago

We discussed this on chat a bit. It seems like we can improve the situation somewhat by only failing when cubemap arrays are actually used. This should not be too difficult but it will require a few changes:

  1. Add image_cube_arrays to RD::has_feature() https://github.com/godotengine/godot/blob/8c729f0f34a92b92a1a8204e1d56b6ad05cfd27b/drivers/vulkan/rendering_device_vulkan.cpp#L9390
  2. Check for image cube array support before allocating them throughout the Renderer. Many places we can automatically fall back to non array versions (i.e. sky can use non array cubemap), other features like ReflectionProbes just won't be available.
  3. Check for image cube array support in the shader compiler and fail to compile shader if they are used. Provide a useful error message to the user in this case.

Additionally, we need to add documentation about this requirement somewhere as it will likely catch devs by surprise when they ship their game

cchipont commented 1 year ago

We discussed this on chat a bit. It seems like we can improve the situation somewhat by only failing when cubemap arrays are actually used. This should not be too difficult but it will require a few changes:

Thanks for considering this guys, it would be highly appreciated.

lostminds commented 1 year ago

Ran into this today as I was testing out the new 4.2dev1 build, hoping to get support for the mobile renderer on some older iOS devices (iPad Air 2 and older iPhones) with https://github.com/godotengine/godot/issues/70013 marked as fixed with the new replacement for sampler arrays https://github.com/godotengine/godot/pull/77740 . However, even with this improvement it now fails due to the image cube arrays instead.

2023-07-20 08:32:48.805606+0200 vlobs[532:12259] Metal GPU Frame Capture Enabled
2023-07-20 08:32:48.806147+0200 vlobs[532:12259] Metal API Validation Enabled
2023-07-20 08:32:49.318377+0200 vlobs[532:12259] USER ERROR: AudioOutputUnitStart failed, code: -50
2023-07-20 08:32:49.318630+0200 vlobs[532:12259]    at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:251)
2023-07-20 08:32:49.338291+0200 vlobs[532:12259] Godot Engine v4.2.dev1.official.0c2144da9 - https://godotengine.org
2023-07-20 08:32:49.446308+0200 vlobs[532:12259] Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple A8X GPU
2023-07-20 08:32:49.446428+0200 vlobs[532:12259] USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot.
2023-07-20 08:32:49.446540+0200 vlobs[532:12259]    at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1336)
2023-07-20 08:32:49.446611+0200 vlobs[532:12259] USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
2023-07-20 08:32:49.446669+0200 vlobs[532:12259]    at: _window_create (drivers/vulkan/vulkan_context.cpp:1681)
2023-07-20 08:32:49.446911+0200 vlobs[532:12259] USER ERROR: Failed to create Vulkan window.
2023-07-20 08:32:49.446978+0200 vlobs[532:12259]    at: DisplayServerIOS (platform/ios/display_server_ios.mm:88)
2023-07-20 08:32:49.447046+0200 vlobs[532:12259] USER ERROR: Unable to create DisplayServer, all display drivers failed.
2023-07-20 08:32:49.447103+0200 vlobs[532:12259]    at: setup2 (main/main.cpp:2217)
2023-07-20 08:32:49.448286+0200 vlobs[532:12259] USER ERROR: Condition "!_start_success" is true. Returning: false
2023-07-20 08:32:49.448395+0200 vlobs[532:12259]    at: start (main/main.cpp:2600)

I'm not sure when these are used, but if it would be possible to support these devices by avoiding to use cubemaps it would be great. It would make it much easier to distribute games on iOS via the app store as it would not only allow for broader compatibility, but currently you can't really guarantee that people who can buy your game on the app store can actually run it on their devices.

clayjohn commented 1 year ago

@lostminds Please see my comment above explaining the steps needed to resolve this issue https://github.com/godotengine/godot/issues/74227#issuecomment-1536567159

lostminds commented 1 year ago

While waiting for a more substantial fix to this issue, perhaps removing the need for cubemap support to broaden iOS device support as detailed above by @clayjohn . Would it be possible to just add the UIRequiredDeviceCapabilities key iphone-ipad-minimum-performance-a12 to exported iOS projects using Vulkan renderers? As I understand it this will make sure that only devices that we are sure will be able to run the game can buy and download the apps on the app store by requiring an A12 or later GPU (all post 2018 iOS devices). Even if it will also block some A11 GPU devices (iPhone X and iPhone 8) that might (?) be able to run the mobile renderer it will ensure that people with unsupported A9 and A10 devices cannot buy the games in the app store and then just get a black screen when they try to start it.

This could just be added as another capabilities property in the iOS export configuration, along with the existing wifi access and push notifications toggles, for example capabilities/a12_gpu_performance and be enabled by default if the project uses a vulkan renderer.

Previously I believed setting the required iOS version to iOS 16 would have this effect, but I've since learned there are several older iOS devices that can run iOS 16, but cannot run Godot mobile renderer: the rare first gen iPad pro as mentioned, but also the more common 7th gen iPad and iPhone 7 with the A10 GPU.

georgwacker commented 1 year ago

You can manually add the key for iphone-ipad-minimum-performance-a12 in your info.plist.

But it's a shame that Apple doesn't have a similar key for A11 or A10.

The mobile renderer works fine on my iPhone 8 with A11, with 4.1.1-stable.

According to Apple, the iPhone 7 only supports iOS 15. But it looks like there are still devices left, that you can't filter out by arm64 or iOS 16 as min-target.

7th gen iPad is A10, the iPad Pro is A9X. If I understood correctly, if the cubemap check is implemented, those devices would work with the vulkan mobile renderer? Having the simulator work would be fantastic as well.

ChibiDenDen commented 1 year ago

Just removing the check in vulkan_context.cpp will let godot run on most mentioned iOS devices (simulator for example), as long as cubemaps are really not used (I think its basically means reflections and some other advanced features).

I do not recommend just removing the check, but maybe adding code to the project to detect the missing cubemaps support and "disable" these features can be possible.

darksylinc commented 1 year ago

Btw in OgreNext we deal with this issue by converting all cubemap arrays into a 2D array of dual-paraboloid textures.

darksylinc commented 1 year ago

Here's a pixel shader fullscreen pass that converts a cubemap into a 2D DP map.

clayjohn commented 1 year ago

Btw in OgreNext we deal with this issue by converting all cubemap arrays into a 2D array of dual-paraboloid textures.

@darksylinc You prefer DP over Octahedral in this case?

darksylinc commented 1 year ago

Octahedral is also good. I just forgot about it because I'm more familiar with DP.

1974LIO commented 1 year ago

Use OpenGL3 with Godot 4.1.2 / Project settings / Renderer (all x3 to gl_compatibility) Then Export for iOS. Build for iPad Air A7 (first generation). iOS : 12.5.7 on Macbook M2 Pro. Works perfect !

migueldeicaza commented 1 year ago

I tried the above configuration on a M2 and does not work on the simulator.

I keep getting:

USER ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:106)

Followed by this about once a second, and a blank display:

DrawView: 506 error
1974LIO commented 1 year ago

I tried the above configuration on a M2 and does not work on the simulator.

I keep getting:

USER ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:106)

Followed by this about once a second, and a blank display:

DrawView: 506 error

You right. Simulator won't display : Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple iOS simulator GPU USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot. at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1336)

georgwacker commented 1 year ago

I did some testing with v4.2.dev.custom_build.691634969 and compiled debug libs for iOS and the Simulator. My current project is mostly just control nodes and GPU particles in 2D, using Vulkan Mobile. After removing the cubemap check in vulkan_context.cpp, I had to also disable the depthClamp feature. With that, the simulator actually booted up the game, but with lots of errors:

Godot Engine v4.2.dev.custom_build.691634969 - https://godotengine.org
Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple iOS simulator GPU
Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple iOS simulator GPU
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
USER ERROR: Error (-8) creating descriptor set layout for set 2
   at: shader_create_from_bytecode (drivers/vulkan/rendering_device_vulkan.cpp:5199)
USER ERROR: Condition "!particles_storage->particles_shader.shader.version_is_valid(version)" is true.
   at: set_code (servers/rendering/renderer_rd/storage_rd/particles_storage.cpp:1651)
USER ERROR: Parameter "shader" is null.
   at: uniform_set_create (drivers/vulkan/rendering_device_vulkan.cpp:5434)
USER ERROR: Error (-8) creating descriptor set layout for set 2
   at: shader_create_from_bytecode (drivers/vulkan/rendering_device_vulkan.cpp:5.199)
USER ERROR: Condition "!particles_storage->particles_shader.shader.version_is_valid(version)" is true.
   at: set_code (servers/rendering/renderer_rd/storage_rd/particles_storage.cpp:1.651)
USER ERROR: Parameter "shader" is null.
   at: uniform_set_create (drivers/vulkan/rendering_device_vulkan.cpp:5.434)
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
USER ERROR: Error (-8) creating descriptor set layout for set 1
   at: shader_create_from_bytecode (drivers/vulkan/rendering_device_vulkan.cpp:5199)
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
USER ERROR: Error (-8) creating descriptor set layout for set 1
   at: shader_create_from_bytecode (drivers/vulkan/rendering_device_vulkan.cpp:5199)
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple iOS simulator GPU does not support arrays of textures.
USER ERROR: Error (-8) creating descriptor set layout for set 1

Unsurprisingly the particles do not work, with the shader not correctly setup.

scripturial commented 1 year ago

but also the more common 7th gen iPad and iPhone 7 with the A10 GPU

Yes, I am here because I discovered after migrating from Godot 3.5 to Godot 4.1.3 my app no longer works on a bunch of older iPad's and they are this "7th Generation" iPad running iOS 16. They are what, 4 years old I think? I think people upgrade their iPad's much less frequently than their phones, so it's kind of a "must support" thing.

Additionally, we need to add documentation about this requirement somewhere as it will likely catch devs by surprise when they ship their game

Ummm.... Yes :) I appreciate all the improvements y'all are working on, but this one was a little frustrating to run into. It's been one long chain of "oh that doesn't work" , "oh that doesn't work", etc..... If there is a way to smooth this one over it would be helpful. I don't think my app is even that complicated, it's a bunch of control nodes with some tweens and audio. There are no 3D graphics or shaders or effects or anything that I am aware of. Perhaps the documentation or help popups could mention a few devices that need "compatibility" mode to make the impact of choosing "mobile" clear to developers? Perhaps even the error log message in Xcode could hint towards "compatibility" mode in some way?

I did some testing with v4.2.dev.custom_build.691634969 and compiled debug libs for iOS and the Simulator. My current project is mostly just control nodes and GPU particles in 2D, using Vulkan Mobile. After removing the cubemap check in vulkan_context.cpp, I had to also disable the depthClamp feature. With that, the simulator actually booted up the game, but with lots of errors.

Can we get this in 4.1 without much extra work? It feels to me that Godot 4 should a iPad that was purchased 4 or 5 years ago. People really don't upgrade their iPad's that often? Although just making it clear that compatibility mode is probably needed for a simple project to be backwards compatible might be enough?

On a related side note, The dropdown menu on the top right where you change from "Mobile" to "Compatibility" didn't update the "Rendering" -> "Rendering Method.mobile" setting in 4.1.3. So when I tested "Compatibility" mode it still failed in iOS/iPad. But then I went into the project settings panel and saw that "Rendering Method.mobile" was still set to mobile. I don't know if that is intended, but it definitely confused me for a bit until I discovered it.

image
Calinou commented 1 year ago

Can we get this in 4.1 without much extra work?

You can make the same change in the 4.1.3 source code and recompile the iOS export template in the same way. As per the release policy, a proper fix won't be backported to 4.1.x as it implies feature development (adding a fallback for devices that don't support the required Vulkan/MoltenVK features at a hardware level).

On a related side note, The dropdown menu on the top right where you change from "Mobile" to "Compatibility" didn't update the "Rendering" -> "Rendering Method.mobile" setting in 4.1.3. So when I tested "Compatibility" mode it still failed in iOS/iPad. But then I went into the project settings panel and saw that "Rendering Method.mobile" was still set to mobile. I don't know if that is intended, but it definitely confused me for a bit until I discovered it.

See https://github.com/godotengine/godot/pull/72461.

oxygen commented 7 months ago

This comment is for those bumping into this thread.

For this error (A9 CPU not supported because cubemaps), getting Godot 4.2.1 to run on iPhone 6S (A9 CPU, ~10 years old) was possible by setting the mobile renderer to gl_compatibility. I don't have other details, I'm just evaluating Godot.

On an Android 4-5yo CPU low end device I'm also getting under 20 fps using mobile renderer (is it vulkan?) for a simple test with 400 simple distinct (no gpu instancing) objects. No iPhone issues on performance (comparably old devices) using either renderer.

Also, on mobile renderer, on an Android low end device there's touch latency as FPS drops (why would the CPU be affected?), and some buffer for touch move fills slowly until it releases the events (touch start had no issues) - didn't get this with the gl_compatibility renderer.

Zireael07 commented 7 months ago

was possible by setting the mobile renderer to gl_compatibility.

That's pretty obvious as this bypasses the entire problem by using OpenGL instead of Vulkan

djrain commented 3 months ago

We discussed this on chat a bit. It seems like we can improve the situation somewhat by only failing when cubemap arrays are actually used. This should not be too difficult but it will require a few changes

Any progress on this, by chance? We are not able to add the iphone-ipad-minimum-performance-a12 requirement since our game shipped without it, and Apple does not let you add requirements in updates :/

akien-mga commented 3 months ago

I guess the solution for this should be to have support for falling back to OpenGL (Compatibility) when using Forward+/Mobile? https://github.com/godotengine/godot-proposals/issues/8006

Calinou commented 3 months ago

I guess the solution for this should be to have support for falling back to OpenGL (Compatibility) when using Forward+/Mobile? https://github.com/godotengine/godot-proposals/issues/8006

This will help, but only if we make sure the fallback executes when the missing requirement is detected (it might be too far along in Vulkan initialization when this is detected right now).