PistonDevelopers / piston-examples

A collection of examples using the Piston game engine
MIT License
344 stars 89 forks source link

no backend available #321

Open mathgamain opened 9 years ago

mathgamain commented 9 years ago

Hi, I don't know where to seek help so I decided to post here as this error occurs on these examples as well, when I try to create a window, the unwrap panicks and returns "no backend is available", what does it mean?

ryo33 commented 9 years ago

I found it at https://github.com/tomaka/glutin/blob/6a3ee2af759cf803d787cf6dcbafcdcc4e0243cd/src/lib.rs#L150.

mathgamain commented 9 years ago

Checking the code ryo33 linked it seems backends are Wayland or X, I tried to run in another machine and it worked so the problem is in my machine, now why "X" is not available is beyond my understanding, any tips on how can I debug this?

bvssvni commented 9 years ago

@mathgamain You can fork the Glutin project and override it locally https://github.com/PistonDevelopers/piston/issues/482. Look for the error message "no backend is available" in the source.

sjmackenzie commented 8 years ago

I'm getting this issue too:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "No backend is available"', src/libcore/result.rs:688

Forking and overriding isn't very successful on nixos. What other ways are there to mitigate this issue?

bvssvni commented 8 years ago

The window backend can be changed to SDL2:

extern crate sdl2_window;

use sdl2_window::Sdl2Window;

let window = PistonWindow<(), Sdl2Window> = ...;
sjmackenzie commented 8 years ago

Actually, as we're loading so many dylibs at roughly the same time, and that the behaviour sometimes works it probably means dlopen is not thread safe. We'll need to implement something like this: https://sourceware.org/ml/libc-help/2014-11/msg00008.html

LiamMartens commented 6 years ago

Happen to stumble upon this long lost open issue here; I experienced the same issue with Glutin and was able to fix it by installing some sdl packages ( libsdl2-2.0.0) also when running headless don't forget to start your screen and export your screen (e.g Xvfb :1 -screen 1 1920x1080x24, export DISPLAY=:1.1)