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

Many errors and crash during iOS startup on older iPad Air #70013

Closed
lostminds opened this issue Dec 13, 2022 · 13 comments · Fixed by #77740
Closed

Many errors and crash during iOS startup on older iPad Air #70013

lostminds opened this issue Dec 13, 2022 · 13 comments · Fixed by #77740

Comments

@lostminds
Copy link

Godot version

4.0.beta8

System information

iPad Air 2, iOS 15.7, Apple A8X GPU

Issue description

I've recently been testing iOS export, and it generally works very well on newer devices even though there are some errors and warnings in the console during startup. However, when trying to run my project on my slightly older iPad Air 2 I get a ton of errors and the game crashes before reaching the title screen (possibly after initial startup when it tries to load shaders and display the title screen). The title music starts playing, but then screeches to a halt and the game crashes before the splash screen is visually replaced by the title screen.

You can find the full error log here: 4.0.0beta8_ipad_air2_vulcan_errors.txt

We start out with this startup and GPU description:

2022-12-13 10:30:26.876756+0100 vlobs[378:6102] Godot Engine v4.0.beta8.official.c6e40e1c0 - https://godotengine.org
[mvk-info] MoltenVK version 1.2.0, supporting Vulkan version 1.2.231.

...

[mvk-info] GPU device:
		model: Apple A8X GPU
		type: Integrated
		vendorID: 0x106b
		deviceID: 0xf0603ea
		pipelineCacheUUID: 000027D8-0F06-03EA-0000-000000000000
	supports the following Metal Versions, GPU's and Feature Sets:
		Metal Shading Language 2.4
		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

This is then followed by a lot of errors being repeated, but the first one that repeats many times is

[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple A8X GPU does not support arrays of samplers.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple A8X GPU does not support arrays of samplers.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple A8X GPU does not support arrays of samplers.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple A8X GPU does not support arrays of samplers.
[mvk-error] VK_ERROR_FEATURE_NOT_PRESENT: Device Apple A8X GPU does not support arrays of samplers.
2022-12-13 10:30:41.353740+0100 vlobs[378:6347] USER ERROR: Error (-8) creating descriptor set layout for set 0
2022-12-13 10:30:41.354698+0100 vlobs[378:6347]    at: shader_create_from_bytecode (drivers/vulkan/rendering_device_vulkan.cpp:5591)

Followed later by many repetitions of

2022-12-13 10:30:46.880119+0100 vlobs[378:6102] USER ERROR: Condition "!src_texture" is true. Returning: RID()
2022-12-13 10:30:46.880334+0100 vlobs[378:6102]    at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2292)
2022-12-13 10:30:46.880539+0100 vlobs[378:6102] USER ERROR: Attempted to name invalid ID: 0
2022-12-13 10:30:46.880755+0100 vlobs[378:6102]    at: set_resource_name (drivers/vulkan/rendering_device_vulkan.cpp:8932)
2022-12-13 10:30:46.880923+0100 vlobs[378:6102] USER ERROR: All attachments unused.
2022-12-13 10:30:46.881003+0100 vlobs[378:6102]    at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4192)

Along with various other errors.

Basically I interpret this as failures to initialize various shaders and things for the renderer.
This then turns into errors like the following, which I interpret as basically things that are expected to now be in place are not.

2022-12-13 10:30:48.230373+0100 vlobs[378:6102] USER ERROR: Condition "!shader" is true. Returning: RID()
2022-12-13 10:30:48.230564+0100 vlobs[378:6102]    at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6468)
2022-12-13 10:30:48.230650+0100 vlobs[378:6102] USER ERROR: Condition "pipeline.is_null()" is true. Returning: RID()
2022-12-13 10:30:48.230734+0100 vlobs[378:6102]    at: _generate_version (servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61)
2022-12-13 10:30:48.230933+0100 vlobs[378:6102] USER ERROR: Condition "!pipeline" is true.
2022-12-13 10:30:48.231127+0100 vlobs[378:6102]    at: draw_list_bind_render_pipeline (drivers/vulkan/rendering_device_vulkan.cpp:7600)
2022-12-13 10:30:48.231304+0100 vlobs[378:6102] USER ERROR: Condition "!shader" is true. Returning: RID()
2022-12-13 10:30:48.231483+0100 vlobs[378:6102]    at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6468)
2022-12-13 10:30:48.231715+0100 vlobs[378:6102] USER ERROR: Condition "pipeline.is_null()" is true. Returning: RID()
2022-12-13 10:30:48.231878+0100 vlobs[378:6102]    at: _generate_version (servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61)
2022-12-13 10:30:48.232092+0100 vlobs[378:6102] USER ERROR: Condition "!pipeline" is true.
2022-12-13 10:30:48.232238+0100 vlobs[378:6102]    at: draw_list_bind_render_pipeline (drivers/vulkan/rendering_device_vulkan.cpp:7600)

And at this point the game crashes

It could well be that this hardware does not support running the engine with these features. So the issue here might more be that it is either not specifying and testing up front what features it requires (which would just block launching/installing the app) or correctly switching to fallbacks if features are missing and there are alternatives. Or, if this also fails, perhaps failing a bit more gracefully with an error message during startup.

Steps to reproduce

This may be difficult to reproduce, since I think it might be specific to this hardware (and possibly other older iOS devices) and not reproducible without it.

But I'm submitting this with this log in hopes that it might still be helpful as an example to see how failures during the engine initialization are not handled gracefully on iOS.

Minimal reproduction project

See steps to reproduce

@bruvzg
Copy link
Member

bruvzg commented Dec 13, 2022

Device Apple A8X GPU does not support arrays of samplers.

This particular feature require at least Apple A9.

@akien-mga akien-mga modified the milestones: 4.x, 4.0 Dec 13, 2022
@lostminds
Copy link
Author

@bruvzg If we require this Sampler Arrays feature I was thinking about if this could be specified in the UIRequiredDeviceCapabilities listing, but unfortunately I can't find one to specify that an A9 chip is required. There is a iphone-ipad-minimum-performance-a12 key, and I guess that could be used but it would block older (pre 2018) A9-A10-A11 iOS devices that would potentially be able to run Godot games.

Another possible workaround could be to check for iOS version, as it seems iOS 16 has dropped support for older devices pre-A11. So bumping up the MinimumOSVersion would be an indirect requirement of an A11 graphics card or later?

Or is it possible to configure the project in some way not to use/require these array sampler features so we can still support older devices?

@akien-mga
Copy link
Member

You should still be able to use the OpenGL (gl_compatibility) renderer for those.

But for Vulkan there might be a way for us to check whether the feature is supported before using it, if it's not core to the whole setup. CC @clayjohn @BastiaanOlij

@bruvzg
Copy link
Member

bruvzg commented Dec 14, 2022

You should still be able to use the OpenGL (gl_compatibility) renderer for those.

Not implemented on iOS, OpenGL is deprecated so if we do, it probably should be ANGLE.

@akien-mga
Copy link
Member

While deprecated, it should still be able to work like it does currently for 3.x, right? We're just missing setting it up as it wasn't a priority while the GL renderer was WIP.

The Vulkan mobile renderer likely won't be production ready for 4.0 so we do need OpenGL properly exposed for mobile (and indeed we'l probably use ANGLE for iOS eventually but this comes with its own, new challenges, so it would be good IMO to start with exposing OpenGL proper).

@BastiaanOlij
Copy link
Contributor

I think at the moment the way we present samplers is the same between mobile and clustered, I'm not sure off the top of my head if we can make this optional. I don't know enough about MetalVK yet on whether we can get proper feedback if features we rely on are supported on iOS/MacOS..

@bruvzg
Copy link
Member

bruvzg commented Dec 14, 2022

I don't know enough about MetalVK yet on whether we can get proper feedback if features we rely on are supported on iOS/MacOS..

Should be possible to detect it by checking shaderSampledImageArrayNonUniformIndexing in the https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan12Features.html

@BastiaanOlij
Copy link
Contributor

Owh thats interesting because I think we already request that data. The question is if we have made the assumption this feature is widely supported and depend on it, or if we can make it optional. I'm not sure where it's used nor have looked into it deep enough to say anything sensible on that, but it won't be hard to store this somewhere accessible.

@lostminds
Copy link
Author

Still the same as far as I can tell in 4.0 beta 10

@lostminds
Copy link
Author

Some developments after testing again with 4.0b12. It shows a similar amount of errors during startup like before, but now it no longer crashes when loading the first scene. Instead it seems to load and start since I can hear the music and some sound effects playing from the title menu, but all I can see is what looks like the background ambient color and it keeps spitting out errors like these:

``` 2023-01-15 11:20:19.994393+0100 vlobs[330:5070] at: framebuffer_format_get_texture_samples (drivers/vulkan/rendering_device_vulkan.cpp:4114) USER ERROR: Condition "!E" is true. Returning: TEXTURE_SAMPLES_1 at: framebuffer_format_get_texture_samples (drivers/vulkan/rendering_device_vulkan.cpp:4114) 2023-01-15 11:20:19.994610+0100 vlobs[330:5070] USER ERROR: Mismatch fragment shader output mask (1) and framebuffer color output mask (0) when binding both in render pipeline. 2023-01-15 11:20:19.994833+0100 vlobs[330:5070] at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6005) USER ERROR: Mismatch fragment shader output mask (1) and framebuffer color output mask (0) when binding both in render pipeline. at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6005) 2023-01-15 11:20:19.995016+0100 vlobs[330:5070] USER ERROR: Condition "pipeline.is_null()" is true. Returning: RID() 2023-01-15 11:20:19.995079+0100 vlobs[330:5070] at: _generate_version (servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61) USER ERROR: Condition "pipeline.is_null()" is true. Returning: RID() at: _generate_version (servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61) 2023-01-15 11:20:19.995144+0100 vlobs[330:5070] USER ERROR: Condition "!dl" is true. 2023-01-15 11:20:19.995194+0100 vlobs[330:5070] at: draw_list_bind_render_pipeline (drivers/vulkan/rendering_device_vulkan.cpp:7108) USER ERROR: Condition "!dl" is true. at: draw_list_bind_render_pipeline (drivers/vulkan/rendering_device_vulkan.cpp:7108) 2023-01-15 11:20:19.995473+0100 vlobs[330:5070] USER ERROR: Texture (binding: 0, index 0) is not a valid texture. 2023-01-15 11:20:19.995547+0100 vlobs[330:5070] at: uniform_set_create (drivers/vulkan/rendering_device_vulkan.cpp:5464) USER ERROR: Texture (binding: 0, index 0) is not a valid texture. at: uniform_set_create (drivers/vulkan/rendering_device_vulkan.cpp:5464) 2023-01-15 11:20:19.995619+0100 vlobs[330:5070] USER ERROR: Condition "rid.is_null()" is true. Returning: rid 2023-01-15 11:20:19.995711+0100 vlobs[330:5070] at: _allocate_from_uniforms (./servers/rendering/renderer_rd/uniform_set_cache_rd.h:129) USER ERROR: Condition "rid.is_null()" is true. Returning: rid at: _allocate_from_uniforms (./servers/rendering/renderer_rd/uniform_set_cache_rd.h:129) 2023-01-15 11:20:19.995777+0100 vlobs[330:5070] USER ERROR: Condition "!dl" is true. 2023-01-15 11:20:19.995828+0100 vlobs[330:5070] at: draw_list_bind_uniform_set (drivers/vulkan/rendering_device_vulkan.cpp:7182) USER ERROR: Condition "!dl" is true. at: draw_list_bind_uniform_set (drivers/vulkan/rendering_device_vulkan.cpp:7182) 2023-01-15 11:20:19.996097+0100 vlobs[330:5070] USER ERROR: Condition "!dl" is true. 2023-01-15 11:20:19.996253+0100 vlobs[330:5070] at: draw_list_bind_index_array (drivers/vulkan/rendering_device_vulkan.cpp:7255) USER ERROR: Condition "!dl" is true. at: draw_list_bind_index_array (drivers/vulkan/rendering_device_vulkan.cpp:7255) 2023-01-15 11:20:19.996444+0100 vlobs[330:5070] USER ERROR: Condition "!dl" is true. 2023-01-15 11:20:19.996572+0100 vlobs[330:5070] at: draw_list_set_push_constant (drivers/vulkan/rendering_device_vulkan.cpp:7289) USER ERROR: Condition "!dl" is true. at: draw_list_set_push_constant (drivers/vulkan/rendering_device_vulkan.cpp:7289) 2023-01-15 11:20:19.996738+0100 vlobs[330:5070] USER ERROR: Condition "!dl" is true. 2023-01-15 11:20:19.996867+0100 vlobs[330:5070] at: draw_list_draw (drivers/vulkan/rendering_device_vulkan.cpp:7307) USER ERROR: Condition "!dl" is true. at: draw_list_draw (drivers/vulkan/rendering_device_vulkan.cpp:7307) 2023-01-15 11:20:19.996942+0100 vlobs[330:5070] USER ERROR: Immediate draw list is already inactive. 2023-01-15 11:20:19.996996+0100 vlobs[330:5070] at: draw_list_end (drivers/vulkan/rendering_device_vulkan.cpp:7610) USER ERROR: Immediate draw list is already inactive. at: draw_list_end (drivers/vulkan/rendering_device_vulkan.cpp:7610) 2023-01-15 11:20:19.997063+0100 vlobs[330:5070] USER ERROR: Condition "!framebuffer" is true. Returning: INVALID_ID 2023-01-15 11:20:19.997115+0100 vlobs[330:5070] at: draw_list_begin (drivers/vulkan/rendering_device_vulkan.cpp:6860) USER ERROR: Condition "!framebuffer" is true. Returning: INVALID_ID at: draw_list_begin (drivers/vulkan/rendering_device_vulkan.cpp:6860) 2023-01-15 11:20:19.997397+0100 vlobs[330:5070] USER ERROR: Condition "!framebuffer" is true. Returning: INVALID_ID 2023-01-15 11:20:19.997452+0100 vlobs[330:5070] at: framebuffer_get_format (drivers/vulkan/rendering_device_vulkan.cpp:4237) USER ERROR: Condition "!framebuffer" is true. Returning: INVALID_ID at: framebuffer_get_format (drivers/vulkan/rendering_device_vulkan.cpp:4237) 2023-01-15 11:20:19.997517+0100 vlobs[330:5070] USER ERROR: Condition "!E" is true. Returning: TEXTURE_SAMPLES_1 2023-01-15 11:20:19.997568+0100 vlobs[330:5070] at: framebuffer_format_get_texture_samples (drivers/vulkan/rendering_device_vulkan.cpp:4114) USER ERROR: Condition "!E" is true. Returning: TEXTURE_SAMPLES_1 at: framebuffer_format_get_texture_samples (drivers/vulkan/rendering_device_vulkan.cpp:4114) 2023-01-15 11:20:19.997735+0100 vlobs[330:5070] USER ERROR: Mismatch fragment shader output ```

So, it now doesn't crash, and some things seems to be making it onto screen, but no UI elements or meshes or shaders.

@lostminds
Copy link
Author

Some further improvement, or at least more graceful failing. Now in 4.0b16 if I try to run it I get substancially fewer and easier to understand errors, like these the debug log:

USER ERROR: Your GPU doesn't support image cube arrays which are required to use the Vulkan-based renderers in Godot.
...

USER ERROR: Unable to create DisplayServer, all display drivers failed.
...

USER ERROR: Condition "!_start_success" is true. Returning: false

And no crash on launch.

I'd say that's probably good enough for development testing to understand what's going wrong. So maybe you can close this issue if you think it's good enough.

But on the device it just shows a black screen. Maybe some form of user-directed feedback like a message saying the device isn't supported or something like that could be nice as well? Especially since the app is still possible to download and launch on unsupported devices? But that I guess could be a separate improvement proposal.

@clayjohn
Copy link
Member

It would be really nice if we had a system popup or something that explained this so users don't have to rely on the logs.

@lostminds
Copy link
Author

After now releasing my little iOS game on the app store it's now been tested by a wider array of devices and I've encountered some further incompatibilities (basically player who just get a black screen as stated above). In my testing and research I had previously concluded that iOS 16 required iOS hardware of the same or greater level as the features Godot mobile renderer does, so while you can't specify the hardware requirements for the iOS app I figured I could specify that it requires iOS 16 and get the hardware feature support indirectly (hence the min OS version request).

This does seem to hold up mostly, but with the notable exception of some older iPad pro models. Apparently they support iOS 16, but not the graphics requirements of Godot. While it's not a huge problem since iPad pros aren't a big share of the user base it's a quality issue since it means you currently can't guarantee all people who can buy the app on the Apple app store can actually run it if you use the Godot mobile renderer.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants