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

Examples don't work #705

Closed
luleyleo opened this issue Mar 6, 2016 · 17 comments · Fixed by #710
Closed

Examples don't work #705

luleyleo opened this issue Mar 6, 2016 · 17 comments · Fixed by #710
Labels

Comments

@luleyleo
Copy link

luleyleo commented Mar 6, 2016

When I try to run the exaples that error occurs:

thread '<main>' panicked at 'called 'Result::unwrap()' on an 'Err' value: "Couldn\'t find any pixel format that matches the criterias."', ../src/libcore/result.rs:746

With an earlier version of conrod I had no problems...

@mitchmindtree
Copy link
Contributor

Hey @Finnerale, thanks for the issue!

Do all of the examples fail, or only some? Could you please provide the stack trace for the error? One of the core graphics crates that we use in the examples received a big update recently, so there may have been an error introduced and providing a trace might help to narrow it down. You can do so by putting RUST_BACKTRACE=1 before the cargo run --release --example all_widgets command, i.e.

RUST_BACKTRACE=1 cargo run --release --example all_widgets

I just did a google search for your error and found a related issue in the glutin repo. It might be worth checking to see if the glutin examples work too. If they do work, then I'd recommend seeing if the piston_window example works for you.

@luleyleo
Copy link
Author

luleyleo commented Mar 7, 2016

I've tried all examples (also the piston_window) and it's allways the same error.
Here the run with RUST_BACKTRACE=1 (rust nightly with multirust on linux x64):

thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', ../src/libcore/result.rs:746
stack backtrace:
   1:     0x55bebe6f8e90 - sys::backtrace::tracing::imp::write::hafd161163f579c22qhv
   2:     0x55bebe6fb77b - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.44622
   3:     0x55bebe6fb3e8 - panicking::default_handler::hf2d947b7574856d7OWz
   4:     0x55bebe6f010c - sys_common::unwind::begin_unwind_inner::hc47573e10f703d4dJ5t
   5:     0x55bebe6f0598 - sys_common::unwind::begin_unwind_fmt::h46e3049686ee3eb0P4t
   6:     0x55bebe6f8441 - rust_begin_unwind
   7:     0x55bebe72abdf - panicking::panic_fmt::h9d9cbf48c6ff6310ycM
   8:     0x55bebe5624ce - result::unwrap_failed::h17981227768917773030
   9:     0x55bebe55ec65 - main::hae4402e9371f41bfHea
  10:     0x55bebe6fb044 - sys_common::unwind::try::try_fn::h12323044559240671592
  11:     0x55bebe6f83cb - __rust_try
  12:     0x55bebe6faadb - rt::lang_start::hd3c34f9d8d530b71UOz
  13:     0x7efeb806970f - __libc_start_main
  14:     0x55bebe554bc8 - _start
  15:                0x0 - <unknown>

At compile time I get that error (NOT with piston_window):

examples/primitives.rs:30:39: 30:44 warning: broken MIR 
(var1 = conrod::ui::Ui<B>::new(tmp22, tmp24) -> [return: bb47, unwind: bb46]): call dest mismatch (conrod::ui::Ui<(gfx_texture::Texture<gfx_device_gl::Resources>, gfx_graphics::glyph::GlyphCache<gfx_device_gl::Resources, gfx_device_gl::factory::Factory>)> <- conrod::ui::Ui<(<gfx_graphics::back_end::GfxGraphics<'static, gfx_device_gl::Resources, gfx_device_gl::command::CommandBuffer> as graphics::graphics::Graphics>::Texture, gfx_graphics::glyph::GlyphCache<gfx_device_gl::Resources, gfx_device_gl::factory::Factory>)>): Sorts(ExpectedFound { expected: gfx_texture::Texture<gfx_device_gl::Resources>, found: <gfx_graphics::back_end::GfxGraphics<'static, gfx_device_gl::Resources, gfx_device_gl::command::CommandBuffer> as graphics::graphics::Graphics>::Texture })

@oars
Copy link

oars commented Mar 14, 2016

Examples aren't working for me either, but for me it's a different set of issues:

  • When running debug mode:
RUST_BACKTRACE=1 cargo run --example image                      130 ↵
     Running `target/debug/examples/image`
thread '<main>' panicked at 'Error after executing command SetBlendState(0, Color { mask: RED | GREEN | BLUE | ALPHA | MASK_ALL, blend: Some(Blend { color: BlendChannel { equation: Add, source: ZeroPlus(SourceAlpha), destination: OneMinus(SourceAlpha) }, alpha: BlendChannel { equation: Add, source: One, destination: One }}) }): InvalidOperation', /home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/gfx_device_gl-0.8.2/src/lib.rs:308
stack backtrace:
   1:     0x7ff31bcc6870 - sys::backtrace::tracing::imp::write::hf7e21f48f7cb711bEju
   2:     0x7ff31bcc8c65 - panicking::default_handler::_<closure>::closure.42502
   3:     0x7ff31bcc870f - panicking::default_handler::hac4d0be12e3129d2Gwy
   4:     0x7ff31bcbca36 - sys_common::unwind::begin_unwind_inner::hf13a3e016c1e78e1bct
   5:     0x7ff31bcbceb8 - sys_common::unwind::begin_unwind_fmt::h878e9fd8b85e0857hbt
   6:     0x7ff31bc5e800 - Device::check::hf18ebda2265787bf1ee
                        at /home/fuego/rust/conrod/<std macros>:8
   7:     0x7ff31bc660ce - Device::process::h6aaee411e2482a5aloe
                        at /home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/gfx_device_gl-0.8.2/src/lib.rs:715
   8:     0x7ff31bc69f19 - Device.d..Device::submit::h2c549da581ced400KQe
                        at /home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/gfx_device_gl-0.8.2/src/lib.rs:739
   9:     0x7ff31b8e6ab9 - PistonWindow<T, W>::draw_2d::h3583590393362332392
                        at /home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/piston_window-0.37.0/src/lib.rs:247
  10:     0x7ff31b7fe6d1 - main::hf1fa173ccd104a4ahaa
                        at examples/image.rs:45
  11:     0x7ff31bcc8394 - sys_common::unwind::try::try_fn::h9896872240422604242
  12:     0x7ff31bcc5e48 - __rust_try
  13:     0x7ff31bcc8020 - rt::lang_start::h0d9dcd8707a91319Uoy
  14:     0x7ff31b996789 - main
  15:     0x7ff31a913ec4 - __libc_start_main
  16:     0x7ff31b7fdb88 - <unknown>
  17:                0x0 - <unknown>
Process didn't exit successfully: `target/debug/examples/image` (exit code: 101)
  • When running the same with release the example runs, but the image is not shown:
    screenshot-20160313 191035
  • Similarly in the case of the all_widgets example the letters are not rendered properly:
    screenshot-20160313 191148
  • I tried both the glutin and piston_window examples and they had no issues.

@Tom9729
Copy link

Tom9729 commented Mar 16, 2016

I'm seeing the same thing as @oars. I've attached my glxinfo (open-source Radeon driver on Ubuntu 14.04) if that helps.

tom9729_glxinfo.txt

@Tom9729
Copy link

Tom9729 commented Mar 16, 2016

The all widgets example works for me if I reset to fe58ed8.

all_widgets

The commits after that upgrade piston2d-graphics to 0.14, piston_window to 0.35 and piston to 0.17.

(I think this issue is different from @Finnerale's issue; sorry for cluttering up this thread!)

@mitchmindtree
Copy link
Contributor

Thanks a lot for the update @Tom9729!

There was a large overhaul of the graphics backend that the conrod examples use recently and it looks like there may have been some bugs introduced along the way. Conrod is currently behind the latest changes for those dependencies at the moment, so the issues you're getting may already be fixed upstream and we might just need to update the dev-dependency versions to receive the fixes. I won't get a chance to do this until I finish #703 (but even then I don't have a linux distro available locally to test on).

cc @bvssvni maybe you have an idea where those texture artefacts might be coming from that are shown in @oars' comment? Seems strange that debug is failing but release is passing (though with rendering issues).

@bvssvni
Copy link
Member

bvssvni commented Mar 16, 2016

Looks like alpha blending is disabled.

@kvark
Copy link
Member

kvark commented Apr 4, 2016

@bvssvni For some reason, I missed this thread. You've got an issue with blending? Is it with gfx_graphics?

@pierrechevalier83
Copy link
Contributor

Not speaking for the "alpha blending issue", but the "thread '

' panicked at 'called 'Result::unwrap()' on an 'Err' value: "Couldn't find any pixel format that matches the criterias."', ../src/libcore/result.rs:746"
looks like it's hitting the problem with Glutin X11: rust-windowing/glutin#748

@mitchmindtree
Copy link
Contributor

@pierrechevalier83 ahh, so it should be fixed once we update to the latest glutin? We should be able to once 1.8.0 stable is released (we have to wait until then because this).

@pierrechevalier83
Copy link
Contributor

So 1.8.0 stable should be tomorrow apparently... I'll try to push an update to latest glutin then.

@mitchmindtree
Copy link
Contributor

@pierrechevalier83 I've opened up a PR at #710, which we can hopefully land once the 1.8 comes out tomorrow and close this 👍

@egilburg
Copy link

egilburg commented May 7, 2016

This is still an issue for me:

$ cargo run  --example canvas
   Compiling conrod v0.35.0 (file:///Users/eugene_gilburg/src/rust/PistonDevelopers/conrod)
examples/canvas.rs:38:39: 38:44 warning: broken MIR (var2 = conrod::ui::Ui<B>::new(tmp19, tmp21) -> [return: bb44, unwind: bb43]): call dest mismatch (conrod::ui::Ui<(gfx_texture::Texture<gfx_device_gl::Resources>, gfx_graphics::glyph::GlyphCache<gfx_device_gl::Resources, gfx_device_gl::factory::Factory>)> <- conrod::ui::Ui<(<gfx_graphics::back_end::GfxGraphics<'static, gfx_device_gl::Resources, gfx_device_gl::command::CommandBuffer> as graphics::graphics::Graphics>::Texture, gfx_graphics::glyph::GlyphCache<gfx_device_gl::Resources, gfx_device_gl::factory::Factory>)>): Sorts(ExpectedFound { expected: gfx_texture::Texture<gfx_device_gl::Resources>, found: <gfx_graphics::back_end::GfxGraphics<'static, gfx_device_gl::Resources, gfx_device_gl::command::CommandBuffer> as graphics::graphics::Graphics>::Texture })
examples/canvas.rs:38         Ui::new(glyph_cache.unwrap(), theme)

@mitchmindtree
Copy link
Contributor

@egilburg the warning you've posted is a separate issue, one within the compiler itself that shouldn't affect the compiled examples. See here and here.

@egilburg
Copy link

egilburg commented May 7, 2016

@mitchmindtree When I run in debug mode, I get this warning but the examples then start. However, when I run with --release flag, the examples compile but do not start after this warning is emitted. Is this a known issue?

@mitchmindtree
Copy link
Contributor

@egilburg hmmm this does sound strange, would you mind posting a new issue with the full output from cargo when doing RUST_BACKTRACE=1 cargo run --release --example all_widgets, along with which OS you're using and the output of rustc --version?

@egilburg
Copy link

egilburg commented May 8, 2016

@mitchmindtree actually nvm it worked this time, for some reason I had to wait almost 1 min before it booted in release mode (and this after compile was finished). Thanks for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
8 participants