PistonDevelopers / Piston-Tutorials

Tutorials for Piston
545 stars 91 forks source link

thread 'main' panicked at 'Could not create window: "Couldn\'t find any pixel format that matches the criterias #193

Open martinak1 opened 6 years ago

martinak1 commented 6 years ago

Attempted to follow the sudoku example up to chapter 5 where you are supposed to compile and the game board is displayed. Instead I get the following error with this backtrace:

thread 'main' panicked at 'Could not create window: "Couldn\'t find any pixel format that matches the criterias."', libcore/result.rs:945:5
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
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:23
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  11: sudoku::main
             at src/main.rs:43
  12: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:479
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:458
             at libstd/panic.rs:358
             at libstd/rt.rs:58
  16: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  17: main
  18: __libc_start_main
  19: _start

I went through the code to make sure I did not make an error, and just to be extra sure, I cloned the repository and tried to build the example from the source provided. This is the error and backtrace provided from that:

thread 'main' panicked at 'Could not create window: "Couldn\'t find any pixel format that matches the criterias."', libcore/result.rs:945:5
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
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:23
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  11: sudoku::main
             at src/main.rs:29
  12: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:479
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:458
             at libstd/panic.rs:358
             at libstd/rt.rs:58
  16: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  17: main
  18: __libc_start_main
  19: _start

Bellow is my system info:

$ uname -r:  
     4.15.13-300.fc27.x86_64
$ cargo --version: 
     cargo 0.26.0 (41480f5cc 2018-02-26)
$ rustup show: 
   Default host: x86_64-unknown-linux-gnu
   stable-x86_64-unknown-linux-gnu (default)
   rustc 1.25.0 (84203cac6 2018-03-25)

Please let me know if I need to provide any more information.

martinak1 commented 6 years ago

I was able to solve the issue by disabling srgb, but it might be a good idea to mention this issue in the tutorial as it seems to be fairly common.

maffei2443 commented 6 years ago

@martinak1 how do I do that? I'm having the same problem

martinak1 commented 6 years ago

@maffei2443 unfortunately I no longer have the code I was working on. I believe it was something simple like bellow, but I do not remember where it was specified.

.srgb(false)

I found the answer in one of the previous issues, so that may be your best place to look.

atoav commented 5 years ago

When I set .srgb(false) I get the Error:

OpenGL Warning: glXChooseVisual: ignoring attribute 0x22
OpenGL Warning: vboxCall failed with VBox status code VERR_BUFFER_OVERFLOW

thread 'main' panicked at 'gl function was not loaded', /home/atoav/radiu/target/debug/build/gl-ec15099b00e923a0/out/bindings.rs:20624:13

I used Linux Mint 19 running as a virtualbox guest and disabling 3D-acceleration in the Virtualbox Settings fixed this for me.

drazde commented 5 years ago

I have the same problem on Windows 10...

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 2.41s
     Running `target\debug\spinning-square.exe`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', libcore\result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: process didn't exit successfully: `target\debug\spinning-square.exe` (exit code: 101)
categulario commented 5 years ago

I have the same problem on Windows 10...

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 2.41s
     Running `target\debug\spinning-square.exe`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', libcore\result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: process didn't exit successfully: `target\debug\spinning-square.exe` (exit code: 101)

were you able to solve it?