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

Vulkan Mobile: Crash on Samsung Galaxy Tab S2 (SM-T813) #76568

Open
theromis opened this issue Apr 29, 2023 · 24 comments
Open

Vulkan Mobile: Crash on Samsung Galaxy Tab S2 (SM-T813) #76568

theromis opened this issue Apr 29, 2023 · 24 comments

Comments

@theromis
Copy link
Contributor

Godot version

4.0.2

System information

Android

Issue description

Sorry for declaring crash this way, but I can't get backtrace from this device, I've deployed game to google play store and it crashes on this device type, rest of androids works fine.

Steps to reproduce

Just install game from app store, ui works fine and after clicking "Play" app crashes

Minimal reproduction project

https://play.google.com/store/apps/details?id=com.lonje.jumpjump

@theromis
Copy link
Contributor Author

This is everything what I can pull out from google play console

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 6886 >>> com.lonje.jumpjump <<<

backtrace:
  #00  pc 0x00000000000a2c08  /system/vendor/lib64/hw/vulkan.msm8952.so (QglCommandBuffer::DrawIndexed(unsigned int, unsigned int, int, unsigned int, unsigned int)+72)
  #01  pc 0x0000000001c9c454  /data/app/com.lonje.jumpjump-1/lib/arm64/libgodot_android.so

Screenshot 2023-04-28 at 10 45 27 PM

@Calinou Calinou changed the title crash on samsung sm-t813 Crash on Samsung Galaxy Tab S2 (SM-T813) Apr 29, 2023
@Calinou
Copy link
Member

Calinou commented Apr 29, 2023

Which rendering method does the project use (Mobile or Compatibility)? Make sure the .mobile override for the rendering method is correctly set in the Project Settings.

I wouldn't use the Mobile rendering method when targeting Android yet, as only flagships provide acceptable performance with it (and even then, Compatibility will be much faster). Older devices like a Galaxy Tab S2 will also keep struggling with the Mobile rendering method, so you'd have to wait until these become out of the picture (probably in 2-3 years from now).

In general, devices that cannot be updated to Android 9.0 or later have pretty broken Vulkan support (because Vulkan support in general is bad on Android 7.0-8.0).

@theromis
Copy link
Contributor Author

@Calinou yes, I'm using Mobile method, because I'm using "glow" which looks bad in Compatibility method. Performance looks appropriate, but for now seems like have to switch to Compatibility.

@Calinou Calinou changed the title Crash on Samsung Galaxy Tab S2 (SM-T813) Vulkan Mobile: Crash on Samsung Galaxy Tab S2 (SM-T813) Apr 30, 2023
@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

@Calinou tried Compatibility mode, but "glow" seems like not works there at all. Is it possible to run on Mobile method but with OpenGL3 only (no vulkan)?

@Zireael07
Copy link
Contributor

"Mobile" stands for "Vulkan Mobile", so no.

@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

@Zireael07 is there any way to run OpenGL3 only on Godot 4? This is important for mobile gaming.

@Zireael07
Copy link
Contributor

@theromis That's what Compatibility mode is for.

@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

@Zireael07 I thought Compatibility is OpenGL2

@Zireael07
Copy link
Contributor

No, it's OpenGL 3. There's no OpenGL2 in Godot 4 anymore. You are probably getting confused because Godot 3.x used to have OpenGL2 as a low-spec offering, but currently there is almost no devices that don't support 3, so OpenGL 3 is now the low-spec option compared to Vulkan

@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

@Zireael07 thank you for clarification, but why glow and gpuparicles not works in this mode

@Zireael07
Copy link
Contributor

@theromis Because they aren't yet implemented in this mode (same goes for 3d shadows, incidentally). GLES3 was a very late addition to Godot 4 (very recently before beta)

@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

@Zireael07 got it, will research how I can help with it.

@Calinou
Copy link
Member

Calinou commented May 1, 2023

Glow isn't implemented in the Compatibility rendering method yet (there is no ETA for it). You can simulate glow to an extent using billboarded Sprite3Ds.

@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

Just sharing differences between this modes.
Compatibility:
Screenshot 2023-05-01 at 10 12 09 AM
Mobile:
Screenshot 2023-05-01 at 10 14 24 AM
Compatibility:
Screenshot 2023-05-01 at 10 11 44 AM
Mobile:
Screenshot 2023-05-01 at 10 14 54 AM
Am I right, that in 2-3 years planned to not have any differences, just a little performance drop on OpenGL3 because of Vulkan threaded execution?

@Calinou
Copy link
Member

Calinou commented May 1, 2023

Am I right, that in 2-3 years planned to not have any differences, just a little performance drop on OpenGL3 because of Vulkan threaded execution?

The Compatibility rendering method will remain more low-end oriented. It does not aim for feature parity with Forward Mobile.

Also, Vulkan is not necessarily faster than OpenGL. In fact, it can be a lot slower in certain scenes currently. This is also exacerbated by poor Vulkan drivers on Android, which are unfortunately common. (This comment is not exclusive to Godot – many emulators also exhibit better performance when using an OpenGL backend compared to Vulkan, especially on NVIDIA graphics cards.)

@theromis
Copy link
Contributor Author

theromis commented May 1, 2023

@Calinou this is was great explanation, thank you, I really want make godot better (at least for my game LOL) please point me where I can take glow implementation for Vulkan and I'll adopt it for OpenGL3.

Also I can see artifacts on rubics cube in compatibility mode only, is it somehow related to drivers? but probably just not optimized model.

@Calinou
Copy link
Member

Calinou commented May 1, 2023

I really want make godot better (at least for my game LOL) please point me where I can take glow implementation for Vulkan and I'll adopt it for OpenGL3.

It's more complicated than that; you can't just copy-paste the implementation from a Vulkan renderer to an OpenGL-based one. See #66455.

Also I can see artifacts on rubics cube in compatibility mode only, is it somehow related to drivers? but probably just not optimized model.

Can you take a screenshot and precisely point out the artifacts?

@theromis
Copy link
Contributor Author

theromis commented May 2, 2023

@Calinou
Copy link
Member

Calinou commented May 2, 2023

@Calinou about artifact just look at it here user-images.githubusercontent.com/3720229/235495227-cfbf9612-cc2f-4516-85c0-5299adaddcd9.png

Can you upload a minimal reproduction project?

@theromis
Copy link
Contributor Author

theromis commented May 2, 2023

Will create tonight, about glow seems like it about FXAA #69463 (comment)
can I pull it from https://github.com/naturally-intelligent/godot-4-glow-2d ?

@theromis
Copy link
Contributor Author

theromis commented May 2, 2023

@Calinou after reboot this artifact went away, seems like my local issues.

I think Godot philosophy looses one key point, in most cases mobile developers prefer loose performance for stability, and "Compatibility mode" is very important for mobile dev, I mean having same functionality as "Mobile mode" just maybe giving some warnings/notifications you are using FXAA it will significantly slow down mobile platform but give ability to avoid linking with Vulkan.

@whendricso
Copy link

Confirmed, bug and issue found on Galaxy Tab S2.

Suggestion: default to compatibility mode renderer after the editor crashes on Android

@whendricso
Copy link

whendricso commented May 22, 2023

Just sharing differences between this modes. Compatibility: (screenshots removed for length) Am I right, that in 2-3 years planned to not have any differences, just a little performance drop on OpenGL3 because of Vulkan threaded execution?

I agree, we should aim to have no noticeable differences but actually achieving that ideal is quite an undertaking.

Let's focus on the fact that you can soft-lock your project (causing the editor to crash on startup) if you set your render mode to anything but "compatibility" on certain devices.

Therefore, I propose that we remedy the soft-lock situation first by opening the editor in compatibility mode by default if it crashed during the previous session, perhaps with a warning or popup

@Calinou
Copy link
Member

Calinou commented May 22, 2023

Therefore, I propose that we remedy the soft-lock situation first by opening the editor in compatibility mode by default if it crashed during the previous session, perhaps with a warning or popup

The issue is that we don't have a way to detect whether the app previously crashed on Android, since we currently lack a crash handler there. Implementing an Android crash handler like we have on desktop platforms isn't trivial.

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

No branches or pull requests

5 participants