Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling 'Hello World' example: NoAvailablePixelFormat #17

Closed
luisvgs opened this issue Oct 27, 2019 · 5 comments
Closed

Error compiling 'Hello World' example: NoAvailablePixelFormat #17

luisvgs opened this issue Oct 27, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@luisvgs
Copy link

luisvgs commented Oct 27, 2019

Hello, I'm trying to run the code from the roguelike guide (http://bfnightly.bracketproductions.com/rustbook/chapter_1.html), but unfortunately I'm getting this error: thread 'main' panicked at 'called Result::unwrap() on an Err value: NoAvailablePixelFormat', src\libcore\result.rs:999:5

Here's the full backtrace:
stack backtrace:
0: std::sys_common::backtrace::_print
at src\libstd\sys\windows\backtrace/mod.rs:95
at src\libstd\sys\windows\backtrace/mod.rs:82
at src\libstd\sys_common/backtrace.rs:71
1: std::panicking::default_hook::{{closure}}
at src\libstd\sys_common/backtrace.rs:59
at src\libstd/panicking.rs:197
2: std::panicking::default_hook
at src\libstd/panicking.rs:211
3: std::panicking::rust_panic_with_hook
at src\libstd/panicking.rs:474
4: std::panicking::continue_panic_fmt
at src\libstd/panicking.rs:381
5: rust_begin_unwind
at src\libstd/panicking.rs:308
6: core::panicking::panic_fmt
at src\libcore/panicking.rs:85
7: core::result::unwrap_failed
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libcore/macros.rs:18
8: core::result::Result<T,E>::unwrap
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libcore/result.rs:800
9: rltk::hal::native::init::init_raw
at C:\Users\Luis.cargo\git\checkouts\rltk_rs-9a03b5b24ea60f66\30ef14b\src\hal\native/init.rs:22
10: rltk::rltk::Rltk::init_raw
at C:\Users\Luis.cargo\git\checkouts\rltk_rs-9a03b5b24ea60f66\30ef14b\src/rltk.rs:41
11: rltk::rltk::Rltk::init_simple8x8
at C:\Users\Luis.cargo\git\checkouts\rltk_rs-9a03b5b24ea60f66\30ef14b\src/rltk.rs:52
12: roguelike_guide::main
at src/main.rs:13
13: std::rt::lang_start::{{closure}}
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd/rt.rs:64
14: std::panicking::try::do_call
at src\libstd/rt.rs:49
at src\libstd/panicking.rs:293
15: _rust_maybe_catch_panic
at src\libpanic_unwind/lib.rs:85
16: std::rt::lang_start_internal
at src\libstd/panicking.rs:272
at src\libstd/panic.rs:394
at src\libstd/rt.rs:48
17: std::rt::lang_start
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd/rt.rs:64
18: main
19: _tmainCRTStartup
20: mainCRTStartup
21: unit_addrs_search
22: unit_addrs_search
error: process didn't exit successfully: target\debug\roguelike_guide.exe (exit code: 101)

What could be causing this error? I kindly ask for help. Thanks!

@luisvgs
Copy link
Author

luisvgs commented Oct 28, 2019

Recently checked that someone had the same issue in amethyst, the problem was solved by disabling multisampling. Is it possible to dissable it in rltk? Thank you.

@Rakaneth
Copy link

Rakaneth commented Oct 29, 2019

I have two computers that I develop on. On one of these - the one without a discrete graphics card - rltk works fine. On the other, with a decent Radeon graphics card, I get the NoAvailablePixelFormat error. Both are Windows 10 machines, updated to the same level.

@thebracket thebracket self-assigned this Nov 8, 2019
@thebracket thebracket added the bug Something isn't working label Nov 8, 2019
@thebracket
Copy link
Collaborator

One of the most recent commits should fix this. I had another user report it and pushed a quick fix. For some reason, AMD graphics cards only work if you force Glutin to formally request sRGB format (it'll use it anyway!) on framebuffers, or a float rather than byte backing per color channel.

@luisvgs
Copy link
Author

luisvgs commented Nov 9, 2019

One of the most recent commits should fix this. I had another user report it and pushed a quick fix. For some reason, AMD graphics cards only work if you force Glutin to formally request sRGB format (it'll use it anyway!) on framebuffers, or a float rather than byte backing per color channel.

Yes, it works now! Thank you very much.

@amedviediev
Copy link

I am currently on rltk = "0.5.12" on Mac Os and I'm still experiencing this issue. Full stacktrace:

thread 'main' panicked at 'called Result::unwrap() on an Err value: NoAvailablePixelFormat', src/libcore/result.rs:1165:5
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:76
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:60
4: core::fmt::write
at src/libcore/fmt/mod.rs:1030
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1412
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:64
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:196
9: std::panicking::default_hook
at src/libstd/panicking.rs:210
10: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:473
11: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:380
12: rust_begin_unwind
at src/libstd/panicking.rs:307
13: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
14: core::result::unwrap_failed
at src/libcore/result.rs:1165
15: core::result::Result<T,E>::unwrap
at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/result.rs:933
16: rltk::hal::native::init::init_raw
at /Users/amedvedev/.cargo/registry/src/github.com-1ecc6299db9ec823/rltk-0.5.12/src/hal/native/init.rs:20
17: rltk::rltk::Rltk::init_raw
at /Users/amedvedev/.cargo/registry/src/github.com-1ecc6299db9ec823/rltk-0.5.12/src/rltk.rs:42
18: rltk::rltk::Rltk::init_simple8x8
at /Users/amedvedev/.cargo/registry/src/github.com-1ecc6299db9ec823/rltk-0.5.12/src/rltk.rs:53
19: rust_rogue_tutorial::main
at src/main.rs:39
20: std::rt::lang_start::{{closure}}
at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
21: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
22: std::panicking::try::do_call
at src/libstd/panicking.rs:292
23: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
24: std::panicking::try
at src/libstd/panicking.rs:271
25: std::panic::catch_unwind
at src/libstd/panic.rs:394
26: std::rt::lang_start_internal
at src/libstd/rt.rs:48
27: std::rt::lang_start
at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
28: rust_rogue_tutorial::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Process finished with exit code 101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants