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 Early Access Testing (Android) #2787

Closed
louwers opened this issue Aug 30, 2024 · 26 comments · Fixed by #3056
Closed

Vulkan Early Access Testing (Android) #2787

louwers opened this issue Aug 30, 2024 · 26 comments · Fixed by #3056

Comments

@louwers
Copy link
Collaborator

louwers commented Aug 30, 2024


We are looking for users interested in the upcoming Vulkan support for Android.

We will be releasing an 'early access' MapLibre Android version (a.k.a. pre-release) that will just support Vulkan in September 2024. This will give people an opportunity to test the new Vulkan backend on Android. Joining this effort will help the rendering team to ensure there are no regressions as well as with optimizing performance.

Edit: the first pre-release has been released!

Reporting Issues

When reporting an issue (here or in a separate issue), the following are required:

  • Style: If your style is public or can be made available, that will help a lot.
  • Lat / Long / Zoom: Where exactly does the issue occur?
  • Screenshot
  • Android version
  • MapLibre Native version
  • Device

When available:

  • Stack Trace / Vulkan Error / Core Dump
  • Minimal style: Can you provide a minimal style that reproduces the issue?
@westnordost
Copy link
Collaborator

I could create some alpha releases alongside the stable ones for StreetComplete (once the MapLibre migration has been stabilized in the first place) for people to try out.

Beyond detecting simple rendering issues, this only makes sense if there's a straightforward way for these users to make useful reports for crashes in native / Vulkan code. I understand that the logged crash trace is not that useful for you and digging out the tombstone seems to require root privileges on the phone and/or usage of developer tools (adb), plus some special build configuration (we haven't fully figured out yet) beforehand.

Also, how would you sell it to users so they want to be the first people to try it out? Is there anything to gain from that?

@louwers
Copy link
Collaborator Author

louwers commented Aug 30, 2024

I could create some alpha releases alongside the stable ones for StreetComplete (once the MapLibre migration has been stabilized in the first place) for people to try out.

That would be amazing!

Also, how would you sell it to users so they want to be the first people to try it out? Is there anything to gain from that?

Being an early tester and testing it with your style and app means that any bugs or performance regressions you report will have the attention of the rendering team, and will probably be fixed by the time we make an official release.

@mtpdog
Copy link

mtpdog commented Aug 31, 2024

I can take part too to test It in complex environment with many raster, vector and extruded layers.
Btw, the latest 2 versions (both 11.1.0 and 11.2.0) have a regression with vector layers rendering. There are many distortions in label rendering. 11.0.2-pre0 is the latest stable version for now.

@louwers
Copy link
Collaborator Author

louwers commented Aug 31, 2024

@mtpdog Please create a separate issue for the regressions you are seeing.

@mtpdog
Copy link

mtpdog commented Aug 31, 2024

@mtpdog Please create a separate issue for the regressions you are seeing.

Sure. It is already described here: #2788

@louwers
Copy link
Collaborator Author

louwers commented Sep 6, 2024

Labels are jittery with this style.

video_2024-09-07_01-05-09.mp4

Style - https://tiles.versatiles.org/assets/styles/colorful.json
Lat / Long / Zoom - Try London
Android version - 11
MapLibre Native version - android-v11.3.0-vulkan-pre0
Device - Samsung S10

@mtpdog
Copy link

mtpdog commented Sep 20, 2024

According to my tests, this version (android-v11.3.0-vulkan-pre0) works mostly fine except for:

  • It currently works not so great in terms of speed/micro-lags compared to OpenGL version
  • There is an issue with some tiles not rendered until zoom-in / zoom-out action (probably this issue exists in OpenGL versions as well starting from 11.2.0):
    Screenshot_vulkan

On the positive side it seems that this issue is fixed: #2788

@louwers
Copy link
Collaborator Author

louwers commented Sep 20, 2024

@mtpdog I think the issue you are seeing may be fixed by #2842

@westnordost
Copy link
Collaborator

westnordost commented Sep 23, 2024

I tested android-v11.3.0-vulkan-pre0 with StreetComplete. I didn't find any issues. On the contrary, the following issues are not reproducible anymore with that version:

I didn't compare performance, but I didn't feel any difference.

@louwers
Copy link
Collaborator Author

louwers commented Sep 23, 2024

I ran some benchmarks on AWS Device Farm with various devices. The results can be found here and in the diagram below.

Graph: https://github.com/user-attachments/assets/3260933c-fc85-45ac-a38d-29856b32d07e

We are a bit suspicious that the Pixel 7 Pro is comparable to the Pixel 4a in terms of performance. The results look promising though.

@louwers
Copy link
Collaborator Author

louwers commented Oct 23, 2024

We did another extensive benchmark run comparing OpenGL (here indicated as Drawable) and Vulkan!

Note the y-axis on the plot below here is a version with equal y-axis range for all devices, but since there is quite a big difference in FPS between devices the differences can be hard to see on some devices.

Graph: https://github.com/user-attachments/assets/b2157018-6652-4877-b4bf-d96477203137

Raw data: https://docs.google.com/spreadsheets/d/1roKpT7BrLFErZE8r_-hd4uMk74znVbB-7Eo3JvPj8zE/edit?usp=sharing

@louwers
Copy link
Collaborator Author

louwers commented Nov 10, 2024

We did a new run last week which moved slower from location to location. This is too prevent the situation where no data is loaded and the map is not rendering anything (resulting in very high but meaningless FPS in some runs). I think we can improve the benchmark by running it completely offline and starting the benchmark with a pre-loaded cache.

I have made a PR with some scripts to automate running the benchmarks, as well as for collecting and plotting the results. #2991

The results of the last run:

benchmark.csv

Plot:

https://github.com/user-attachments/assets/4ff47faa-2c5a-4786-bace-8df5ee560028

@louwers
Copy link
Collaborator Author

louwers commented Nov 20, 2024

We now have a new version up with the name 11.6.1-vulkan-pre0. Please give it a spin!

We're very eager to know if your feedback, also if it just works. We can include your name in the official release post (if you want).

@westnordost
Copy link
Collaborator

westnordost commented Nov 20, 2024

I can reproduce this issue (screen rotate doesn't re-create the activity in my app), but as you see, only every 5th or so time it produces the issue:

Screen-20241120-135912.mp4

@westnordost
Copy link
Collaborator

Still reproducible with pre1.

Also, I get these error messages on each rotate (always):

2024-11-20 19:33:22.247 10509-10698 GraphicBufferAllocator  de.westnordost.streetcomplete.debug  E  Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
2024-11-20 19:33:22.247 10509-10698 AHardwareBuffer         de.westnordost.streetcomplete.debug  E  GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
2024-11-20 19:33:22.247 10509-10698 GraphicBufferAllocator  de.westnordost.streetcomplete.debug  E  Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
2024-11-20 19:33:22.248 10509-10698 AHardwareBuffer         de.westnordost.streetcomplete.debug  E  GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
2024-11-20 19:33:22.306 10509-10644 OpenGLRenderer          de.westnordost.streetcomplete.debug  E  Unable to match the desired swap behavior.
2024-11-20 19:33:22.309 10509-10698 GraphicBufferAllocator  de.westnordost.streetcomplete.debug  E  Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
2024-11-20 19:33:22.309 10509-10698 AHardwareBuffer         de.westnordost.streetcomplete.debug  E  GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
2024-11-20 19:33:22.309 10509-10698 GraphicBufferAllocator  de.westnordost.streetcomplete.debug  E  Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
2024-11-20 19:33:22.309 10509-10698 AHardwareBuffer         de.westnordost.streetcomplete.debug  E  GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0

@mtpdog
Copy link

mtpdog commented Nov 28, 2024

11.6.1-vulkan-pre1 works very well in our case! Now it definitely works faster than OpenGL. Great job!

P.S. Can we try to increase map tilt limits on this new engine? #1909

@louwers
Copy link
Collaborator Author

louwers commented Nov 28, 2024

Thanks for trying it out! W.r.t. your comment, that's off-topic here since it's unrelated to Vulkan. But I replied there.

@mtpdog
Copy link

mtpdog commented Nov 29, 2024

The only small issue I've noticed so far with 11.6.1-vulkan-pre1 is that all vector elements (vector maps, annotations) do not "stick" firmly to the raster background on quick camera movements. They kind of floating around their normal positions. Probably the vector and raster parts of rendering are not synchronized perfectly. Would be great if this is fixed as well.

@mtpdog
Copy link

mtpdog commented Nov 29, 2024

Another possible issue (need further analysis). The vulkan map does not scale properly. Put it into a composable surface and try to change the bounds - the map content is not scaled.

@louwers
Copy link
Collaborator Author

louwers commented Nov 29, 2024

@mtpdog Oh that sounds like something that needs fixing. Could you open separate issues for these problems, ideally with some screenshots to show the problem?

@sargunv
Copy link
Collaborator

sargunv commented Dec 3, 2024

Seeing some odd shaking with labels on pre1:

Screen_Recording_20241202_170357_maplibre-compose-demo.mp4

Also some white artifacts (noticeable in the water) when zooming in and out very quickly:

Screen_Recording_20241202_170424_maplibre-compose-demo.mp4

Otherwise, looks good! This is with the OpenFreeMap "bright" style and this branch of maplibre-compose.

@ianthetechie
Copy link
Collaborator

Somewhat similar to the white artifact reported above, there seem to be some issues with the emulator. I've reproduced it with the MapLibre demo tiles:

Image

To repro, check out the maplibre-11 branch here: https://github.com/Rallista/maplibre-compose-playground/tree/maplibre-11. Then run the demo app. The Map Callback example is the most trivially reproducible, but most examples exhibit the behavior in the initial viewport; for others it will invariably show up with some zooming or panning and doesn't go away until you move the map.

@louwers
Copy link
Collaborator Author

louwers commented Dec 3, 2024

@ianthetechie Did you mean to upload a video?

cc @adrian-cojocaru

@ianthetechie
Copy link
Collaborator

No, I just uploaded a screenshot on purpose, but I can upload a video too if it's helpful ;) (Yes, it's an ugly demo, but its sole function was to show how to manipulate the camera haha).

Screen_recording_20241203_201818.webm

@louwers
Copy link
Collaborator Author

louwers commented Dec 3, 2024

@ianthetechie Ahh I thought the two lines were part of the UI. Understood!

@louwers
Copy link
Collaborator Author

louwers commented Dec 12, 2024

Thanks for testing everyone! Please open a new issue if you encounter any other problems.

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

Successfully merging a pull request may close this issue.

5 participants