Open s-mayrh opened 2 months ago
fyi: I just closed https://github.com/gfx-rs/wgpu/issues/5756 because for all we know so far it's debug assertions only which can be easily turned off for wgpu
https://github.com/gfx-rs/wgpu/issues/5756#issuecomment-2233157360 is about their slowdown being caused entirely by debug assertions in wgpu. If a bevy project is built in release mode these should be disabled I guess and the release traces should not show much of a difference between bevy 0.13.2 and 0.14. I haven't dug into how to read these trace files yet, but based on similar execution time and the file sizes …
trace-0.13.2-release-wayland.json (140,4 MiB) trace-0.14-release-wayland.json (69,3 MiB)
trace-0.13.2-release-x11.json (94,2 MiB) trace-0.14-release-x11.json (62,8 MiB)
… I am naively assuming the trace files for 0.13.2 contain 1½–2 times the frame cycles in comparision with 0.14. This could possibly point to a different issue. Can someone more specialised check this?
Based on what I previously wrote in Q&A discussion https://github.com/bevyengine/bevy/discussions/9667 I now file this issue because the last update made performance significantly worse. For reference there is also Q&A Discussion https://github.com/bevyengine/bevy/discussions/3821 about bad performance on old versions of bevy on Raspberry Pi 4.
Bevy version
Relevant system information
Raspberry Pi 4 Model B Rev 1.4 CPU: 4 × ARM Cortex-A72 @ 2.0 GHz GPU: Broadcom VideoCore VI (VC6/V3D 4.2.14) @ 600 MHz RAM: 8 GiB Video memory: 7807 MB, Unified memory: yes (from glxinfo)
cargo 1.79.0 (ffa9cf99a 2024-06-03) rustc 1.79.0 (129f3b996 2024-06-10) stable-aarch64-unknown-linux-gnu OS: Manjaro ARM
All package versions are the latest from my distribution:
kernel-release: 6.6.33-2-MANJARO-RPI4 mesa 24.0.2-1 mesa-utils 9.0.0-3 vulkan-broadcom 24.0.2-1 vulkan-mesa-layers 24.0.2-1 vulkan-headers 1:1.3.276-1 vulkan-icd-loader 1:1.3.276-1 vulkan-tools 1:1.3.269-1
attached: vulkaninfo.txt
What's performing poorly?
General performance until 0.13.2 was less than optimal and glitchy, but at least playable in a simple 2D context with sprites. In bevy 0.14 performance is worse: lots of stutters and glitches like in the screenshot below. It's noticeably better on Wayland (
wayland
feature flag enabled): frame rate is higher, it stutters less and the visual glitches are less pronounced, but it's still not pleasant. Only the combination Wayland with bevy 0.13.2 in release mode gives acceptable results.Before and After Traces
All combinations of debug(dev)/release – 0.13.2/0.14 – X11/Wayland: traces-debug.zip traces-release.zip
Additional information
Though bevy says
it seems rendering only utilizes the CPU because the process consumes more than one 2 GHz core. I don't think any (previous or current) version of bevy in either X11 or Wayland mode was even able to utilize the GPU on the Pi 4. The VideoCore VI GPU should be moving 2D sprites around with ease… It plays SuperTuxKart in 720p quite well and Vulkan benchmarks are OK (motion is fluid on Wayland, acceptable on X11):
vkmark results on X11:
vkmark results on Wayland:
I think this is the part of my game that could have the most impact on performance – it's the camera centering on the player:
Before I introduced looking around with the gamepad I had an
Update
filter on the playerTransform
query and had simply assigned the playerTransform
to the camera'sTransform
, but I haven't noticed any change in performance.For comparision: My old Intel Atom abacus
CPU: 4 × x5-Z8350 @ 1,44 GHz GPU: Intel Cherry Trail @ 500 MHz RAM: 4 GiB Video RAM by dxdiag: total 2094 MB, VRAM 114 MB Display adapter RAM by msinfo32: 1 GiB Windows 10
doesn't sweat at all running this same game using Bevy 0.13.2 or 0.14 even in debug mode.