Bug 253746

Summary: x11-wm/mutter: Freezes on AMD GPU's with DRI3
Product: Ports & Packages Reporter: Alexander Vereeken <Alexander88207>
Component: Individual Port(s)Assignee: freebsd-gnome (Nobody) <gnome>
Status: Open ---    
Severity: Affects Some People CC: bpurgar, carlosalberto_filho, duchateau.olivier, enlightenment, grahamperrin, michael, patovm04, x11
Priority: --- Flags: bugzilla: maintainer-feedback? (x11)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255049
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257810
https://github.com/freebsd/drm-kmod/issues/72

Description Alexander Vereeken 2021-02-21 18:02:45 UTC
Hello,

when i try to start GNOME using an AMD RX 570 then it freezes directly at start. 
 
But if i tell Xorg to use the scfb driver (Software Rendering) then it works.

Tested with xf86-video-amdgpu and the modesetting driver from package + using drm-kmod from ports with FreeBSD 12.2-STABLE r369250.
Comment 1 Alexander Vereeken 2021-02-21 18:09:18 UTC
Its a x11-wm/mutter issue. When i try to use mutter standalone i have the same issue.
Comment 2 bpurgar 2021-04-20 10:13:20 UTC
Hi

Have same problem on 13-Release and 14-current.
Comment 3 bpurgar 2021-04-27 11:59:28 UTC
I manage to find workround for this problem .. by default xorg use DRI3 as default dri and disabling this and manualy specific to use DRI2 fix problem loading gnome3 and lags/freezes.
Comment 4 Alexander Vereeken 2021-04-27 16:24:58 UTC
I can confirm this too, thank you!

This also works for Cinnamon.
Comment 5 bpurgar 2021-04-27 21:45:48 UTC
Maybe this helps developer to track problem with amdgpu/gnome3 and DRI3.


https://bugzilla.gnome.org/show_bug.cgi?id=711028#c2
Comment 6 Alexander Vereeken 2021-05-01 22:06:28 UTC
The problem also seems to occur with x11-wm/enlightenment. If i want to use the hardware acceleration i must also use DRI2 otherwise i have only a black image with a cursor.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2021-05-02 02:21:04 UTC
Could be similar to bug 251836 i.e., both iris and radeonsi use Gallium. Check if disabling GLX_EXT_buffer_age while keeping DRI3 enabled helps. For example, remove <device> and <application> guards in /usr/local/share/drirc.d/01-freebsd.conf then restart Xorg.
Comment 8 bpurgar 2021-05-02 06:17:56 UTC
Tried .. no difference at all same problem when DRI3 on .
Comment 9 Alexander Vereeken 2022-04-02 13:36:30 UTC
I can confirm that enlightenment is not longer affected since the update 0.25.3.
Comment 10 Graham Perrin freebsd_committer freebsd_triage 2022-07-15 01:23:13 UTC
<https://www.freebsd.org/gnome/> is much improved by <https://reviews.freebsd.org/D35587>. 

<https://www.freebsd.org/gnome/#_state_of_the_port>

> GNOME, MATE, and Cinnamon for FreeBSD are currently fully supported.

IMHO the page will benefit from a mention of the bugs(s) that affect AMD. Thoughts? 

See also: bug 257810
Comment 11 Graham Perrin freebsd_committer freebsd_triage 2022-08-06 12:45:27 UTC
Cross-reference: 

amdgpu no hw acceleration on gnome3 ?? - workaround amdgpu disable DRI3 in xorg.conf and switch to DRI2 · Issue #72 · freebsd/drm-kmod
<https://github.com/freebsd/drm-kmod/issues/72>
Comment 12 Graham Perrin freebsd_committer freebsd_triage 2023-05-13 18:20:33 UTC
I found x11/budgie similarly unusable. 

The xorg.conf(5) workaround was too difficult for me (I can't make sense of the manual page). 

Instead, I added LIBGL_DRI3_DISABLE=1 to the setenv line of login.conf(5), for example: 

        :setenv=BLOCKSIZE=K,LIBGL_DRI3_DISABLE=1:\

– then ran: 

    cap_mkdb /etc/login.conf

<https://man.freebsd.org/cgi/man.cgi?query=login.conf&sektion=5&manpath=freebsd-release>

<https://man.freebsd.org/cgi/man.cgi?query=cap_mkdb&sektion=1&manpath=freebsd-release>
Comment 13 Olivier Duchateau 2023-05-13 19:52:58 UTC
This bug affects all desktops environment based on x11-wm/mutter such as GNOME, Budgie, Pantheon, and also Cinnamon (muffin is fork of mutter).
Comment 14 Guido Falsi freebsd_committer freebsd_triage 2023-05-28 13:23:17 UTC
Hi,

I'm experiencing something similar recently with xfce.

After an update to base (HEAD) xfwm4 (the XFCE window manager) crashes on start.

Relevant findings are already posted in an upstream bug report [1]

For people experiencing the issue with x11-wm/mutter, do you have a crash? maybe a core dump? Could you extract a backtrace? (this requires compiling the port WITH_DEBUG=yes)

Maybe by comparing the backtraces we can get some insight.


[1] https://gitlab.xfce.org/xfce/xfwm4/-/issues/722
Comment 15 bpurgar 2023-05-28 16:27:32 UTC
Hi 

If i remember correctly there is no crash and no core dump.. everything works but there is lagging and freeze. simply unusable for any work. the only progress is seen when switching between consoles. For example Alt+F1 and then back to X alt+F9 … alt+Fx and etc ….
Comment 16 Jan Beich freebsd_committer freebsd_triage 2023-06-04 19:27:19 UTC
DRI3 uses DMABUF according https://lwn.net/Articles/569701/ Does bug 271823 help?
Comment 17 bpurgar 2023-06-04 20:25:09 UTC
Hi ..

Just tested your dma-buff patch on mutter.. nothing changes when enabling DRI 3 in xorg.conf.. problem still persist. :(
Comment 18 bpurgar 2023-12-22 20:57:07 UTC
Just updated to latest drm-515-kmod - xorg .. it looks that DRI3 bug on mutter is not more preset. There is no more lag/freezes.. 

root@pila:~ # cat /var/log/Xorg.0.log | grep DRI3
[   273.657] (==) AMDGPU(0): DRI3 enabled
[   273.729] (II) Initializing extension DRI3
root@pila:~ # 

root@pila:~ # uname -a
FreeBSD pila 15.0-CURRENT FreeBSD 15.0-CURRENT #19 main-n267055-671a00491d7a: Fri Dec 22 21:32:44 CET 2023     root@pila:/usr/obj/usr/src/amd64.amd64/sys/PILA amd64
root@pila:~ # pkg info | grep drm 
drm-515-kmod-5.15.118_2        DRM drivers modules
gpu-firmware-kmod-20230210_1,1 Firmware modules for the drm-kmod drivers
libdrm-2.4.118,1               Userspace interface to kernel Direct Rendering Module services
root@pila:~ # pkg info | grep xorg
xorg-7.7_3                     X.Org complete distribution metaport
xorg-apps-7.7_4                X.org apps meta-port
xorg-docs-1.7.2,1              X.org documentation files
xorg-drivers-7.7_7             X.org drivers meta-port
xorg-fonts-7.7_1               X.org fonts meta-port
xorg-fonts-100dpi-7.7          X.Org 100dpi bitmap fonts
xorg-fonts-75dpi-7.7           X.Org 75dpi bitmap fonts
xorg-fonts-cyrillic-7.7        X.Org Cyrillic bitmap fonts
xorg-fonts-miscbitmaps-7.7     X.Org miscellaneous bitmap fonts
xorg-fonts-truetype-7.7_1      X.Org TrueType fonts
xorg-fonts-type1-7.7           X.Org Type1 fonts
xorg-libraries-7.7_5           X.org libraries meta-port
xorg-macros-1.19.3             X.Org development aclocal macros
xorg-server-21.1.10,1          X.Org X server and related programs
xorgproto-2023.2               X Window System unified protocol definitions
root@pila:~ #
Comment 19 Alexander Vereeken 2023-12-23 10:01:13 UTC
Hello,

can confirm this.

AMD RX 6700 with FreeBSD stable/14-n266029 , DRM 5.15.118_2, xf86-video-amdgpu.
Comment 20 Alexander Vereeken 2024-02-17 12:09:21 UTC
Hello,

i do run GNOME now for a long time and have no issues so far.

Regarding that i would like to close this issue if its fine.