Bug 98272

Summary: Europa Universalis IV, Hearts of Iron IV, and Stellaris fail to display anything on XWayland
Product: Wayland Reporter: Médéric Boquien <mboquien>
Component: XWaylandAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: david, felix.schwarz, gustav.palmqvist, pandiculationfinch, pierre.morrow, stefan.friesel, taijian
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 77449    
Attachments: Trace of Europa Universalis IV
glxinfo under an X session
glxinfo uner a Wayland session
errors under wayland when launching stellaris.
normal startup under X11

Description Médéric Boquien 2016-10-15 11:48:13 UTC
Created attachment 127318 [details]
Trace of Europa Universalis IV

Europa Universalis IV, Hearts of Iron IV, and Stellaris (all games from the same team) fail to start with a radeon rx480 with radeonsi+amdgpu. Using the intel IGP works. This is using Mesa 12.0.3 with Linux 4.8.1.

The attached trace appears to show that there is no current context. Contexts are created and destroyed several times before that. Please let me know what I can do to provide more information.
Comment 1 Médéric Boquien 2016-10-15 12:02:33 UTC
To be more precise, the games actually start (music is playing) and do not crash, but nother is ever displayed. If I set LIBGL_DEBUG=verbose, I get the following:

libGL: pci id for fd 4: 1002:67df, driver radeonsi
libGL: OpenDriver: trying /usr/lib32/xorg/modules/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib32/xorg/modules/dri/radeonsi_dri.so
libGL: Using DRI3 for screen 0
Setting breakpad minidump AppID = 236850
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198007143817 [API loaded no]
function is no-op
function is no-op
function is no-op
function is no-op
function is no-op
function is no-op

The last lines repeat endlessly.
Comment 2 Médéric Boquien 2016-10-15 13:43:05 UTC
For reference, I compiled Mesa git and the issue remains unchanged.
Comment 3 Médéric Boquien 2016-10-15 14:44:55 UTC
After further investigation, I have found:
1. The games will start correctly if the launcher is bypassed
2. The games will start correctly only if the "multi_sampling" option is set to 0 in the respective settings.txt files.

I suspect that the launcher ignores settings.txt and sets multi-sampling anyway.
Comment 4 Médéric Boquien 2016-10-15 18:00:54 UTC
It seems that I was running Wayland by accident. It works under X.org. Though as I assume that things should keep working with Wayland too, I leave the bug open for now. Feel free to close it otherwise.
Comment 5 Michel Dänzer 2016-10-17 02:40:54 UTC
Please attach the output of glxinfo in Wayland and Xorg sessions.
Comment 6 Médéric Boquien 2016-10-17 10:52:41 UTC
Created attachment 127350 [details]
glxinfo under an X session
Comment 7 Médéric Boquien 2016-10-17 10:53:07 UTC
Created attachment 127351 [details]
glxinfo uner a Wayland session
Comment 8 Médéric Boquien 2016-10-17 10:55:23 UTC
Hello Michel. I have attached the files. Note that since the last report I reverted back to a 4.7 kernel as the new one was having issues with ACPI flooding the logs. The issue is unaffected though. Thanks!
Comment 9 Seth 2016-12-06 17:32:55 UTC
Same happens on Intel drivers with a standard Fedora 25 session. Seems the steam/stellaris app don't fall back properly to XWayland session, so sound yes, picture no. I changed the product to reflect the correct issue source.
Comment 10 Gustav Palmqvist 2016-12-07 21:28:25 UTC
We just patched the launcher to not enforce any msaa at all. Dunno when it will be in the different games, but you will still need to set your msaa to disabled if this is the case.

We are using the old GL_ARB_multisample for this and nothing fancy in our shaders so I believe this indeed is a xwayland issue and not application.

If you need any more info or advice pls let me know.

best regards,
Gustav Palmqvist
Comment 11 pandiculationfinch 2017-01-01 14:23:41 UTC
Created attachment 128702 [details]
errors under wayland when launching stellaris.

here are the errors that occurr when the game attempts to launch under wayland.
Comment 12 pandiculationfinch 2017-01-01 14:24:39 UTC
Created attachment 128703 [details]
normal startup under X11
Comment 13 pandiculationfinch 2017-01-01 14:28:05 UTC
seems like wayland causes glxinfo to report different opengl capabilities?

diff wayland-glxinfo.txt xorg-glxinfo.txt | head -50
7,8c7,9
<     GLX_ARB_create_context, GLX_ARB_create_context_profile,
<     GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
---
>     GLX_ARB_create_context, GLX_ARB_create_context_profile, 
>     GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
>     GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
12,14c13,15
<     GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_OML_swap_method,
<     GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
<     GLX_SGIX_visual_select_group, GLX_SGI_make_current_read
---
>     GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
>     GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
>     GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
34,39c35,41
<     GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB,
<     GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age,
<     GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
<     GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
<     GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
<     GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
---
>     GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
>     GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
>     GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile,
>     GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float,
>     GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context,
>     GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating,
>     GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
44c46
<     GLX_SGI_video_sync
---
>     GLX_SGI_swap_control, GLX_SGI_video_sync
50c52
<     Video memory: 7994MB
---
>     Video memory: 8039MB
300c302
< 192 GLX Visuals
---
> 480 GLX Visuals
Comment 14 Markus 2017-10-07 20:43:21 UTC
This is still an issue under a Wayland session in Ubuntu 17.10: For Europa Universalis 4, the launcher does not show up on screen and and neither does the game itself.
Comment 15 David Strauss 2017-10-09 15:05:54 UTC
The launcher for Stellaris and the game are working correctly for me now with a Wayland session as of Fedora 26 (for whatever that means in terms of major versions). I have Intel integrated graphics.
Comment 16 Jason Ekstrand 2018-06-04 22:51:15 UTC
I was looking at something almost completely unrelated and I think I came across the root cause of this bug.  Currently, XWayland does not advertise support for any multisampled visuals.  You can reproduce this trivially with "glxgears -samples 4".  Hidden in comment 13 is this nugget:

(In reply to pandiculationfinch from comment #13)
> 300c302
> < 192 GLX Visuals
> ---
> > 480 GLX Visuals

I think the root cause here is that XWayland loads swrast for indirect GLX instead of figuring out which actual DRI driver to load.  Since swrast does not support multisampling, we get no multisampled visuals.  I don't really know the internals of XWayland enough to know how to fix that problem but there it is.
Comment 17 Christian Schaller 2019-05-09 16:32:38 UTC
Adam Jackson just submitted a fix for this issue (https://gitlab.freedesktop.org/xorg/xserver/merge_requests/195)
Comment 18 Felix Schwarz 2019-05-09 16:48:16 UTC
(In reply to Christian Schaller from comment #17)
> Adam Jackson just submitted a fix for this issue
> (https://gitlab.freedesktop.org/xorg/xserver/merge_requests/195)

Thank you (+ everyone involved).

Just out of curiosity: I've seen someone who mentioned this bug in the comments of your blog post about Fedora Workstation 30. Was that actually a trigger to fix it or did you prioritize the bug due to other reason and it just happens to fix this bug as well?
Comment 19 Christian Schaller 2019-05-14 18:07:47 UTC
Hi Felix,
Actually it was the blog comment that made we aware of the issue and which in turn made us prioritize getting it fixed :)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.