#Massive Frame Drops

32 messages · Page 1 of 1 (latest)

silver sequoia
#

Hey guys, I am just figuring out a simple platformer test and I cam accross massive frame drops (down to 30fps). I have no idea what is causing this.

My first guess was that i was using avian2d, so i tried it with rapier2d. Unfortunately it was a similar experience. When i removed physics completely the drops were still there.

I also tried removing the optimizations and building in release mode. Nothing helped.

If somebody has any suggestions, this would be super helpful!

The code it has three branches: main is with avian2d, then there is rapier and no physics.

GitHub

Contribute to marekzan/elemental development by creating an account on GitHub.

thorn plover
#

At a glance, I don't see anything wrong here. Huh. Can you back track and figure out when you saw the performance drop?

silver sequoia
#

unfortunately I only have an initial commit and no way of tracing back, when things started breaking. I also thought that it might have to do something with my system but when i start other peoples examples there seem to be no drops.

#

Maybe I should start from scratch and test every change until i may experience these drops again :/... bummer

thorn plover
#

Out of curiosity, could you try without any gamepad input and use keyboard? The only thing I can think of, and it's a stretch, is some kind of controller driver issue causing the slowdown.

silver sequoia
#

I tried but without luck. I started a new clean project with only a camera, a sprite and the fps log. And even then my frames drop below 30 without doing anything... Maybe It is my System afterall. I am going to run some tests and get back here when I am done. Thanks for your help guys!

mental tundra
#

Are you running with --release?

#

If yes use tracy to figure out why it's still slow

#

Also post the system info that bevy logs on startup

topaz dagger
#

I cloned the main branch and ran it in debug, and I only had the fps drop below 60 at most 20-30 times, just when the app was starting, and after that there were no drops whatsoever and I also took a quick glance and the code doesn't seem to be doing anything wrong...

mental tundra
#

Debug performance will be wayy worse than release, don't look at debug for perf

topaz dagger
#

I just meant that even in debug I didn't have any problems really

mental tundra
#

Main has a lot of perf improvements coming for rendering, but for a mostly project it shouldn't really matter

topaz dagger
#

Main branch of their repo, as there was 3 branches not bevy main, sorry for being unclear

mental tundra
#

ah ok

silver sequoia
# mental tundra Are you running with --release?

i ran it in debug and in --release mode. i had optimizations on and also without them. could it be that i use the ldd linker?

anyway i disabled vsync and i am now using immediate as presentation mode. this fixes at least my development.

I have the feeling that it has something to do with my system and setup.

Thanks for the reccomendation with tracy. going to try that and report back soon.

#
❯ WGPU_BACKEND=vulkan cargo run
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.16s
     Running `target/debug/elemental`
2025-02-22T23:00:24.347425Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux rolling EndeavourOS", kernel: "6.13.3-arch1-1", cpu: "Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz", core_count: "8", memory: "31.2 GiB" }
2025-02-22T23:00:24.420365Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8710, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "570.86.16", backend: Vulkan }
2025-02-22T23:00:24.597763Z  INFO gilrs_core::platform::platform::gamepad: Gamepad /dev/input/event27 (Xbox Wireless Controller) connected.
2025-02-22T23:00:24.638312Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2025-02-22T23:00:24.638343Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 0.7999979654947916

these are the logs when starting in debug mode

topaz dagger
#

Seems fine to me...

mental tundra
#

Linker won't affect perf

#

Your system should be plenty fast, so if it's slow when running in release mode, use tracy to find out why

silver sequoia
#

hmmm i think i need to go down a very deep rabbit hole for this ^^

#

yes, gonna try that, thank you both of you!

#

maybe i should also try to run it on windows and see if the drops are also present with vsync on

mental tundra
#

Could be, linux drivers for nvidia GPUs tend to be bad afaik

silver sequoia
#

yeah unfortunately

mental tundra
#

I have a very similar system (5800x, 3080) and Bevy runs at 60fps for me at 4k, so your system should be fine. Drivers being weird is likely, especially since it's only when running with vsync.

#

I'm on windows

silver sequoia
#

i am considering switching to radeon for so long now... maybe it's about time

silver sequoia
#

tried that too and no luck 😦

#

Just tried it on Windows and the frame rate is stable with vsync on. So it is definitly my linux setup.

silver sequoia
#

i used tracy to see whats going on but me being a beginner, this is very hard to read. i have marked 3 frames where the middle one had the drop. if anyone has the time or if someone has fun in analyzing this i can share a link to the trace file. but that would be too much to ask for from you guys so i thank you very much for trying to help me. i guess in the long run i am going to buy a radeon and for now i am going to disable vsync and maybe open an issue.