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

egl: failed to create dri2 screen #355

Open
aplatypus opened this issue Dec 17, 2023 · 4 comments
Open

egl: failed to create dri2 screen #355

aplatypus opened this issue Dec 17, 2023 · 4 comments

Comments

@aplatypus
Copy link

Background

I have encountered a problem just ran the early stages of the Roguelike tutorial, specifically the two initial map examples.

To be sure, I've downloaded the source from the github example:

Problem

  • Running both examples run the mouse moves the 'player' around the screen OK
  • If the mouse is moved, we get this error as shown.

Error

 $  cargo run
    Compiling cfg-if v1.0.0
   Compiling smallvec v1.11.2
   Compiling bitflags v1.3.2
       :
   Compiling rogue-two v0.0.1 (/work/dev/Utils/Rogue-two/rogue-two)
    Finished dev [unoptimized + debuginfo] target(s) in 34.75s
     Running `target/debug/rogue-two`
libEGL warning: egl: failed to create dri2 screen
Initialized OpenGL with: 4.5 (Core Profile) Mesa 23.2.1-1ubuntu3.1, Shader Language Version: 4.50
Error sending request: Resource temporarily unavailable

Set-up

The tutorial version was using earlier builds of the rltk and specs. I reconfigured the toml file, ran cargo update to test with the newer versions (see below), same problem.

Cargo.toml

[dependencies]
##  rltk            = "0.8.0"
    rltk            = "0.8.7"
##  specs           = "0.17.0"
    specs           = "0.20.0"
    specs-derive    = "0.4.1"

LSB

The error seems to be with the Mesa 3D graphics using Wayland on Kubuntu 23.10.

 $ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.10
Release:	23.10
Codename:	mantic

Desktop: KDE Plasma v: 5.27.4 

API: OpenGL v: 4.6.0 NVIDIA 535.113.01 renderer: NVIDIA GeForce RTX
    2080/PCIe/SSE2 direct-render: Yes

Summary

  • For others, this only seems to happend if you touch the mouse. So don't touch the mouse ;-)
  • I was wondering if there is some way to configure the RLTK to avoid the problem or to just use a more basic graphics layer
  • Also, does anyone know how to get logs or investigate this:
    libEGL warning: egl: failed to create dri2 screen problem?

Suggestions welcome.

@aplatypus
Copy link
Author

I ran across some relevant documentation:

It seems that the dri2 mentioned is a fallback if DRI3 can't be found (I think). The driver is supposed to work for X11, Android and Wayland.

Is this something that can be configured ito improve usage by the RLTK ?

@aplatypus
Copy link
Author

I ran across some relevant documentation:

It seems that the dri2 mentioned is a fallback if DRI3 can't be found (I think). The driver is supposed to work for X11, Android and Wayland.

Is this something that can be configured ito improve usage by the RLTK ?

The root cause appears to lie within libEGL itself, see:

@aplatypus
Copy link
Author

Update ...

The next stage of the tutorial: "2.4. Field of View" fails with said error: "libEGL warning: egl: failed to create dri2 screen".

I'm guessing progress on the tutorial is blocked until I find a workaround or perhpas a way to avoid using EGL temorarily. Full transcript:

 $ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/rogue-two`
libEGL warning: egl: failed to create dri2 screen
Initialized OpenGL with: 4.5 (Core Profile) Mesa 23.2.1-1ubuntu3.1, Shader Language Version: 4.50
Error sending request: Resource temporarily unavailable
  • previously found problem on both Wayland and X.11

Keywords:

EGL, DIR2, Mesa, OpenGL, error, graphics, Ubuntu, NVIDIA

@aplatypus
Copy link
Author

Recently I've found that the eglinfo -B core dump has become now, another example of the original problem:

   :
Surfaceless platform:
libEGL warning: egl: failed to create dri2 screen
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
   :

Also, it seems that this issue is a problem with NVIDIA graphics.

Personally, for a text-box demo example having the Rendering fail is still a FAIL; better if there were some kind of cut-out or an opt-out config option/setting (imho).

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

1 participant