dioxus-native panics with no usable GPU; a software adapter costs a lot of CPU

Open
#1,505 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by reading the dioxus-native renderer setup and the linked Blitz commit, which shows a renderer enum and a gpu-cpu-fallback feature. Check the anyrender dependencies noted in the issue: startup failure reporting and damage support in vello_cpu. Done means apps fall back to vello_cpu over softbuffer when GPU startup fails or only a CPU adapter is available, with an is_cpu() signal for apps.

Written by the indexing model from the issue text.

Description

A-Dioxus-Native A-Shell B-AnyRender C-Bug I-Crash

With no usable GPU (no Vulkan driver, a VM, or a remote session), dioxus-native's default vello_hybrid renderer panics while creating its surface or device, and the app exits. On a software adapter (llvmpipe, lavapipe, WARP) it runs, but every frame rasterises the whole window in software through the GPU API, so a small animation costs several cores.

Suggestion: when vello_hybrid can't start, or finds only a DeviceType::Cpu adapter, fall back to vello_cpu over softbuffer, which can repaint just an animation's damage.

What we carry (https://github.com/krazyjakee/blitz/commit/6b3d683f, a gpu-cpu-fallback feature) does that through a renderer enum. It also exposes is_cpu(), so an app can lighten its look. It depends on anyrender changes: a failed start reported instead of a panic (DioxusLabs/anyrender#32) and damage in vello_cpu (DioxusLabs/anyrender#149). Measured on lavapipe, a running spinner went from 22.7% to 0.56% of a core.

Dominant language
Rust
Stars
4.5k
Forks
281
Avg merge
6h 6m
Merged PRs (30d)
184

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 DioxusLabs/blitz

All issues in DioxusLabs/blitz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.