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

Low frame rate of with_winit demo on Android devices #765

Open
EFanZh opened this issue Dec 11, 2024 · 6 comments
Open

Low frame rate of with_winit demo on Android devices #765

EFanZh opened this issue Dec 11, 2024 · 6 comments

Comments

@EFanZh
Copy link

EFanZh commented Dec 11, 2024

I tested the with_winit demo with an Android device, the frame rate is very low (about 10 fps). The command I used to run the demo is:

cargo apk run -p with_winit --lib --release

Here is a screenshot of the demo:

Is Android an intended platform for vello? Is this frame rate expected with the current implementation?

@DJMcNab
Copy link
Member

DJMcNab commented Dec 11, 2024

Is Android an intended platform for vello?

Yes

Is this frame rate expected with the current implementation?

It likely depends on your device. On my Pixel 6, with_winit at 2e2cb16 runs at 90fps. 10fps is extraordinarily low, which suggests a broken or possibly software Vulkan implementation.
We have plans for downlevel fallbacks for devices without a powerful GPU, but that's not a near-term priority.

@EFanZh
Copy link
Author

EFanZh commented Dec 11, 2024

We have plans for downlevel fallbacks for devices without a powerful GPU

Does this mean that the current implementation inherently requires a relatively powerful GPU? Should I use other render engines like skia for low-end devices, and vello for high-end devices? I am trying to figure out a good solution for developing mobile apps.

@DJMcNab
Copy link
Member

DJMcNab commented Dec 11, 2024

I don't know. The current implementation definitely inherently requires a GPU to be used. As I say, 10fps is unreasonably slow (it's 5 times slower than a laptop integrated graphics card from 12 years ago, according to this thread). Which is why I suspect that you're falling back to a CPU implementation of Vulkan. I'd make sure that all your drivers are up-to-date.

Again, without knowing what device you're using, it's hard to make an good guess here. It is clearly running quite an old version of Android, so possibly the device was released before Vulkan was a requirement, and so just ships LLVMpipe and calls it a day.

@DJMcNab
Copy link
Member

DJMcNab commented Dec 11, 2024

The other thing to try is if setting use_cpu to true improves performance, by using:

VELLO_STATIC_ARGS="--use-cpu" cargo apk run -p with_winit --lib --release

@EFanZh
Copy link
Author

EFanZh commented Dec 12, 2024

The GPU is Adreno 613. And I have found the following app logs, not sure if it can help:

12-12 09:13:20.955 32556 32604 I AdrenoVK-0: QUALCOMM build          : a63fb93269, I16b8254a37
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Build Date              : 08/27/24
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Shader Compiler Version : EV031.36.08.30
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Local Branch            : 
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Remote Branch           : refs/tags/AU_LINUX_ANDROID_LA.VENDOR.1.0.11.00.00.770.073
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Remote Branch           : NONE
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Reconstruct Branch      : NOTHING
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Build Config            : S P 12.1.1 AArch64
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Driver Path             : /vendor/lib64/hw/vulkan.adreno.so
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Driver Version          : 0615.91
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: PFP                     : 0x016ee206
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: ME                      : 0x00000000
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Application Name    : wgpu
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Application Version : 0x00000001
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Engine Name         : wgpu-hal
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Engine Version      : 0x00000002
12-12 09:13:20.955 32556 32604 I AdrenoVK-0: Api Version         : 0x00403000

12-12 09:13:21.075 32556 32604 W wgpu_hal::vulkan::conv: Unrecognized present mode SHARED_DEMAND_REFRESH
12-12 09:13:21.075 32556 32604 W wgpu_hal::vulkan::conv: Unrecognized present mode SHARED_CONTINUOUS_REFRESH
12-12 09:13:21.075 32556 32604 W wgpu_core::instance: Missing downlevel flags: DownlevelFlags(SURFACE_VIEW_FORMATS)
12-12 09:13:21.075 32556 32604 W wgpu_core::instance: The underlying API or device in use does not support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
12-12 09:13:21.075 32556 32604 W wgpu_core::instance: DownlevelCapabilities {
12-12 09:13:21.075 32556 32604 W wgpu_core::instance:     flags: DownlevelFlags(
12-12 09:13:21.075 32556 32604 W wgpu_core::instance:         COMPUTE_SHADERS | FRAGMENT_WRITABLE_STORAGE | INDIRECT_EXECUTION | BASE_VERTEX | READ_ONLY_DEPTH_STENCIL | NON_POWER_OF_TWO_MIPMAPPED_TEXTURES | CUBE_ARRAY_TEXTURES | COMPARISON_SAMPLERS | INDEPENDENT_BLEND | VERTEX_STORAGE | ANISOTROPIC_FILTERING | FRAGMENT_STORAGE | MULTISAMPLED_SHADING | DEPTH_TEXTURE_AND_BUFFER_COPIES | WEBGPU_TEXTURE_FORMAT_SUPPORT | BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED | UNRESTRICTED_INDEX_BUFFER | FULL_DRAW_INDEX_UINT32 | DEPTH_BIAS_CLAMP | VIEW_FORMATS | UNRESTRICTED_EXTERNAL_TEXTURE_COPIES | NONBLOCKING_QUERY_RESOLVE | VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW,
12-12 09:13:21.075 32556 32604 W wgpu_core::instance:     ),
12-12 09:13:21.075 32556 32604 W wgpu_core::instance:     limits: DownlevelLimits,
12-12 09:13:21.075 32556 32604 W wgpu_core::instance:     shader_model: Sm5,
12-12 09:13:21.075 32556 32604 W wgpu_core::instance: }

I have also tried VELLO_STATIC_ARGS="--use-cpu", the result is about the same:

@DJMcNab
Copy link
Member

DJMcNab commented Dec 12, 2024

That GPU seems to be very weak, which isn't what Vello has been optimised for. That being said, a quick search suggests it can have similar performance to the aforementioned 10 year old laptop, not a fifth of that. @raphlinus might be able to give a more compelling answer here.

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

No branches or pull requests

2 participants