Unable to run quad example on Raspberry Pi 3
Basic Info
- GFX version: master (f288599e34e536ee406edd3cab81589ab29dc784)
- OS: Raspbian (Debian) 9.4
- GPU: Part of SoC (Broadcom BCM2837)
- Device: Raspberry Pi 3 B
- OpenGL Version: 2.1
Backstory
I'm trying to build a dashboard of sorts that will run on a Raspberry Pi. I originally started off using piston_window but was encountering an error initialising the window (DescriptorInit(PixelExport("Target0", None))).
After much trial an error I found that if I manually built the window (without piston_window) the application works. View the code here.
However in this version the colours of the photos are off (too light) in the way described in https://github.com/PistonDevelopers/piston_window/issues/139. Looking at what piston_window does that my manual config does not, suggests that it's the sRGB shader causing the problem.
I spent some time in gdb which led me to gfx and running the quad example as a possibly smaller test case, which leads me to now.
Error
Running the quad example on the Raspberry Pi yields this output:
libGL error: MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
AdapterInfo { name: "Gallium 0.4 on VC4 V3D 2.1", vendor: 0, device: 0, device_type: DiscreteGpu }
Memory types: [MemoryType { properties: DEVICE_LOCAL, heap_index: 1 }, MemoryType { properties: COHERENT | CPU_VISIBLE, heap_index: 0 }, MemoryType { properties: COHERENT | CPU_VISIBLE | CPU_CACHED, heap_index: 0 }]
formats: Some([Rgba8Unorm, Bgra8Unorm])
SwapchainConfig { present_mode: Fifo, format: Rgba8Unorm, extent: Extent2D { width: 956, height: 1041 }, image_count: 2, image_layers: 1, image_usage: COLOR_ATTACHMENT }
resized to LogicalSize { width: 956.0, height: 1041.0 }
SwapchainConfig { present_mode: Fifo, format: Rgba8Unorm, extent: Extent2D { width: 956, height: 1041 }, image_count: 2, image_layers: 1, image_usage: COLOR_ATTACHMENT }
thread 'main' panicked at 'Error InvalidEnum executing command: BindBlendSlot(0, ColorBlendDesc(RED | GREEN | BLUE | ALPHA | COLOR | ALL, On { color: Add { src: SrcAlpha, dst: OneMinusSrcAlpha }, alpha: Add { src: One, dst: OneMinusSrcAlpha } }))', src/backend/gl/src/queue.rs:671:13
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
3: std::panicking::default_hook
at libstd/panicking.rs:227
4: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:511
5: std::panicking::continue_panic_fmt
at libstd/panicking.rs:426
6: std::panicking::begin_panic_fmt
at libstd/panicking.rs:413
7: gfx_backend_gl::queue::CommandQueue::process
at src/backend/gl/src/queue.rs:671
8: <gfx_backend_gl::queue::CommandQueue as gfx_hal::queue::RawCommandQueue<gfx_backend_gl::Backend>>::submit_raw
at /home/pi/gfx/src/backend/gl/src/queue.rs:716
9: <gfx_hal::queue::CommandQueue<B, C>>::submit
at /home/pi/gfx/src/hal/src/queue/mod.rs:115
10: quad::main
at examples/quad/main.rs:678
11: std::rt::lang_start::{{closure}}
at /checkout/src/libstd/rt.rs:74
12: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:310
13: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
14: std::panicking::try
at libstd/panicking.rs:289
15: std::rt::lang_start_internal
at libstd/panic.rs:392
at libstd/rt.rs:58
16: std::rt::lang_start
at /checkout/src/libstd/rt.rs:74
17: main
18: __libc_start_main
Possibly Related:
- #977
- https://github.com/PistonDevelopers/piston_window/issues/139
Other Info
cc @ZeGentzy We don't have https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_draw_buffers_blend.txt on GLES (at least not on this one).
Currently busy with school work, so I won't have time to take a look at this for a couple days.
@kvark Since he is on GLES 2.0, the correct extension that he is missing is https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_draw_buffers_indexed.txt
Anyways, I've made changes to get the gl backend to get it to work with OpenGL 3.0 (see: https://github.com/gfx-rs/gfx/pull/2475). Sadly however, I couldn't figure out how to "emulate" OpenGL ES on my desktop rig, so I couldn't really work at fixing this issue.
Seems like it has been a long time since this issue was revisited, however, would like to ask if there was any progress?
I'd also like to see a fix or workaround for this, as I am trying to get my application working on Raspberry Pi 3 B+
I'm running Raspbian 10 on an RPi 3 B, with the "OpenGL desktop driver with full KMS" driver enabled. The quad example starts, I see the outline of the window, and then I get a panic.
$ cargo run --bin quad --features=gl
Finished dev [unoptimized + debuginfo] target(s) in 0.68s
Running `/home/pi/Downloads/gfx/target/debug/quad`
thread 'main' panicked at 'egl function was not loaded', /home/pi/Downloads/gfx/target/debug/build/surfman-0059b393076dde6f/out/egl_bindings.rs:284:13
I can post a full backtrace if it will help. It also seems like there might be some overlap between this issue and #3085 . I'm happy to try things out if it will help troubleshoot this issue.
Some more detailed system info:
Model B detected with 1024 MB (948 Sys/76 GPU)
Raspbian GNU/Linux 10 (buster)