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

Demo: main panicked - Result::unwrap() - Err value: "GL context creation failed" #192

Open
Webtest7 opened this issue Mar 30, 2018 · 8 comments

Comments

@Webtest7
Copy link

Webtest7 commented Mar 30, 2018

NEWBIE ALERT! I am very new to 'rust'. I got a few primitive things running and found this demo of a graphics app which I want to try to see if I want to continue with 'rust'.
It builds normally, but when it runs, it aborts with an error message:

  • thread 'main' panicked at 'called Result::unwrap() on an Err value: "GL context creation failed"', libcore/result.rs:945:5
    note: Run with RUST_BACKTRACE=1 for a backtrace.

I tried to figure out the BACKTRACE stuff, but wasn't able to ... It disappears from the environment as soon as it is put in ??? I don't know what I am doing yet.

Here is my system info - I hope it is enough:

Machine: System: Hewlett-Packard product: HP Compaq dx2400 Microtower
Mobo: ASUSTeK model: 2A73 v: 1.01
Bios: American Megatrends v: 5.23 date: 04/21/2008
CPU: Dual core Intel Core2 Duo E4600 (-MCP-) cache: 2048 KB
clock speeds: max: 2400 MHz 1: 1600 MHz 2: 2000 MHz
CPU Flags: acpi aperfmperf apic arch_perfmon bts clflush cmov constant_tsc
cx16 cx8 de ds_cpl dtes64 dtherm dts est fpu fxsr ht lahf_lm lm mca mce mmx
monitor msr mtrr nopl nx pae pat pbe pdcm pebs pge pni pse pse36 rep_good
sep ss sse sse2 ssse3 syscall tm tm2 tsc vme xtpr
System: Host: mint Kernel: 4.10.0-38-generic x86_64 (64 bit) Desktop: MATE 1.18.0
Distro: Linux Mint 18.3 Sylvia
Graphics: Card: Intel 82G33/G31 Express Integrated Graphics Controller
Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
Resolution: [email protected]
GLX Renderer: Mesa DRI Intel G33 GLX Version: 1.4 Mesa 17.0.7
mint@mint ~ $ lspci
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 02)
mint@mint ~ $ find /dev -group video
/dev/fb0
/dev/dri/card0
/dev/dri/renderD128
mint@mint ~ $ lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 02)
Subsystem: Hewlett-Packard Company 82G33/G31 Express Integrated Graphics Controller
Kernel driver in use: i915
Kernel Mode Setting driver: i915, version 1.6.0 20161121

I spent several hours googling for a resolution to this problem with NO success.
Thank you for any and all comments, suggestions, and assistance.
Blessings in abundance,
Art in Carlisle, PA USA

@HeroicKatora
Copy link
Member

The backtrace issue works as follows:
Instead of cargo run
you should use RUST_BACKTRACE=1 cargo run

Of course, replace it command with whatever command you are actually using to run the pogram.

Some additional context is necessary here. What part of the tutorial are you currently try out? Which program are you trying to run?

@HeroicKatora
Copy link
Member

Your issue might be the one mentioned in the top-level Readme as well:
"I get "GL context creation failed" when running an example.

@Webtest7
Copy link
Author

Webtest7 commented Mar 30, 2018

I thought I was in the "spinning-square" section - that's what I'm trying to run. Thanks for the backtrace hint - I'll try it. I saw the comment about the Readme, but I couldn't figure out where is the helloworld.rs. Why not just make it a link for us newbies? I tried a site search but it didn't find anything. Thanks & Blessings - Art

@Webtest7
Copy link
Author

Webtest7 commented Mar 30, 2018

Ahh ... "top-level" HelloWorld ... I found it but it was of ZERO help. The similar note in the spinning-box demo is 'almost' clear, but making the change did NOT work at all:

// Change this to OpenGL::V2_1 if not working.
let opengl = OpenGL::V3_2;

I came across the "piston-window" app in Start new project with Piston and tried it ... it failed with exactly the same error. There is a blink of a window that is created, but it immediately crashes. Thanks to the hint re: backtrace, I was able to use it ... "vidtest" is the project name I gave to "piston-window" ...

mint@mint ~/rust/vidtest $ RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/vidtest`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "GL context creation failed"', 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>>::unwrap
             at /checkout/src/libcore/result.rs:782
  11: vidtest::main
             at src/main.rs:7
  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
mint@mint ~/rust/vidtest $

We are having an awful lot of trouble with such an elementary "Getting Started" program!
Thanks & Blessings - Art

@HeroicKatora
Copy link
Member

Wrap the backtrace in a code block, that probably works best

@Webtest7 Webtest7 reopened this Mar 31, 2018
@Webtest7
Copy link
Author

I've read more about Mesa and OpenGL ... here is more information about my system:

glxinfo
name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4

    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) G33  (0x29c2)
    Version: 17.0.7

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) G33 
OpenGL version string: 1.4 Mesa 17.0.7

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 17.0.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

I've read that Mesa 17.4 might have resolved some problems, and that Mesa 18.0 is supposed to be out already ... is there any hope?
Thanks & Blessings ... Art

@paddywwoof
Copy link

I've run this previously both on this laptop (linux) and cross compiled for raspberry pi. It's was a bit clunky (i.e. v.e.r.y. s.l.o.w...) but ran. Now when I try to compile it I get the same error and backtrace as @Webtest7 above. When I change the Cargo.toml from

[dependencies]
piston = "0.35.0"
piston2d-graphics = "0.23.0"
pistoncore-glutin_window = "0.42.0"
piston2d-opengl_graphics = "0.49.0"

to

piston = "0.36.0"
piston2d-graphics = "0.263.0"
pistoncore-glutin_window = "0.45.0"
piston2d-opengl_graphics = "0.52.0"

I get the following error due to winit being 'yanked' and 0.10.1 no longer existing.

    Updating registry `https://github.com/rust-lang/crates.io-index`
error: no matching version `^0.10.1` found for package `winit`
location searched: registry `https://github.com/rust-lang/crates.io-index`
versions found: 0.12.0, 0.11.3, 0.11.2, ...
required by package `glutin v0.12.1`
    ... which is depended on by `pistoncore-glutin_window v0.45.0`
    ... which is depended on by `spinning-square v0.1.1 (file:///home/patrick/rust/getting-started)`

@fraunos
Copy link

fraunos commented Mar 3, 2019

For me, changing to OpenGL::V2_1 worked.
I'm on HP Probook 6450b

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

No branches or pull requests

4 participants