wgpu-native
wgpu-native copied to clipboard
Panicking Thread on WSL2: Error in wgpuSurfaceGetPreferredFormat: unsupported format
Reporting here because the error asks me to!
I was running the following script from the pygfx README:
import pygfx as gfx
import pylinalg as la
cube = gfx.Mesh(
gfx.box_geometry(200, 200, 200),
gfx.MeshPhongMaterial(color="#336699"),
)
rot = la.quat_from_euler((0, 0.01), order="XY")
def animate():
cube.local.rotation = la.quat_mul(rot, cube.local.rotation)
if __name__ == "__main__":
gfx.show(cube, before_render=animate)
When running the script (with the RUST_BACKTRACE
environment variable set), I receive the following error, observed both with Qt and glfw windows:
thread '<unnamed>' panicked at src/lib.rs:3849:17:
Error in wgpuSurfaceGetPreferredFormat: unsupported format.
Please report it to https://github.com/gfx-rs/wgpu-native
stack backtrace:
0: rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
2: wgpuSurfaceGetPreferredFormat
3: ffi_call_unix64
4: ffi_call_int
5: cdata_call
at /project/src/c/_cffi_backend.c:3201:5
6: _PyObject_Call
at /usr/local/src/conda/python-3.11.9/Objects/call.c:343:19
7: PyObject_Call
at /usr/local/src/conda/python-3.11.9/Objects/call.c:355:12
8: do_call_core
at /usr/local/src/conda/python-3.11.9/Python/ceval.c:7349:12
9: _PyEval_EvalFrameDefault
at /usr/local/src/conda/python-3.11.9/Python/ceval.c:5376:22
10: _PyEval_EvalFrame
at /usr/local/src/conda/python-3.11.9/Include/internal/pycore_ceval.h:73:16
11: _PyEval_Vector
at /usr/local/src/conda/python-3.11.9/Python/ceval.c:6434:24
12: _PyFunction_Vectorcall
at /usr/local/src/conda/python-3.11.9/Objects/call.c:393:16
13: _PyObject_FastCallDictTstate
at /usr/local/src/conda/python-3.11.9/Objects/call.c:141:15
14: _PyObject_Call_Prepend
at /usr/local/src/conda/python-3.11.9/Objects/call.c:482:24
15: slot_tp_init
at /usr/local/src/conda/python-3.11.9/Objects/typeobject.c:7855:15
16: type_call
at /usr/local/src/conda/python-3.11.9/Objects/typeobject.c:1103:19
17: _PyObject_MakeTpCall
at /usr/local/src/conda/python-3.11.9/Objects/call.c:214:18
18: _PyEval_EvalFrameDefault
at /usr/local/src/conda/python-3.11.9/Python/ceval.c:4769:23
19: _PyEval_EvalFrame
at /usr/local/src/conda/python-3.11.9/Include/internal/pycore_ceval.h:73:16
20: _PyEval_Vector
at /usr/local/src/conda/python-3.11.9/Python/ceval.c:6434:24
21: PyEval_EvalCode
at /usr/local/src/conda/python-3.11.9/Python/ceval.c:1148:21
22: run_eval_code_obj
at /usr/local/src/conda/python-3.11.9/Python/pythonrun.c:1741:9
23: run_mod
at /usr/local/src/conda/python-3.11.9/Python/pythonrun.c:1762:19
24: pyrun_file
at /usr/local/src/conda/python-3.11.9/Python/pythonrun.c:1657:15
25: _PyRun_SimpleFileObject
at /usr/local/src/conda/python-3.11.9/Python/pythonrun.c:440:13
26: _PyRun_AnyFileObject
at /usr/local/src/conda/python-3.11.9/Python/pythonrun.c:79:15
27: pymain_run_file_obj
at /usr/local/src/conda/python-3.11.9/Modules/main.c:360:15
28: pymain_run_file
at /usr/local/src/conda/python-3.11.9/Modules/main.c:379:15
29: pymain_run_python
at /usr/local/src/conda/python-3.11.9/Modules/main.c:601:21
30: Py_RunMain
at /usr/local/src/conda/python-3.11.9/Modules/main.c:680:5
31: Py_BytesMain
at /usr/local/src/conda/python-3.11.9/Modules/main.c:734:12
32: <unknown>
33: __libc_start_main
34: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
pygfx: 0.2.0 wgpu: 0.15.3 System: Ubuntu 22.04.3 LTS, WSL2
Notably, the script runs just fine on Windows.