Bug 1411447 - GTK+ 2 images appear as black boxes under XWayland with NVIDIA/nouveau
Summary: GTK+ 2 images appear as black boxes under XWayland with NVIDIA/nouveau
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-server
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Lyude
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1406847 1411107 1411109 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-09 18:09 UTC by Matthew Krupcale
Modified: 2017-06-09 19:27 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-09 11:30:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
unison240-gtk using XWayland on GNOME Wayland session with NVIDIA (65.89 KB, image/png)
2017-01-09 18:09 UTC, Matthew Krupcale
no flags Details
unison240-gtk using X11 on GNOME X11 session with NVIDIA (78.53 KB, image/png)
2017-01-09 18:11 UTC, Matthew Krupcale
no flags Details
gtk-demo Pixbufs using XWayland on GNOME Wayland session with NVIDIA (217.26 KB, image/png)
2017-01-09 18:12 UTC, Matthew Krupcale
no flags Details
gtk-demo Images vs gtk3-demo Images using XWayland on GNOME Wayland session with NVIDIA (725.37 KB, image/png)
2017-01-09 18:13 UTC, Matthew Krupcale
no flags Details
unison240-gtk using XWayland on GNOME Wayland session with AMD (81.08 KB, image/png)
2017-01-09 18:14 UTC, Matthew Krupcale
no flags Details
GLAMOR Weston gtk-demo debug log (72.73 KB, text/plain)
2017-01-16 16:52 UTC, Matthew Krupcale
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 776255 0 None None None Never

Description Matthew Krupcale 2017-01-09 18:09:47 UTC
Created attachment 1238848 [details]
unison240-gtk using XWayland on GNOME Wayland session with NVIDIA

Description of problem:

Applications using the GTK+ 2 toolkit which load images or icons have the images show up as a black box with what appears to be the correct size. I first noticed this issue when using unison240-gtk under Fedora 25 GNOME Wayland session on my desktop. This issue does not appear when running under an X11 GNOME session, but only under the Wayland session through XWayland.

Version-Release number of selected component (if applicable):

xorg-x11-server-Xorg-1.19.0-3.fc25.x86_64

How reproducible:

Always (see circumstances in additional info).

Steps to Reproduce:
1. Have NVIDIA card (with nouveau drivers?)
2. Launch GNOME Wayland session
3. Start an application which uses the GTK+ 2 toolkit to render using the XWayland/X11 backend compatibility layer and includes some image widgets (e.g. gtk-demo from gtk2-devel package, gimp, or unison240-gtk would suffice)

Actual results:

Image icons show up as black boxes. Using XWayland under GNOME Wayland session: see attachment unison240-gtk_GTK+2_XWayland_NVIDIA.png

Expected results:

Images are displayed correctly. Using X11 under GNOME X11 session: see attachment unison240-gtk_GTK+2_X11_NVIDIA.png

Additional info:

This does not necessarily occur for all image types, as it does correctly show some (PNG and JPEG?) images (see attachment gtk-demo_pixbufs_GTK+2_XWayland_NVIDIA.png).

Applications built with GTK+ 3 toolkit also appear to be unaffected (see attachment gtk-demo_images_GTK+2_XWayland_NVIDIA_vs_gtk3-demo_images_GTK+3_XWayland_NVIDIA.png -- note that gtk3-demo was launched with GDK_BACKEND=x11).

It also appears to depend on the graphics card used somehow because I do not see this issue on my laptop, which has an AMD graphics card, when running under Wayland through XWayland (see attachment unison240-gtk_GTK+2_XWayland_AMD.png).

Additional installed components:

gdk-pixbuf2-2.36.3-1.fc25.x86_64
gtk2-2.24.31-2.fc25.x86_64
gtk3-3.22.6-1.fc25.x86_64
xorg-x11-drv-nouveau-1.0.13-1.fc25.x86_64

Comment 1 Matthew Krupcale 2017-01-09 18:11:16 UTC
Created attachment 1238849 [details]
unison240-gtk using X11 on GNOME X11 session with NVIDIA

Comment 2 Matthew Krupcale 2017-01-09 18:12:34 UTC
Created attachment 1238850 [details]
gtk-demo Pixbufs using XWayland on GNOME Wayland session with NVIDIA

Comment 3 Matthew Krupcale 2017-01-09 18:13:34 UTC
Created attachment 1238851 [details]
gtk-demo Images vs gtk3-demo Images using XWayland on GNOME Wayland session with NVIDIA

Comment 4 Matthew Krupcale 2017-01-09 18:14:08 UTC
Created attachment 1238853 [details]
unison240-gtk using XWayland on GNOME Wayland session with AMD

Comment 5 Olivier Fourdan 2017-01-10 08:03:12 UTC
Sounds like the same as upstream bug https://bugzilla.gnome.org/show_bug.cgi?id=776255

Comment 6 Olivier Fourdan 2017-01-10 14:41:50 UTC
I suspect an issue with glamor, could you try on thesame hardware with X11 using the modesetting driver and glamor accel:

To to do, you might add the configuration snippet as follow:

$ cat /etc/X11/xorg.conf.d/15-modesetting.conf
Section "Device"
        Identifier "Modesetting"
        Driver "modesetting"
        Option "AccelMethod" "glamor"
EndSection

Then try to log in "GNOME on X11" in gdm, check the Xorg log files to make sure the modesetting driver is in use with glamor accleration as expected:

$ egrep "modesetting|glamor" ~/.local/share/xorg/Xorg.0.log
[  4658.886] (II) LoadModule: "modesetting"
[  4658.963] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so
[  4658.994] (II) Module modesetting: vendor="X.Org Foundation"
[  4658.994] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  4658.995] (**) modeset(0): Option "AccelMethod" "glamor"
[  4658.995] (II) Loading sub module "glamoregl"
[  4658.995] (II) LoadModule: "glamoregl"
[  4658.995] (II) Loading /usr/lib64/xorg/modules/libglamoregl.so
[  4659.025] (II) Module glamoregl: vendor="X.Org Foundation"
[  4659.025] (II) glamor: OpenGL accelerated X.org driver based.
[  4659.043] (II) glamor: EGL version 1.4 (DRI2):
[  4659.046] (II) modeset(0): glamor initialized

Then check if the icons in gtk2 apps show as expected.

Comment 7 Olivier Fourdan 2017-01-10 14:45:22 UTC
(Note, I do get all sort of weird artefacts with pixmaps using modesetting/glamor with nouveau on X11 as well here, thus the requested test)

Comment 8 Matthew Krupcale 2017-01-10 14:59:05 UTC
(In reply to Olivier Fourdan from comment #5)
> Sounds like the same as upstream bug
> https://bugzilla.gnome.org/show_bug.cgi?id=776255

I also saw that bug before I reported this one, but it looked like the issue might have been slightly different since it was reported against Backend: Wayland and I thought FileZilla was built against GTK+ 3 rather than GTK+ 2. Furthermore, as per https://fedoraproject.org/wiki/How_to_debug_Wayland_problems#Does_your_application_run_on_Wayland_natively.2C_or_uses_XWayland_.28X11_compatibility_layer.29.3F it looked like the issue was with XWayland since the problem was not present on X11 sessions, so I have reported it against xorg-x11-server here.

After having reported this bug though, it looks like the issue may be related however since  optimisme reported that the issue is present when running 'GDK_BACKEND=x11 gimp' and is also using NVIDIA/nouveau. However, he also reported that gtk-demo Assistant works, but I in fact still see a black box on the top right of the window.

(In reply to Olivier Fourdan from comment #6)
> I suspect an issue with glamor, could you try on thesame hardware with X11
> using the modesetting driver and glamor accel:
> 
> To to do, you might add the configuration snippet as follow:
> 
> $ cat /etc/X11/xorg.conf.d/15-modesetting.conf
> Section "Device"
>         Identifier "Modesetting"
>         Driver "modesetting"
>         Option "AccelMethod" "glamor"
> EndSection
> 
> Then try to log in "GNOME on X11" in gdm, check the Xorg log files to make
> sure the modesetting driver is in use with glamor accleration as expected:
> 
> $ egrep "modesetting|glamor" ~/.local/share/xorg/Xorg.0.log
> [  4658.886] (II) LoadModule: "modesetting"
> [  4658.963] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so
> [  4658.994] (II) Module modesetting: vendor="X.Org Foundation"
> [  4658.994] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
> [  4658.995] (**) modeset(0): Option "AccelMethod" "glamor"
> [  4658.995] (II) Loading sub module "glamoregl"
> [  4658.995] (II) LoadModule: "glamoregl"
> [  4658.995] (II) Loading /usr/lib64/xorg/modules/libglamoregl.so
> [  4659.025] (II) Module glamoregl: vendor="X.Org Foundation"
> [  4659.025] (II) glamor: OpenGL accelerated X.org driver based.
> [  4659.043] (II) glamor: EGL version 1.4 (DRI2):
> [  4659.046] (II) modeset(0): glamor initialized
> 
> Then check if the icons in gtk2 apps show as expected.

I was able to load the modsetting driver and glamor acceleration on an X11 session with the same NVIDIA hardware, and the images and icons in GTK+ 2 applications all appear normal (not seeing any artifacts or black boxes). However, as I noted I did not previously see an issue on the X11 session (before adding this modsetting snippet to the xorg config), so I'm not quite sure I follow the need to test this under the X11 session.

Comment 9 Olivier Fourdan 2017-01-11 07:12:19 UTC
(In reply to Matthew Krupcale from comment #8)
> However, as I noted I did not previously see an issue on the X11 session
> (before adding this modsetting snippet to the xorg config), so I'm not quite
> sure I follow the need to test this under the X11 session.

To test glamor.

Comment 10 Olivier Fourdan 2017-01-12 13:18:30 UTC
I'd like you to try one more thing.

1. Make sure you have weston installed
2. from a terminal, either from a Wayland session or X11 session, run:

   $ weston --use-pixman --modules=xwayland.so

   That should start weston nested.

3. From within weston, open a terminal and run "gtk-demo" (from gtk2)
4. Using the weston session, check if the rendering is correct or not.

Comment 11 Olivier Fourdan 2017-01-12 13:43:49 UTC
And if the rendering is correct, redo the same without "--use-pixman" in weston.

Comment 12 Matthew Krupcale 2017-01-12 14:34:46 UTC
(In reply to Olivier Fourdan from comment #10)
> I'd like you to try one more thing.
> 
> 1. Make sure you have weston installed
> 2. from a terminal, either from a Wayland session or X11 session, run:
> 
>    $ weston --use-pixman --modules=xwayland.so
> 
>    That should start weston nested.
> 
> 3. From within weston, open a terminal and run "gtk-demo" (from gtk2)
> 4. Using the weston session, check if the rendering is correct or not.

The rendering looked correct when launching GTK+ 2 applications from within the weston nested session with the --use-pixman argument.

(In reply to Olivier Fourdan from comment #11)
> And if the rendering is correct, redo the same without "--use-pixman" in
> weston.

The rendering was not correct (i.e. had the black boxes in the place of images) when not passing the --use-pixman argument in weston.

Comment 13 Olivier Fourdan 2017-01-12 15:35:27 UTC
Ok, that's helpful and pretty in line with what I see here (although with slightly different ill effects), so I don't think this is truly an Xwayland issue, I reckon it's rather between glamor and mesa/nouveau.

Comment 14 Olivier Fourdan 2017-01-16 16:28:28 UTC
(In reply to Matthew Krupcale from comment #12)
> The rendering was not correct (i.e. had the black boxes in the place of
> images) when not passing the --use-pixman argument in weston.

OK, now let's check if glamor is having problems on your system:

 1. GLAMOR_DEBUG=3 weston --modules=xwayland.so |& tee glamor-debug.log
 2. From within weston, open a terminal and run "gtk-demo" (from gtk2)
 3. Reproduce the rendering issue with icons using gtk-demo
 4. Close weston

And then please post the "glamor-debug.log" that was created with the procedure above.

Comment 15 Matthew Krupcale 2017-01-16 16:52:38 UTC
Created attachment 1241331 [details]
GLAMOR Weston gtk-demo debug log

Comment 16 Laura Abbott 2017-01-24 19:38:56 UTC
*** Bug 1411107 has been marked as a duplicate of this bug. ***

Comment 17 Nils Philippsen 2017-03-16 10:16:39 UTC
*** Bug 1406847 has been marked as a duplicate of this bug. ***

Comment 18 Nils Philippsen 2017-03-16 10:16:45 UTC
*** Bug 1411109 has been marked as a duplicate of this bug. ***

Comment 19 John Clark 2017-04-23 18:31:26 UTC
I have this bug happening in GIMP which is how I found this thread. I'm currently working around this by downgrading Mesa to 12.0.3 now, still happening with 13.0.4-3-fc25. Source/more information about workaround: https://ask.fedoraproject.org/en/question/98458/after-upgrading-to-fedora-25-workstation-kde-panels-widget-and-desktop-not-visible/?answer=98617#post-id-98617

If I can help by sharing system info/etc - happy to assist.

Comment 20 Olivier Fourdan 2017-04-24 06:51:06 UTC
I don't think this is the same issue, the thread you point out seems to be about KDE with nvidia closed source driver so presumably on X11, whereas this particular issue is about Wayland with glamor acceleration (on possibly older hardware).

Comment 21 geert 2017-04-25 14:25:47 UTC
I found another thread also suggesting to roll back Mesa drivers to 12.0.3, however when trying this, dnf wants to remove other applications (wine, octave, lmms...).  I would not want to do this rollback since I need at least one of the applications it wants to remove.

Comment 22 John Clark 2017-04-25 15:16:56 UTC
My intention was to leave a workaround for folks with issue (specially gtk+ 2 apps, Fedora 25-latest, Gnome-latest and Nvidia default Fedora drivers). It definitely isn't ideal but it worked for me and I realize thread linked has KDE but it was linked from here originally which is more aligned with this bug: https://ask.fedoraproject.org/en/question/98867/black-icons-for-gimp-and-inkscape-after-upgrade-to-fedora-25/

Comment 23 Juan 2017-05-13 09:38:54 UTC
Same problem here with Wayland and GIMP showing black boxes for icons on updated F25. Logging in with Gnome Classic solves the issue for me but the classic desktop, well, does not feel right.

Comment 24 Lyude 2017-06-01 00:00:27 UTC
Still working on fixing this and I've made some progress.
However, I'm not at all surprised no one else managed to solve this yet. this is one extremely difficult bug to track down... :(.

Comment 25 Albert 2017-06-02 07:23:28 UTC
Thanks for your work Lyude, can we do something to help you?

Comment 26 Lyude 2017-06-03 00:44:06 UTC
(In reply to Albert from comment #25)
> Thanks for your work Lyude, can we do something to help you?

Nope, thanks for asking! But that's because a little while after I wrote that comment I ended up pinning down where the issue was coming from :)

https://koji.fedoraproject.org/koji/taskinfo?taskID=19815211 once that koji build finishes, can you guys test whether that RPM fixes your issues?

Comment 27 Fedora Update System 2017-06-05 20:56:45 UTC
mesa-17.1.1-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-1491437e8b

Comment 28 Albert 2017-06-06 06:52:58 UTC
I am trying to test it, but 'updates-testing' repo does not list any 'mesa' package

Comment 29 Olivier Fourdan 2017-06-06 06:57:22 UTC
The bodhi update seems to be for f26, for f25 you can pick the scratch build Lyude ran in comment 26

Comment 30 Albert 2017-06-06 07:26:06 UTC
Maybe I'm wrong but from:

https://fedoraproject.org/wiki/Updates_Policy

> There are no "updates" or "updates-testing" Repositories for rawhide. The Bodhi updates system is not used. <

Also, the "updates-testing" repo is showing other packages other packages on F25.


Anyway, I can't find reliable information on how to:

1) Get and install the 'scratch build'
2) Remove the 'scratch build' properly

Comment 31 Fedora Update System 2017-06-06 17:05:06 UTC
mesa-17.0.5-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ea337b6fe2

Comment 32 Lyude 2017-06-06 17:08:33 UTC
Whoops! You will have to excuse me, this is the first time I've ever actually handled a RPM update for Fedora myself ^^;

I've added an update to bodhi for F25. Please let us know the test results there:

https://bodhi.fedoraproject.org/updates/mesa-17.0.5-3.fc25

As well since it sounds like it was a little confusing, here's a direct page to the koji build with all of the RPMs you'll want to download

https://koji.fedoraproject.org/koji/buildinfo?buildID=904589

Comment 33 Fedora Update System 2017-06-06 19:04:49 UTC
mesa-17.1.1-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-1491437e8b

Comment 34 Fedora Update System 2017-06-07 07:34:50 UTC
mesa-17.0.5-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ea337b6fe2

Comment 35 Fedora Update System 2017-06-09 11:30:22 UTC
mesa-17.0.5-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 36 Fedora Update System 2017-06-09 19:27:56 UTC
mesa-17.1.1-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.