Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 711516 - media-libs/mesa-19.2.8: eglChooseConfig() return 0 config, egl apps in mesa-demos failed to choose a config
Summary: media-libs/mesa-19.2.8: eglChooseConfig() return 0 config, egl apps in mesa-d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-04 14:54 UTC by shunlir
Modified: 2020-03-09 00:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,5.64 KB, text/plain)
2020-03-04 14:55 UTC, shunlir
Details
shunlir's bug fix as patch for mesa-19.3.4.ebuild (mesa-19.3.4.ebuild.patch,442 bytes, patch)
2020-03-06 03:19 UTC, Michael Hofmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description shunlir 2020-03-04 14:54:11 UTC
eglgears_x11 and es2gears_x11 from mesa-demos(https://gitlab.freedesktop.org/mesa/demos) failed to run:
./es2gears_x11
EGL_VERSION = 1.4
EGLUT: failed to choose a config

Reproducible: Always

Steps to Reproduce:
1. download source code from https://gitlab.freedesktop.org/mesa/demos
2. cd demos && ./autogen.sh && make && cd src/egl/opengl
3. ./eglgears_x11
Actual Results:  
the gears didn't show, instead, program exited with following error message:
EGL_VERSION = 1.4
EGLUT: failed to choose a config

Expected Results:  
the gears should show up.

1. Per the upstream developer's suggestion (https://gitlab.freedesktop.org/mesa/mesa/issues/2597): should use platform option like '-Dplatforms=x11,drm,surfaceless' when building mesa (aka, put surfaceless in the end).

2. I changed the line in mesa' ebuild file from:
emesonargs+=( -Dplatforms=surfaceless$(use X && echo ",x11")$(use wayland && echo ",wayland")$(use gbm && echo ",drm") )
to:
emesonargs+=( -Dplatforms=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )

Then the issue that mesa-demo encounters is fixed.

3. the gl feature in spice-gdk also has the problem with eglChooseConfig()
Comment 1 shunlir 2020-03-04 14:55:49 UTC
Created attachment 617050 [details]
emerge-info.txt

output of `emerge --info`
Comment 2 shunlir 2020-03-04 14:57:52 UTC
There is a thread talking about this issue in the forum: https://forums.gentoo.org/viewtopic-t-1109214.html.
Comment 3 Michael Hofmann 2020-03-04 15:42:17 UTC
I can confirm the issue. eglgears_x11, es2gears_x11 and all EGL demo programs from khronos and other web sites fail to run under Mesa 19.2.8, 19.3.4, 20.0.0.
Comment 4 Michael Hofmann 2020-03-04 15:44:40 UTC
shunlir identified the cuplrit. It's a bug in current Mesa ebuilds. 

See: 
- https://forums.gentoo.org/viewtopic-p-8427014.html#8427014
- https://gitlab.freedesktop.org/mesa/mesa/issues/2597

Proposed solution: please fix current Mesa ebuilds
Comment 5 Michael Hofmann 2020-03-04 15:49:33 UTC
I can confirm that the proposed solution (moving 'surfaceless' to the end of emesonargs) fixes the problem under Mesa 19.2.8. 

eglgears_x11 and EGL demo programs from various web sites work as expected under Mesa 19.2.8 after I built Mesa with the suggested fix.
Comment 6 Michael Hofmann 2020-03-06 03:19:27 UTC
Created attachment 617272 [details, diff]
shunlir's bug fix as patch for mesa-19.3.4.ebuild
Comment 7 Larry the Git Cow gentoo-dev 2020-03-09 00:07:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=406bd0caa2e11ef228a96d38c14550594bf424be

commit 406bd0caa2e11ef228a96d38c14550594bf424be
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2020-03-08 23:57:08 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-03-09 00:07:22 +0000

    media-libs/mesa: Make X11 the primary EGL platform
    
    Closes: https://bugs.gentoo.org/711516
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 media-libs/mesa/{mesa-19.3.4.ebuild => mesa-19.3.4-r1.ebuild} | 2 +-
 media-libs/mesa/{mesa-20.0.1.ebuild => mesa-20.0.1-r1.ebuild} | 2 +-
 media-libs/mesa/mesa-9999.ebuild                              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)