Closed dskkato closed 10 months ago
Thanks for the detailed setup log!
I see that it falls back to GL. Not sure if e.g. pygfx works on that backend. A quick Google search suggests that it is possible to install Vulkan on Raspberry Pi. Have you tried that?
I've tried several combinations of X11/Wayland and OpenGL/Vulkan. With X11, both OpenGL and Vulkan worked well. However, there seem to be various issues with Wayland. Wayland + OpenGL failed to launch the cube, and Wayland + Vulkan launched but had frequent tearing.
Wayland | X11 | |
---|---|---|
OpenGL | :x: | :white_check_mark: |
Vulkan | :warning: *1 | :white_check_mark: *2 |
Wayland + OpenGL log
EGL context: -robust access Max vertex shader SSBO == 0 and SSTO != 0. Interpreting as false zero. Re-initializing Gles context due to Wayland window EGL context: -robust access thread '' panicked at /root/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/2e7fd75/wgpu-hal/src/gles/egl.rs:305:14: called `Result::unwrap()` on an `Err` value: BadDisplay note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 966897392
X11 + Vulkan log
EGL context: -robust access Max vertex shader SSBO == 0 and SSTO != 0. Interpreting as false zero. Missing downlevel flags: DownlevelFlags(FULL_DRAW_INDEX_UINT32) The underlying API or device in use does not support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
I checked drivers with wgpu-info, and verified Vuklan drivers were installed.
After installation of Vulkan driver
sudo apt install mesa-vulkan-drivers
Here is current test results on X11/OpenGL backend environment.
For Wayland, it may be knowe issues. See https://github.com/pygfx/wgpu-py/issues/92 for example.
I believe all that's left is (as mentioned elsewhare) to wait for the release on CI, so I will close this issue. There is still the pending task of building for armv7, it seems like it would be quite labor-intensive, involving preparations for armv7 container image (manylinux or Raspberry Pi base).
Thanks for this!
It looks like the hardware of the Pi is just not good enough to meet the requirements to be wgpu standard compliant. What it does then is move to "downlevel", which is a set of easier requirements. Most test failures seem to be related to unsupported texture formats (or no filtering supported for certain textures).
I'm curious to see how well pygfx still runs on it, but we can try that another day.
There is still the pending task of building for armv7,
I think what we have now is probably enough for now.
Here is test logs running on Raspberry Pi 4B. I have no knowledge of the pygfx test cases and have not checked the logs.
Vulkan backend
=========================== short test summary info ============================
FAILED examples/tests/test_examples.py::test_examples_run[offscreen] - TypeEr...
FAILED tests/renderers/test_reactivity.py::test_reactivity_mesh3 - wgpu._clas...
====== 2 failed, 278 passed, 21 skipped, 3 warnings in 743.31s (0:12:23) =======
OpenGL backend
=========================== short test summary info ============================
FAILED examples/tests/test_examples.py::test_examples_run[offscreen] - TypeEr...
FAILED tests/renderers/test_reactivity.py::test_reactivity_mesh1 - wgpu._clas...
FAILED tests/renderers/test_reactivity.py::test_reactivity_mesh2 - wgpu._clas...
FAILED tests/renderers/test_reactivity.py::test_reactivity_mesh3 - wgpu._clas...
FAILED tests/renderers/test_reactivity.py::test_change_blend_mode - wgpu._cla...
FAILED tests/renderers/test_reactivity.py::test_two_renders_with_same_blend_modes
FAILED tests/renderers/test_reactivity.py::test_two_renders_with_different_blend_modes
====== 7 failed, 273 passed, 21 skipped, 3 warnings in 715.57s (0:11:55) =======
This is not issues, but setup log for Raspberry Pi 4B
Tentative Summary
Only 64 bit OS is supported
Switch to X11 if the desktop uses wayland
(Optional) If you try, use Vulkan backend
Device info
Hardware : Raspberry Pi 4 Model B Rev 1.5
OS : Raspberry Pi OS (64 bit)
default Python version : 3.11.2
Setup
wgpu
clone & install
I used my own release artifact : https://github.com/dskkato/wgpu-native/releases/tag/v0.18.1.4 .
Just after the installation of
wgpu-py
, it says some libraries are missing:Add dependencies:
Still, it does not work
GLES backend seems not to work now.
Install Vulkan driver:
Now, cube appeared !!
But, obvious tearing was observed frequently. It may be related to that the latest Rraspberry OS uses wayland by default.
In X11, Tearing seems to be less frequent but not completely gone. See the following link how to switch wayland and X11.
https://raspberrypi.stackexchange.com/questions/144866/can-i-use-x11-on-the-new-64-bit-os-instead-of-wayland
TBA : Ubuntu version