Android Vulkan: Adreno 830 GPU hangs with GPU preprocessing and indirect draws

Open
#26,691 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start with Bevy's GPU preprocessing and indirect draw paths, then review the readiness work referenced in #26245/#26246. The report does not name source files or tests, and its full game is the only reproducer; begin by investigating how GPU-generated draw arguments are initialized and consumed on Vulkan. Done means identifying a cause or producing a minimal reproducer and validating a fix on the Adreno 830.

Written by the indexing model from the issue text.

Description

C-Bug S-Needs-Triage

Bevy version and environment

We are developing a 3D game using Bevy and have been investigating a GPU hang on the Samsung Galaxy S25 Ultra.

Our tested environment:

  • Bevy: 0.20.0
  • wgpu: 30.0.1
  • Device: Samsung Galaxy S25 Ultra (SM-S938B)
  • OS: Android 16
  • Architecture: ARM64
  • GPU: Qualcomm Adreno 830
  • Graphics backend: Vulkan
  • Driver: Qualcomm Adreno Vulkan Driver
  • Driver build: 0603ba43d2
  • Driver ID: Id52d3f334b
  • Driver build timestamp: 1782110333
  • Driver build date: June 22, 2026

Relevant driver information:

Adapter: Adreno (TM) 830
Backend: Vulkan

Driver Build: 0603ba43d2, Id52d3f334b, 1782110333
Date: 06/22/26
Compiler Version: E031.47.18.56

We have reproduced this repeatedly on the same physical device.

We have not established whether the problem also affects other Adreno GPUs or driver versions.

What happened?

Our game has a procedurally generated open world with terrain, water, vegetation, characters, shadows, and other 3D objects.

On the Galaxy S25 Ultra, the game sometimes freezes shortly after entering the world.

The problem is intermittent. Some launches work normally, while others fail within the first few seconds of rendering the world.

We have observed several forms of failure:

  1. The game stops rendering and eventually reports DeviceLost.
  2. The render thread blocks inside vkQueueSubmit or vkQueuePresentKHR.
  3. The GPU stops responding for several seconds without reporting DeviceLost.
  4. Some failures affect the device's graphics system beyond our application's window.
  5. In some cases, the application cannot be reopened normally until its process is terminated.

During the investigation, some stalls lasted 10–13 seconds per frame and happened on consecutive frames.

The failure does not always produce a useful Vulkan error.

A rendering error handler alone is therefore not sufficient to recover from it.

What we expected

The game should load the world and continue rendering without freezing or losing the GPU device.

If a GPU feature is not reliable on this driver, we would expect Bevy to disable that feature or use a safer rendering path.

We would also like to understand whether this is caused by Bevy, wgpu, or the Qualcomm Vulkan driver.

We are not claiming that the root cause is known.

What we found

After investigating several parts of Bevy's rendering pipeline, we found a strong relationship between the failure and GPU-generated indirect draws.

Bevy uses GPU preprocessing to prepare mesh instance data. On supported devices, it can also perform GPU culling and generate the parameters used by indirect draw commands.

On the Adreno 830, the game is unstable when using this full GPU-driven path.

We tested three configurations:

Configuration Result
GPU preprocessing and GPU-generated indirect draws enabled Failures reproduced
GPU preprocessing enabled, but indirect draws disabled No failures in the tested runs
GPU preprocessing disabled; instance data prepared on CPU and drawn directly No failures in the tested runs

The second result is particularly useful.

It suggests that GPU compute work by itself is not enough to trigger the failure in our tests.

The problem appears to require the path where the GPU builds indirect draw arguments and those arguments are later used for drawing.

This does not prove which specific operation is wrong.

Controlled test results

We ran repeated cold launches of the actual game on the S25 Ultra.

We interleaved the test configurations rather than running all launches of one configuration before the next, to reduce the effect of device temperature and test order.

Our primary comparison was:

Rendering configuration Failed launches
Bevy's normal GPU preprocessing and indirect draws 9 / 42
CPU preprocessing and direct draws 0 / 42

The difference was statistically significant (Fisher's exact test, approximately p = 0.0024).

We also tested GPU preprocessing without GPU-generated indirect draws:

Rendering configuration Failed launches
GPU preprocessing, direct draws (PreprocessingOnly) 0 / 30

Earlier testing also found:

  • Normal GPU preprocessing: 17 / 87 failures.
  • CPU preprocessing: 0 / 87 failures.

These were separate test blocks, so we do not treat all the numbers as one combined experiment.

For these tests, a failure includes an actual device loss, an increase in the GPU fault counter, or a rendering stall of at least one second after the loading screen.

Not every failed launch produced a DeviceLost error.

How to reproduce

The reliable reproducer we currently have is our full game running its open-world scene.

Unfortunately, we have not yet reproduced the problem in a small standalone Bevy example. I explain what we tried below.

In our game, we added launch settings that let us choose the GPU preprocessing mode.

These are application-specific settings, not standard Bevy environment variables.

On Android, we can select the failing path with:

adb shell setprop debug.game.render_gpu_preprocessing on
adb shell setprop debug.game.render_compatibility_marker off
adb shell setprop debug.game.render_stall_exit 8

Then:

  1. Start the application from a cold launch.
  2. Open the generated-world map.
  3. Wait for the loading screen to finish.
  4. Let the game render the world for at least 15 seconds.
  5. Close the application and repeat.

The failure is intermittent, so one or two successful launches do not mean the problem is fixed.

We recommend at least 30 launches per configuration.

To test the safe path, we use:

adb shell setprop debug.game.render_gpu_preprocessing off

To test GPU preprocessing without GPU-generated indirect draws:

adb shell setprop debug.game.render_gpu_preprocessing compute_only

In the code, these correspond to:

  • on: Bevy's normal GPU preprocessing support.
  • compute_only: GpuPreprocessingMode::PreprocessingOnly.
  • off: GpuPreprocessingMode::None.

With the safe configurations, we have not reproduced the GPU hang in the controlled runs described above.

What we already investigated

We spent considerable time trying to isolate the problem before opening this report.

1. Pipeline compilation and initialization

Every recorded GPU loss in one group of nine failures occurred within a frame of a pipeline finishing compilation.

However, pipelines also finished compiling immediately before frames in successful runs.

This is a correlation, not proof that pipeline compilation is responsible.

We also investigated an issue in Bevy 0.20.0's indirect-draw readiness checks.

Some GPU passes that initialize indirect-draw metadata can be unavailable even when other preprocessing pipelines are ready.

We implemented a guard that waits for the missing initialization pipelines.

The guard reduced failures in one small experiment, from 9/15 to 3/15, but did not eliminate them.

We understand that Bevy has also addressed the incomplete readiness check in #26245 / #26246.

That issue is real, but our testing suggests it is not the only cause of the Adreno 830 hang.

2. Indirect draw parameters

We added diagnostics to inspect the GPU-generated indirect draw arguments.

We found entries that exceeded the bounds estimated by our diagnostic code.

We then tested a GPU pass that clamps suspicious entries before drawing.

This did not remove the problem.

The diagnostic can also produce false positives, so these results do not prove that invalid indirect arguments are the cause.

3. Indirect draw variants

We tested indirect drawing without multi_draw_indirect_count.

The GPU still hung.

That suggests the problem is not limited to the counted multi-draw command.

4. Command submission

We split the frame into separate GPU submissions:

  • Commands before the main opaque pass.
  • The main opaque pass.
  • The remaining rendering commands.

This did not reliably remove the failures.

5. Vulkan synchronization

We tested a version of wgpu-hal using fence-based synchronization instead of timeline semaphores.

This did not eliminate the problem.

6. Shader and scene changes

Some changes reduced the failure rate.

For example:

  • Moving water rendering from the blended path to an opaque path reduced failures in one test.
  • Replacing terrain vertex-height texture reads with constant heights also reduced failures.
  • Removing some water rendering reduced failures.

These results suggest that the exact render workload matters.

However, none of these tests established a single faulty shader or a single incorrect command.

We do not want to recommend removing these features as the general solution.

We also tried building a small reproducer

We created a separate rendering scene containing terrain patches and optional water.

We tested configurations with:

  • Hundreds and thousands of terrain patches.
  • Water patches enabled and disabled.
  • Vertex heights read from textures.
  • Constant vertex heights.
  • GPU preprocessing enabled.
  • The safer preprocessing modes.

The small reproducer did not produce the failure.

In one comparison, the reproducer had 0 failures in 60 launches with GPU preprocessing enabled, while the full game failed 6 out of 30 launches in a comparable test period.

This means the reproducer is missing something important.

Possible missing factors include the combination of pipelines created during world loading, scenery, shadow passes, characters, or the order in which those systems become active.

The full game remains our working reproducer.

We want to be transparent about this limitation rather than provide a minimal example that does not actually reproduce the bug.

Vulkan diagnostics

We also investigated the driver's available diagnostic extensions.

The S25 Ultra supports VK_EXT_device_fault.

We added optional Vulkan diagnostic support to our application and queried the driver after a device loss.

So far, this has not given us a useful fault address or a clear description of the failing GPU operation.

Some hangs never return a device-loss error at all. In those cases, the render thread remains blocked and the fault query cannot provide the missing explanation.

We added a watchdog that terminates our application after eight seconds without renderer progress, records the failure, and allows the application to start again.

This is recovery logic, not a fix for the underlying rendering issue.

Our current workaround

We currently disable GPU preprocessing on Adreno 800-series devices using Vulkan.

We implement this by overriding Bevy's GpuPreprocessingSupport before the mesh renderer initializes its pipelines.

The selected mode is:

GpuPreprocessingMode::None

This makes Bevy prepare instance data on the CPU and use the direct-draw path.

The game still renders normally.

Our results show that this avoids the failure on the tested S25 Ultra.

We also support a PreprocessingOnly mode for testing. That configuration was stable in our controlled runs, but we selected the more conservative CPU path for the shipped workaround.

We have not established that every Adreno 800-series GPU needs this workaround.

Ideally, Bevy should use the narrowest compatibility rule supported by actual device and driver testing.

What we would like Bevy to investigate

We would appreciate help answering these questions:

  1. Is there a known issue with GPU-generated indirect draws on Adreno 830 using Vulkan?
  2. Is Bevy missing a required buffer initialization, memory barrier, or dependency between generating indirect arguments and consuming them?
  3. Could the indirect arguments or their associated instance buffers contain data that is valid according to Bevy's assumptions but unsafe for this driver?
  4. Is there another part of Bevy's GPU preprocessing or culling path that should be checked on this hardware?
  5. Should this be investigated in wgpu or wgpu-hal, or reported directly to Qualcomm?
  6. Should Bevy temporarily disable GPU-generated indirect draws on affected Adreno devices, as it already does for some older GPU drivers?
  7. Would it make sense to retain GPU preprocessing but disable GPU-generated indirect draws on affected devices, given that PreprocessingOnly worked in our tests?

We are not asking Bevy to accept our workaround without investigation.

We mainly want to understand where the problem belongs and help establish a safe default for affected devices.

Expected outcome

Ideally, we would like:

  • The actual cause to be identified and fixed, whether in Bevy, wgpu, or a GPU driver.
  • A reliable rendering path on the S25 Ultra without device loss or long GPU stalls.
  • A safe compatibility fallback if the problem requires a driver update.
  • A way to detect when that fallback is no longer necessary.
  • A regression test or reproducible test procedure where practical.

Additional information

Our game is built with Bevy 0.20.0 and runs on Linux, Android, and web.

The Adreno investigation was performed on a real Samsung Galaxy S25 Ultra, not an emulator.

We have:

  • Logs from repeated controlled launches.
  • Results from multiple rendering configurations.
  • GPU fault-counter observations.
  • Render-thread and Vulkan submission diagnostics.
  • The source of our compatibility workaround.
  • The source of the attempted minimal reproducer.
  • A detailed investigation document recording what was tested and what did not work.

I can share the relevant logs, patches, and a test build for further investigation.

We have a working mitigation for our game, but I think this problem is worth investigating upstream because another Bevy application using the same GPU and rendering path could encounter it.

Thank you for taking a look.

Dominant language
Rust
Stars
50k
Forks
5.1k
Avg merge
2d 20h
Merged PRs (30d)
129

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bevyengine/bevy

All issues in bevyengine/bevy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.