Piston-Tutorials
Piston-Tutorials copied to clipboard
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Builds okay, but when run I get the following:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:868
stack backtrace:
1: 0x55dae5c5871c - std::sys::imp::backtrace::tracing::imp::write::hf33ae72d0baa11ed
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
2: 0x55dae5c5b60e - std::panicking::default_hook::{{closure}}::h59672b733cc6a455
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:351
3: 0x55dae5c5b214 - std::panicking::default_hook::h1670459d2f3f8843
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:367
4: 0x55dae5c5baab - std::panicking::rust_panic_with_hook::hcf0ddb069e7beee7
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:555
5: 0x55dae5c5b944 - std::panicking::begin_panic::hd6eb68e27bdf6140
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:517
6: 0x55dae5c5b869 - std::panicking::begin_panic_fmt::hfea5965948b877f8
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:501
7: 0x55dae5c5b7f7 - rust_begin_unwind
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:477
8: 0x55dae5c81d8d - core::panicking::panic_fmt::hc0f6d7b2c300cdd9
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/panicking.rs:69
9: 0x55dae5aa332b - core::result::unwrap_failed::h8a94a56502743d2d
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/macros.rs:29
10: 0x55dae5aa1990 - <core::result::Result<T, E>>::unwrap::hfec4dff162fe3e84
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:745
11: 0x55dae5abcbc1 - spinning_square::main::h02d59ab51d564f5f
at /home/tony/code/rust/gametest/src/main.rs:53
12: 0x55dae5c6253a - __rust_maybe_catch_panic
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
13: 0x55dae5c5bfb6 - std::rt::lang_start::hd7c880a37a646e81
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:436
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panic.rs:361
at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/rt.rs:57
14: 0x55dae5abcff2 - main
15: 0x7fe472c78510 - __libc_start_main
16: 0x55dae5a9e189 - _start
17: 0x0 - <unknown>
Please let me know any other information you may need.
Hello, @tm-nihonsuki !
It looks like issue with your video card. I will check my own system in a few hours.
Please give us basic info about your system - OS, graphic card, your video drivers (in case of Linux)
Moreover please write result of rustup show
(or provide version of rustc that you use)
OS is:
4.10.8-1-MANJARO #1 SMP PREEMPT Fri Mar 31 18:50:09 UTC 2017 x86_64 GNU/Linux
Graphic card is:
*-display
description: VGA compatible controller
product: Richland [Radeon HD 8650G]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 1
bus info: pci@0000:00:01.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
configuration: driver=fglrx_pci latency=0
resources: irq:35 memory:d0000000-dfffffff ioport:5000(size=256) memory:f0400000-f043ffff memory:c0000-dffff
rustup show gives:
Default host: x86_64-unknown-linux-gnu
stable-x86_64-unknown-linux-gnu (default)
rustc 1.16.0 (30cf806ef 2017-03-10)
Hope this helps.
Well, I have the same error :smile: I'll try to find out the reason, but I'm not sure in success.
Okay, @tm-nihonsuki it's definitely problem with your system configuration. I suppose you do not have proper video drivers installed. Yesterday I had the same problem on Nixos. But today I installed Void Linux with proper video drivers and everything goes fine! I'm deleting labels, cause it's not related to Piston itself. Please message me if you solve this problem, I'll close the issue.
What's a 'proper' video driver? The fglrx driver has worked fine on debian and arch based systems with every item of software or IDE I've installed in the past six years.
@tm-nihonsuki the problem is, I don't know, because I have Nvidia video card. Did you try to play some games under linux? I guess if games works well then video drivers are properly installed.
I have about eighty Linux games installed, including Unity/Mono developed and Steam distributed games. I am also able to run games under wine. The fglrx drivers are very well established and, though proprietary, are well tested on many Linux distributions.
@tm-nihonsuki well, it's strange. I'm absolutely sure that it's related to drivers.
What, in the information I've provided, makes you absolutely sure?
I faced the same problem without drivers, but I cannot reproduce it with drivers installed. Other users of glutin and winit didn't face this issue (at least, there is no open issues in repos). Do you have other ideas about it?
Can you try to run winit
and glutin
examples?
The examples from the winit
and glutin
github pages build and run correctly.
Well, it changes the situation.
What versions of winit
and glutin
did you use?
The glutin
example builds version 0.7.4 and depends on winit
version 0.5.10.
I add the winit="0.5.10"
dependency to the winit
example to build and run it.
I also got the exact same issue:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', /checkout/src/libcore/result.rs:860:4
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
at /checkout/src/libstd/panicking.rs:380
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:396
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:611
5: std::panicking::begin_panic_new
at /checkout/src/libstd/panicking.rs:553
6: std::panicking::begin_panic_fmt
at /checkout/src/libstd/panicking.rs:521
7: rust_begin_unwind
at /checkout/src/libstd/panicking.rs:497
8: core::panicking::panic_fmt
at /checkout/src/libcore/panicking.rs:92
9: core::result::unwrap_failed
at /checkout/src/libcore/macros.rs:41
10: <core::result::Result<T, E>>::unwrap
at /checkout/src/libcore/result.rs:738
11: spinning_square::main
at src/main.rs:50
12: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:98
13: std::rt::lang_start
at /checkout/src/libstd/panicking.rs:458
at /checkout/src/libstd/panic.rs:361
at /checkout/src/libstd/rt.rs:59
14: main
15: __libc_start_main
16: _start
rustup show
:
Default host: x86_64-unknown-linux-gnu
stable-x86_64-unknown-linux-gnu (default)
rustc 1.20.0 (f3d6973f4 2017-08-27)
I also tried the glutin
and winit
examples and I can run them with no issue.
Any idea?
As explained here: https://github.com/PistonDevelopers/piston/issues/1202 it now works by adding srgb(false)
like:
let mut window: Window = WindowSettings::new(
"spinning-square",
[200, 200]
)
.opengl(opengl)
.exit_on_esc(true)
.srgb(false)
.build()
.unwrap();
Thanks, @n-pochet , it helps.
This seems to have been fixed with the latest mesa 18.*
. See https://github.com/PistonDevelopers/piston/issues/1202 for more information.