fschutt/azul

Unable to find OpenGL at runtime

anabelian opened this issue · 3 comments

Description

Version / OS

  • azul version:
    5984b8020ca7bbf218af1704243f277f34da600b

  • Operating system:
    NixOS

  • Windowing system (X11 or Wayland, Linux only):
    X11

Steps to Reproduce

Running the Hello World example fails at runtime with

[ERROR][azul::logging] An unexpected panic ocurred, the program has to exit.
Please report this error and attach the log file found in the directory of the executable.

The error ocurred in: src/libcore/result.rs at line 1165 in thread main

Error information:
called `Result::unwrap()` on an `Err` value: CreateError(NotSupported("both libglx and libEGL not present"))

Backtrace:

azul::logging::set_up_panic_hooks::panic_fn @ logging.rs:86
core::ops::function::Fn::call @ function.rs:69
std::panicking::rust_panic_with_hook @ panicking.rs:477
std::panicking::continue_panic_fmt @ panicking.rs:380
 @ panicking.rs:307
core::panicking::panic_fmt @ panicking.rs:84
core::result::unwrap_failed @ result.rs:1165
core::result::Result<T,E>::unwrap @ result.rs:933
bureau::ui::main @ ui.rs:14
bureau::run @ main.rs:69
bureau::main @ main.rs:38
std::rt::lang_start::{{closure}} @ rt.rs:64
std::rt::lang_start_internal::{{closure}} @ rt.rs:49
std::panicking::try::do_call @ panicking.rs:292
 @ lib.rs:80
std::panicking::try @ panicking.rs:271
std::panic::catch_unwind @ panic.rs:394
std::rt::lang_start_internal @ rt.rs:48
std::rt::lang_start @ rt.rs:64
unresolved function



missing software! (we will try basic console input)
 ___________
/           \
| tiny file |
|  dialogs  |
\_____  ____/
      \|
tiny file dialogs on UNIX needs:
   applescript
or kdialog
or zenity (or matedialog or qarma)
or python (2 or 3)
 + tkinter + python-dbus (optional)
or dialog (opens console if needed)
or xterm + bash
   (opens console for basic input)
or existing console for basic input


Unexpected fatal error

An unexpected panic ocurred, the program has to exit.
Please report this error and attach the log file found in the directory of the executable.

The error ocurred in: src/libcore/result.rs at line 1165 in thread main

Error information:
called `Result::unwrap()` on an `Err` value: CreateError(NotSupported("both libglx and libEGL not present"))

Backtrace:

azul::logging::set_up_panic_hooks::panic_fn @ logging.rs:86
core::ops::function::Fn::call @ function.rs:69
std::panicking::rust_panic_with_hook @ panicking.rs:477
std::panicking::continue_panic_fmt @ panicking.rs:380
 @ panicking.rs:307
core::panicking::panic_fmt @ panicking.rs:84
core::result::unwrap_failed @ result.rs:1165
core::result::Result&lt;T,E&gt;::unwrap @ result.rs:933
bureau::ui::main @ ui.rs:14
bureau::run @ main.rs:69
bureau::main @ main.rs:38
std::rt::lang_start::{{closure}} @ rt.rs:64
std::rt::lang_start_internal::{{closure}} @ rt.rs:49
std::panicking::try::do_call @ panicking.rs:292
 @ lib.rs:80
std::panicking::try @ panicking.rs:271
std::panic::catch_unwind @ panic.rs:394
std::rt::lang_start_internal @ rt.rs:48
std::rt::lang_start @ rt.rs:64
unresolved function


press enter to continue

glxinfo output:

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.3.4
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.3.4
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.3.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

This is probably very specific to NixOs, I'm not sure if webrender / winit can even run on such a system. Could you try running the examples from servo/webrender and see if they run? It seems that there is a problem locating the OpenGL driver.

Never mind, it was a problem on my end that led to the OpenGL libraries not being found in LD_LIBRARY_PATH that I fixed easily. The basic white-screen example runs but the "simple counter" example fails with the same errors as in #214. Closing.

nh2 commented

OpenGL libraries not being found in LD_LIBRARY_PATH that I fixed easily

I used this shell.nix with contents:

with import <nixpkgs> {};

stdenv.mkDerivation {
  name = "rust-env";
  nativeBuildInputs = [
    rustc cargo

    # Build-time Additional Dependencies
    pkgconfig
    python3
  ];
  buildInputs = [
    # Run-time Additional Dependencies
    freetype
    expat
    xorg.libxcb
    fontconfig
  ];

  # LD_LIBRARY_PATH = ''
  #   ${xorg.libXcursor}/lib:${xorg.libX11}/lib
  # '';
  LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [
    xorg.libX11
    xorg.libXcursor
    xorg.libXrandr
    xorg.libXi
    libglvnd
  ];

  # Set Environment Variables
  RUST_BACKTRACE = 1;
}

and ran nix-shell --pure --run 'cargo run'.

That works, but the hello_world example shows an empty white window, not showing a counter (I can click in the place where the counter incrementor is though and the terminal shows a counter increase (e.g. <p class="__azul-native-label">4</p>).

@anabelian Did you get the GUI to display?