FreeBSDDesktop / DEPRECATED-freebsd-base-graphics

Fork of FreeBSD's base repository to work on graphics-stack-related projects
Other
49 stars 13 forks source link

radeonsi + glamoregl stalls and crashes #143

Closed weabot closed 7 years ago

weabot commented 7 years ago

This is something I've found while trying the latest kernel from the drm-next branch, built today, but I've experienced it with the past pulls.

Here are the graphic infos coming from xorg log.

[    90.108] (II) Loader magic: 0x80cc00
[    90.108] (II) Module ABI versions:
[    90.108]    X.Org ANSI C Emulation: 0.4
[    90.108]    X.Org Video Driver: 20.0
[    90.108]    X.Org XInput driver : 22.1
[    90.108]    X.Org Server Extension : 9.0
[    90.109] (--) PCI:*(0:1:0:0) 1002:6939:1682:9285 rev 0, Mem @ 0xc0000000/268435456, 0xd0000000/2097152, 0xfe900000/262144, I/O @ 0x0000e000/256, BIOS @ 0x????????/65536
[    90.109] (II) LoadModule: "glx"
[    90.115] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    90.305] (II) Module glx: vendor="X.Org Foundation"
[    90.305]    compiled for 1.18.4, module version = 1.0.0
[    90.305]    ABI class: X.Org Server Extension, version 9.0
[    90.305] (==) AIGLX enabled
[    90.305] (II) LoadModule: "amdgpu"
[    90.365] (II) Loading /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so
[    90.393] (II) Module amdgpu: vendor="X.Org Foundation"
[    90.393]    compiled for 1.18.4, module version = 1.1.2
[    90.393]    Module class: X.Org Video Driver
[    90.393]    ABI class: X.Org Video Driver, version 20.0
[ ... ]
[    90.398] (--) Using syscons driver with X support (version 2.0)
[    90.398] (--) using VT number 9

[    90.398] (II) [KMS] Kernel modesetting enabled.
[    90.430] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    90.430] (II) AMDGPU(0): Creating default Display subsection in Screen section
        "Default Screen Section" for depth/fbbpp 24/32
[    90.430] (==) AMDGPU(0): Depth 24, (--) framebuffer bpp 32
[    90.430] (II) AMDGPU(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)
[    90.430] (==) AMDGPU(0): Default visual is TrueColor
[    90.430] (**) AMDGPU(0): Option "TearFree" "on"
[    90.430] (==) AMDGPU(0): RGB weight 888
[    90.430] (II) AMDGPU(0): Using 8 bits per RGB (8 bit DAC)
[    90.430] (--) AMDGPU(0): Chipset: "TONGA" (ChipID = 0x6939)
[    90.430] (II) Loading sub module "fb"
[    90.430] (II) LoadModule: "fb"
[    90.430] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[    90.453] (II) Module fb: vendor="X.Org Foundation"
[    90.453]    compiled for 1.18.4, module version = 1.0.0
[    90.453]    ABI class: X.Org ANSI C Emulation, version 0.4
[    90.453] (II) Loading sub module "dri2"
[    90.453] (II) LoadModule: "dri2"
[    90.453] (II) Module "dri2" already built-in
[    91.963] (II) Loading sub module "glamoregl"
[    91.963] (II) LoadModule: "glamoregl"
[    91.963] (II) Loading /usr/local/lib/xorg/modules/libglamoregl.so
[    92.028] (II) Module glamoregl: vendor="X.Org Foundation"
[    92.028]    compiled for 1.18.4, module version = 1.0.0
[    92.028]    ABI class: X.Org ANSI C Emulation, version 0.4
[    92.028] (II) glamor: OpenGL accelerated X.org driver based.
[    92.077] (II) glamor: EGL version 1.4 (DRI2):
[ ... ]
[    92.379] (II) AMDGPU(0): [DRI2] Setup complete
[    92.379] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[    92.379] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
[    92.379] (II) AMDGPU(0): Front buffer pitch: 14336 bytes
[    92.380] (==) AMDGPU(0): DRI3 disabled
[    92.380] (==) AMDGPU(0): Backing store enabled
[    92.380] (II) AMDGPU(0): Direct rendering enabled
[    92.659] (II) AMDGPU(0): Use GLAMOR acceleration.
[    92.659] (II) AMDGPU(0): Acceleration enabled
[    92.659] (==) AMDGPU(0): DPMS enabled
[    92.659] (==) AMDGPU(0): Silken mouse enabled
[    92.659] (II) AMDGPU(0): Set up textured video (glamor)
[    92.660] (II) AMDGPU(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[    92.719] (--) RandR disabled
[    92.738] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[    92.738] (II) AIGLX: enabled GLX_ARB_create_context
[    92.738] (II) AIGLX: enabled GLX_ARB_create_context_profile
[    92.738] (II) AIGLX: enabled GLX_EXT_create_context_es{,2}_profile
[    92.738] (II) AIGLX: enabled GLX_INTEL_swap_event
[    92.738] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[    92.738] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[    92.738] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[    92.738] (II) AIGLX: enabled GLX_EXT_fbconfig_packed_float
[    92.738] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[    92.738] (II) AIGLX: enabled GLX_ARB_create_context_robustness
[    92.740] (II) AIGLX: Loaded and initialized radeonsi

It's something that I've found on Plasma 5, so the compositor is KWin, while using EGL from OpenGL 2. While the Plasma 5 port is probably still experimental, the error doesn't seem related to it.

This error appears in the logs while the desktop visibly hangs. The tty is also slow but slowly gets better which I think points to a memory issue, but the memory seems fine. Maybe it's VRAM? I don't know enough about these things.

(EE) [mi] EQ overflowing.  Additional events will be discarded until existing events are processed.
(EE) 
(EE) Backtrace:
(EE) 0: /usr/local/bin/X (mieqEnqueue+0x21d) [0x58197d]
(EE) 1: /usr/local/bin/X (QueuePointerEvents+0x4b) [0x44db8b]
(EE) 2: /usr/local/bin/X (xf86PostMotionEvent+0x111) [0x489991]
(EE) 3: /usr/local/lib/xorg/modules/input/mouse_drv.so (_init+0x50fb) [0x810611e9b]
(EE) 4: /usr/local/lib/xorg/modules/input/mouse_drv.so (_init+0x24cf) [0x81060c84f]
(EE) 5: /usr/local/lib/xorg/modules/input/mouse_drv.so (_init+0x1564) [0x81060ab84]
(EE) 6: /usr/local/bin/X (xf86AddEnabledDevice+0x58) [0x47b548]
(EE) 7: /usr/local/bin/X (xf86InstallSIGIOHandler+0x357) [0x49ec97]
(EE) 8: /lib/libthr.so.3 (_pthread_sigmask+0x4f6) [0x802dd8ce6]
(EE) 9: /lib/libthr.so.3 (_pthread_getspecific+0xe5f) [0x802dd8bcf]
(EE) 10: ? (?+0xe5f) [0x7ffffffffff2]
(EE) 11: /lib/libc.so.7 (__sys_sigprocmask+0xa) [0x8026c8ac4]
(EE) 12: /lib/libthr.so.3 (_pthread_sigmask+0x4dc) [0x802dd8ccc]
(EE) 13: /lib/libthr.so.3 (_pthread_getspecific+0xe5f) [0x802dd8bcf]
(EE) 14: ? (?+0xe5f) [0x7ffffffffff2]
(EE) 15: /usr/local/lib/dri/radeonsi_dri.so (radeon_drm_winsys_create+0x3630) [0x807a422c0]
(EE) 16: /usr/local/lib/dri/radeonsi_dri.so (radeon_drm_winsys_create+0x5a8c) [0x807a46b1c]
(EE) 17: /usr/local/lib/dri/radeonsi_dri.so (radeon_drm_winsys_create+0x4e12) [0x807a44d72]
(EE) 18: /usr/local/lib/dri/radeonsi_dri.so (amdgpu_winsys_create+0x11b72) [0x807a65572]
(EE) 19: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x526ee4) [0x807eb8ec4]
(EE) 20: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x548160) [0x807efb000]
(EE) 21: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x35c099) [0x807b23059]
(EE) 22: /usr/local/lib/dri/radeonsi_dri.so (amdgpu_winsys_create+0x10f65) [0x807a63db5]
(EE) 23: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x35df19) [0x807b26b19]
(EE) 24: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x35d7e4) [0x807b25824]
(EE) 25: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x51c08e) [0x807ea2c3e]
(EE) 26: /usr/local/lib/dri/radeonsi_dri.so (amdgpu_winsys_create+0x1b657) [0x807a78b17]
(EE) 27: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x389f23) [0x807b7eef3]
(EE) 28: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x1b2a8e) [0x8077d042e]
(EE) 29: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x144767) [0x8076f3ed7]
(EE) 30: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x1449c8) [0x8076f4388]
(EE) 31: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x144a60) [0x8076f4580]
(EE) 32: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_create_gc+0xe804) [0x80ee292b4]
(EE) 33: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_finish+0x916) [0x80ee0adf6]
(EE) 34: /usr/local/bin/X (miCopyRegion+0x3a8) [0x57fee8]
(EE) 35: /usr/local/bin/X (miDoCopy+0x322) [0x580242]
(EE) 36: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_finish+0xc63) [0x80ee0bc33]
(EE) 37: /usr/local/bin/X (DamageReportDamage+0xf3e) [0x521d2e]
(EE) 38: /usr/local/bin/X (ShmRegisterFbFuncs+0x1fbe) [0x4db79e]
(EE) 39: /usr/local/bin/X (UpdateCurrentTimeIf+0x288) [0x430f68]
(EE) 40: /usr/local/bin/X (remove_fs_handlers+0x587) [0x43aa17]
(EE) 41: /usr/local/bin/X (_start+0x17f) [0x42507f]
(EE) 42: ? (?+0x17f) [0x80083017f]
(EE) 
(EE) [mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.
(EE) [mi] mieq is *NOT* the cause.  It is a victim.
[  2653.050] [mi] Increasing EQ size to 1024 to prevent dropped events.
[  2653.050] [mi] EQ processing has resumed after 53 dropped events.
[  2653.050] [mi] This may be caused by a misbehaving driver monopolizing the server's resources.

I think this issue is caused by another issue by the kernel, as opposed to it being the cause of.

This happens repeatedly after about 30 minutes of use, including video watching and all. Making less extensive use will obviously slow it down, and even after everything is reset and I've switched from EGL to XRender it's still slow and unresponsive. This is why I think it might be memory-related, and the fact that shutting it down and opening it in an environment that makes it unlikely to happen doesn't make it better hints at it being kernel related, which I don't think is very surprising to any of you. However, dmesg shows nothing important.

After a few minutes of it hanging more and more, it crashed with this error:

[  4795.543] (EE) 
[  4795.559] (EE) Backtrace:
[  4808.188] (EE) 0: /usr/local/bin/X (OsInit+0x36a) [0x5a337a]
[  4808.191] (EE) 1: /lib/libthr.so.3 (_pthread_sigmask+0x504) [0x802dd8cf4]
[  4808.193] (EE) 2: /lib/libthr.so.3 (_pthread_getspecific+0xe5f) [0x802dd8bcf]
[  4808.236] (EE) 3: ? (?+0xe5f) [0x7ffffffffff2]
[  4808.238] (EE) 4: /lib/libc.so.7 (memcpy+0x16) [0x802736a8c]
[  4808.239] (EE) 5: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x35c006) [0x807b22fc6]
[  4808.241] (EE) 6: /usr/local/lib/dri/radeonsi_dri.so (amdgpu_winsys_create+0x10f65) [0x807a63db5]
[  4808.243] (EE) 7: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x35df19) [0x807b26b19]
[  4808.245] (EE) 8: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x35d7e4) [0x807b25824]
[  4808.246] (EE) 9: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x51c08e) [0x807ea2c3e]
[  4808.248] (EE) 10: /usr/local/lib/dri/radeonsi_dri.so (amdgpu_winsys_create+0x1b657) [0x807a78b17]
[  4808.250] (EE) 11: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x389f23) [0x807b7eef3]
[  4808.252] (EE) 12: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x1b2a8e) [0x8077d042e]
[  4808.253] (EE) 13: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x144767) [0x8076f3ed7]
[  4808.255] (EE) 14: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x1449c8) [0x8076f4388]
[  4808.257] (EE) 15: /usr/local/lib/dri/radeonsi_dri.so (__driDriverGetExtensions_vmwgfx+0x144a60) [0x8076f4580]
[  4808.273] (EE) 16: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_create_gc+0xe804) [0x80ee292b4]
[  4808.275] (EE) 17: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_finish+0x916) [0x80ee0adf6]
[  4808.277] (EE) 18: /usr/local/bin/X (miCopyRegion+0x3a8) [0x57fee8]
[  4808.279] (EE) 19: /usr/local/bin/X (miDoCopy+0x322) [0x580242]
[  4808.280] (EE) 20: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_finish+0xc63) [0x80ee0bc33]
[  4808.282] (EE) 21: /usr/local/bin/X (DamageReportDamage+0xf3e) [0x521d2e]
[  4808.320] (EE) 22: /usr/local/bin/X (ShmRegisterFbFuncs+0x1fbe) [0x4db79e]
[  4808.323] (EE) 23: /usr/local/bin/X (UpdateCurrentTimeIf+0x288) [0x430f68]
[  4808.324] (EE) 24: /usr/local/bin/X (remove_fs_handlers+0x587) [0x43aa17]
[  4808.326] (EE) 25: /usr/local/bin/X (_start+0x17f) [0x42507f]
[  4808.328] (EE) 26: ? (?+0x17f) [0x80083017f]
[  4808.328] (EE) 
[  4810.247] (EE) Segmentation fault at address 0x8041b1280
[  4810.247] (EE) 
Fatal server error:
[  4810.247] (EE) Caught signal 11 (Segmentation fault). Server aborting
[  4810.247] (EE) 
[  4810.247] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[  4810.247] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  4813.884] (EE) 
[  4813.894] (II) AIGLX: Suspending AIGLX clients for VT switch
[  4813.967] (EE) Server terminated with error (1). Closing log file.

Thank you very much for your work, I'm up for testing any solution you guys come up with or providing you with any additional information you require.

weabot commented 7 years ago

f0806b1 seems to have fixed it. Thank you.