Description of problem: Even the simplest SDL2 applications are not able to work with the iris DRI driver, if DRI2 and the intel DDX driver is in use instead of modesetting. Version-Release number of selected component (if applicable): EL up to version 8 Fedora up to version 33 (Rawhide) Basically, everything up to xorg-x11-drv-intel-2.99.917-45.20200205.fc33 is affected. https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1071#note_374809227 Steps to reproduce: 1. Configure X.Org to use DRI2 and the intel DDX driver. 2. Reboot system. 3. Log-in in any desktop environment that uses X.Org (GNOME on X.Org, GNOME Classic, MATE, etc.). 4. Run Widelands from Flathub. When it comes to Fedora, you can use the native package instead. For EL, please use the flatpak package. X.Org configuration: ``` # cat /etc/X11/xorg.conf.d/20-intel.conf Section "Device" Identifier "Intel" #Driver "modesetting" Driver "intel" ### Option "TearFree" "True" #Option "DRI" "3" Option "DRI" "2" EndSection ``` Widelands packages: https://flathub.org/apps/details/org.widelands.Widelands https://github.com/scx/widelands-flatpak https://koji.fedoraproject.org/koji/packageinfo?packageID=4332 https://copr.fedorainfracloud.org/coprs/scx/widelands Expected results: Run the application. Actual results: Crash the application. Additional info: https://github.com/widelands/widelands/issues/3937 https://github.com/flatpak/flatpak/issues/3673 https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1071 https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188 dmesg log: ``` [ 399.377617] widelands[5462]: segfault at 24 ip 00007f7d795db1dc sp 00007ffe6c3f8d30 error 6 in libgallium_dri.so[7f7d78bd6000+cfd000] ``` gdb log: ``` $ flatpak run -d --command=sh org.widelands.Widelands [📦 org.widelands.Widelands ~]$ gdb GNU gdb (GDB) 8.3.1 Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) file widelands Reading symbols from widelands... (No debugging symbols found in widelands) (gdb) run Starting program: /app/bin/widelands warning: File "/usr/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". To enable execution of this file add add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libthread_db-1.0.so line to your configuration file "/home/scx/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/scx/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. This is Widelands Version build-20 (Release) Set home directory: /home/scx/.widelands Adding directory: /app/share/widelands selected language: (system language) using locale en_US.UTF-8 [New LWP 9] [New LWP 10] [New LWP 11] [New LWP 12] Graphics: Try to set Videomode 800x600 Graphics: OpenGL: Version "4.6 (Compatibility Profile) Mesa 20.0.5" Graphics: SDL_GL_RED_SIZE is 8 Graphics: SDL_GL_GREEN_SIZE is 8 Graphics: SDL_GL_BLUE_SIZE is 8 Graphics: SDL_GL_ALPHA_SIZE is 0 Graphics: SDL_GL_BUFFER_SIZE is 24 Graphics: SDL_GL_DOUBLEBUFFER is 1 Graphics: SDL_GL_DEPTH_SIZE is 24 Graphics: SDL_GL_STENCIL_SIZE is 8 Graphics: SDL_GL_ACCUM_RED_SIZE is 0 Graphics: SDL_GL_ACCUM_GREEN_SIZE is 0 Graphics: SDL_GL_ACCUM_BLUE_SIZE is 0 Graphics: SDL_GL_ACCUM_ALPHA_SIZE is 0 Graphics: SDL_GL_STEREO is 0 Graphics: SDL_GL_MULTISAMPLEBUFFERS is 0 Graphics: SDL_GL_MULTISAMPLESAMPLES is 0 Graphics: SDL_GL_ACCELERATED_VISUAL is 1 Graphics: SDL_GL_CONTEXT_MAJOR_VERSION is 2 Graphics: SDL_GL_CONTEXT_MINOR_VERSION is 1 Graphics: SDL_GL_CONTEXT_FLAGS is 0 Graphics: SDL_GL_CONTEXT_PROFILE_MASK is 2 Graphics: SDL_GL_SHARE_WITH_CURRENT_CONTEXT is 0 Graphics: SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is 0 Graphics: OpenGL: Double buffering enabled Graphics: OpenGL: Max texture size: 16384 Graphics: OpenGL: ShadingLanguage: "4.60" Thread 1 "widelands" received signal SIGSEGV, Segmentation fault. 0x00007ffff3fb71dc in ?? () from /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/iris_dri.so (gdb) quit A debugging session is active. Inferior 1 [process 5] will be killed. Quit anyway? (y or n) y [📦 org.widelands.Widelands ~]$ exit exit ``` The reason of using DRI2 and the intel DDX driver instead of modesetting: https://github.com/flatpak/flatpak/issues/3673#issuecomment-650287489 In my opinion, it is the iris driver breaking ABI, but it seems that Intel is not interested into fixing it in Mesa. Instead, they provided fix in xf86-video-intel. https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811 Related issues: https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/193 https://gitlab.freedesktop.org/mesa/mesa/-/issues/2845 https://gitlab.freedesktop.org/mesa/mesa/-/issues/2858 https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188 Currently, almost all Linux distributions are affected, including Fedora Rawhide and openSUSE Tumbleweed. When it comes to major Linux distributions, only Arch or Gentoo are not affected, because they tend to use the latest commit. Although CentOS 7 doesn't provide the iris driver, it is affected as well, because Freedesktop 19.08 uses Mesa 20.x, in which iris is the default driver. This means that all current flatpak packages from Flathub are affected. The solution is to patch xf86-video-intel in all current Linux distributions. I've created the xorg-x11-drv-intel repo for EL 6-8 and Fedora 30-33: https://copr.fedorainfracloud.org/coprs/scx/xorg-x11-drv-intel/ I've already tested it in RHEL 7 and Fedora 32. I can confirm it works. SRC RPM: https://download.copr.fedorainfracloud.org/results/scx/xorg-x11-drv-intel/fedora-32-x86_64/01524761-xorg-x11-drv-intel/xorg-x11-drv-intel-2.99.917-46.20200205.fc32.src.rpm Full RPM SPEC: https://download.copr.fedorainfracloud.org/results/scx/xorg-x11-drv-intel/fedora-32-x86_64/01524761-xorg-x11-drv-intel/xorg-x11-drv-intel.spec Diff: ``` $ diff xorg-x11-drv-intel.spec.bak xorg-x11-drv-intel.spec | head -n -4 11c11 < Release: 45%{?gitrev}%{?dist} --- > Release: 46%{?gitrev}%{?dist} 24a25,26 > # https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811 > Patch10: 0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch 71a74 > %patch10 -p1 -b .dri2-iris ``` Patch ("0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"): https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811.patch
Created attachment 1700218 [details] Upstream patch for xf86-video-intel (xorg-x11-drv-intel) In mesa i915/i965 pass the bpp to use when creating the surface, but the gallium state tracker passed the depth. As it happens that BitsPerPixel(format) will do the right thing for both, use that.
Created attachment 1700219 [details] X.Org configuration X.Org configuration with DRI2 and the intel DDX driver instead of modesetting
Created attachment 1700220 [details] RPM SPEC RPM SPEC with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"
Created attachment 1700221 [details] dmesg log Error in libgallium_dri.so
Created attachment 1700223 [details] gdb log Error in /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/iris_dri.so
Created attachment 1700225 [details] SRPM for EL6 SRPM for EL6 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"
Created attachment 1700226 [details] SRPM for EL7 SRPM for EL7 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"
Created attachment 1700227 [details] SRPM for EL8 SRPM for EL8 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"
Created attachment 1700228 [details] SRPM for FC30-FC31 SRPM for FC30-FC31 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"
Created attachment 1700229 [details] SRPM for FC32-FC33 SRPM for FC32-FC33 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"
I think I'm affected by this bug in Fedora 32. I don't have problem with kernel version 5.6.19. Kernel version from 5.7 are freezing my machine if acceleration is enabled. See my opened bug https://bugzilla.redhat.com/show_bug.cgi?id=1855558 I installed xorg-x11-drv-intel-2.99.917-46.20200205.fc32.x86_64 but this doesn't resolved the issue. Is it the same bug or are they possibly related?
> Is it the same bug or are they possibly related? I think it may be an another problem with the iris driver. You can try to force use i965. However, please keep in mind that Gen12+ GPUs are supported only by iris. At first, try this: MESA_LOADER_DRIVER_OVERRIDE=i965 vlc or this: export MESA_LOADER_DRIVER_OVERRIDE=i965; vlc If that helps, put this in ~/.drirc (user), /etc/drirc or /usr/share/drirc.d/01-i915-force-i965.conf (system): <?xml version="1.0" standalone="yes"?> <driconf> <device driver="loader" kernel_driver="i915"> <option name="dri_driver" value="i965" /> </device> </driconf>
Same problem on Fedora 33 with new kernel.
Using kernel 5.11.0-0.rc7.149.fc34.x86_64 on Intel G3420. So far, so good.
This message is a reminder that Fedora 32 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '32'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 32 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.