wgpu-native
wgpu-native copied to clipboard
Triangle example fails (RHEL7)
With current git tip, I see a brief flicker and the application immediately terminates.
cd examples/triangle && "build/triangle"
[Warn] Unable to find layer: VK_LAYER_KHRONOS_validation
[]WGPUFeatureName {
Depth32FloatStencil8
TimestampQuery
PipelineStatisticsQuery
TextureCompressionBC
TextureCompressionETC2
TextureCompressionASTC
IndirectFirstInstance
WGPUNativeFeature_PUSH_CONSTANTS
WGPUNativeFeature_TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
WGPUNativeFeature_MULTI_DRAW_INDIRECT
WGPUNativeFeature_VERTEX_WRITABLE_STORAGE
}
[Warn] Missing extensions: ["VK_KHR_timeline_semaphore"]
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 149 ()
Minor opcode of failed request: 4
Serial number of failed request: 179
Current serial number in output stream: 185
EDIT:
I've found others describing experiencing this issue on the internet, but nothing I find clear yet. They mention unmapped windows and GL.
The crash appears to happen in the second call to glfwGetWindowSize
. The first call completes fine.
(gdb) bt
#0 0x00007ffff65e5eb0 in XGetWindowAttributes () from /lib64/libX11.so.6
#1 0x000000000041a0ad in _glfwPlatformGetWindowSize (window=0x49ecc0, width=0x7fffffffd24c, height=0x7fffffffd248) at /home/user/src/glfw/src/x11_window.c:2201
#2 0x000000000040f41c in glfwGetWindowSize (handle=0x49ecc0, width=0x7fffffffd24c, height=0x7fffffffd248) at /home/user/src/glfw/src/window.c:551
#3 0x0000000000405386 in main () at /home/user/src/wgpu-native/examples/triangle/main.c:285
EDIT: Here is an xtrace log.
EDIT: I modified the source to select GL as primary backend rather than Vulkan, and experienced the below. Note: the .c line numbers are off because I added extra statements to try to narrow the earlier issue down (it turns out it was triggered after setting the swap chain). I thought I did pass RUST_BACKTRACE=full, even though it complains. I could have made a typo setting the environment variable. :
cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
cd examples/triangle && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/src/wgpu-native/examples/triangle/build
gmake[1]: Entering directory `/shared/src/wgpu-native/examples/triangle/build'
gmake[2]: Entering directory `/shared/src/wgpu-native/examples/triangle/build'
gmake[3]: Entering directory `/shared/src/wgpu-native/examples/triangle/build'
Consolidate compiler generated dependencies of target triangle
gmake[3]: Leaving directory `/shared/src/wgpu-native/examples/triangle/build'
[100%] Built target triangle
gmake[2]: Leaving directory `/shared/src/wgpu-native/examples/triangle/build'
gmake[1]: Leaving directory `/shared/src/wgpu-native/examples/triangle/build'
cd examples/triangle && "build/triangle"
thread '<unnamed>' panicked at 'invalid AdapterId', src/lib.rs:184:5
stack backtrace:
0: rust_begin_unwind
at /builddir/build/BUILD/rustc-1.65.0-src/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /builddir/build/BUILD/rustc-1.65.0-src/library/core/src/panicking.rs:142:14
2: core::panicking::panic_display
at /builddir/build/BUILD/rustc-1.65.0-src/library/core/src/panicking.rs:72:5
3: core::panicking::panic_str
at /builddir/build/BUILD/rustc-1.65.0-src/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /builddir/build/BUILD/rustc-1.65.0-src/library/core/src/option.rs:1880:5
5: core::option::Option<T>::expect
at /builddir/build/BUILD/rustc-1.65.0-src/library/core/src/option.rs:738:21
6: <*mut wgpu_native::native::WGPUAdapterImpl as wgpu_native::native::UnwrapId<wgpu_core::id::Id<wgpu_core::instance::Adapter<wgpu_hal::empty::Api>>>>::unwrap_handle
at /shared/src/wgpu-native/src/lib.rs:138:33
7: wgpuAdapterEnumerateFeatures
at /shared/src/wgpu-native/src/device.rs:183:30
8: printAdapterFeatures
at /home/user/src/wgpu-native/examples/framework.c:136:18
9: main
at /home/user/src/wgpu-native/examples/triangle/main.c:179:3
10: __libc_start_main
11: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
[Warn] No config found!
[Warn] EGL says it can present to the window but not natively
/bin/sh: line 1: 10211 Aborted (core dumped) "build/triangle"
make: *** [run-example-triangle] Error 134
NOTE: the glfw examples run fine for me.