gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.18k stars 896 forks source link

Tracking Issue for Wgpu on Raspberry Pi 4 #1069

Open cwfitzgerald opened 3 years ago

cwfitzgerald commented 3 years ago

Description

Summary of all current issues and todos for a seamless raspbery pi 4 experience. Most of these will be driver issues and will also be found on https://github.com/gfx-rs/wgpu/wiki/Known-Driver-Issues. Links to upstream issues will be added as they are filed.

Unless listed otherwise, this was tested on mesa commit a1976e1cb2d817a4d5229994b83c87d82485af9b.

Shadow

There is sporatic corruption of the shadows that pops in weird ways. Video here: https://cwfitz.com/zFpfee.mp4.

Upstream bug filed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3916

Water

Water works fine until you resize it, then the water looks to have some sort of block-based corruption. If you get lucky when you resize it'll go back to normal. This might be caused by https://github.com/gfx-rs/wgpu-rs/issues/665 as the issue doesn't show up on a pre gfx-master version of wgpu.

Cube

Cube works correctly most of the time, but random frames will have the vertex order reversed so the lines go the other way through the square faces.

andrewdavidmackenzie commented 1 year ago

I am currently (master, Dec 15 2022) on Pi4 seeing:

'No suitable GPU adapters found on the system!'

Am I right in assuming this is the correct open issue to track?

cwfitzgerald commented 1 year ago

It is, but if you have a vulkan implementation it should at least find an adapter.

Lokathor commented 1 year ago

sudo apt install vulkan-tools mesa-vulkan-drivers will now install the vulkan drivers on raspberry pi os. If you run a vulkan using program it'll print a message as it loads that technically the driver isn't fully conformant and it's for testing only, but the program will render.

I didn't test any of the examples from this repo specifically (i was checking out the minimal-winit example from pixels, which uses wgpu). If you want I can possibly check more soon.

anselanza commented 1 year ago

Indeed, pixels does work on the Raspberry Pi 4 as mentioned, after installing the Vulkan V3D driver, but I cannot get the built-in examples from WGPU to run.

The following error is typical:

WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
Using V3D 4.2 (Vulkan)
[2023-05-25T13:39:35Z ERROR wgpu::backend::direct] Error in Adapter::request_device: Not enough memory left
thread 'main' panicked at 'Unable to find a suitable GPU adapter!: RequestDeviceError', wgpu/examples/cube/../framework.rs:236:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The Not enough memory part seems important. I have tried running this on both a standard 4GB Pi 4 as well as an 8GB model - both with GPU RAM set to 256MB rather than the default 64MB. Same error on both.

anselanza commented 1 year ago

These errors only occur on v0.16.0 and v0.16.1.

If I check out v0.15, the same version Pixels appears to depend on, then the built-in WGPU examples do indeed run using Vulkan on the Pi 4.