Bug 102222 - dix/dispatch.c:4049: AttachOffloadGPU: Assertion `new->current_master == pScreen' failed.
Summary: dix/dispatch.c:4049: AttachOffloadGPU: Assertion `new->current_master == pScr...
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xorg (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-14 17:46 UTC by Paul Menzel
Modified: 2017-08-15 04:20 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Stack trace captured with GDB (20.96 KB, text/plain)
2017-08-14 17:46 UTC, Paul Menzel
no flags Details
X server messages (`/var/log/Xorg.5.log`), with BLFS patch adding PRIME support (17.95 KB, text/plain)
2017-08-15 04:08 UTC, Paul Menzel
no flags Details
Messages (`/var/log/Xorg.0.log`) from X server without patch adding PRIME support (33.82 KB, text/plain)
2017-08-15 04:20 UTC, Paul Menzel
no flags Details

Description Paul Menzel 2017-08-14 17:46:05 UTC
Created attachment 133507 [details]
Stack trace captured with GDB

With a Dell Precision 3620 system with an Intel Skylake system i7-6700K, and an external AMD graphics card, the X.Org server does not start and hits an assert. The software stack is Linux 4.9.38 and 4.12.5, X.Org server 1.19.3 and xf86-video-amdgpu 1.3.0 [1].

```
$ lspci -nn -s 00:01.0
00:01.0 PCI bridge [0604]: Intel Corporation Skylake PCIe Controller (x16) [8086:1901] (rev 07)
$ lspci -nn -s 1:00.0
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Bonaire [FirePro W5100] [1002:6649]
```

The monitor’s DVI cable and a DVI-to-DP adapter is plugged into the DisplayPort port of the AMD graphics card. The TTY login screen can be shortly seen before GDM tries to start.

Please find the last X.Org server messages below.

```
[…]
(II) Loading /usr/lib/xorg/modules/libfb.so
(II) Module fb: vendor="X.Org Foundation"
        compiled for 1.19.3, module version = 1.0.0
(--) Depth 24 pixmap format is 32 bpp
(==) modeset(G0): Backing store enabled
(==) modeset(G0): Silken mouse enabled
(II) modeset(G0): RandR 1.2 enabled, ignore the following RandR disabled message.
(==) modeset(G0): DPMS enabled
(II) modeset(G0): [DRI2] Setup complete
(II) modeset(G0): [DRI2]   DRI driver: i965
(II) modeset(G0): [DRI2]   VDPAU driver: i965
(II) AMDGPU(0): [DRI2] Setup complete
(II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
(II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
(II) AMDGPU(0): Front buffer pitch: 6912 bytes
(II) AMDGPU(0): SYNC extension fences enabled
(II) AMDGPU(0): Present extension enabled
(==) AMDGPU(0): DRI3 enabled
(==) AMDGPU(0): Backing store enabled
(II) AMDGPU(0): Direct rendering enabled
(II) AMDGPU(0): Use GLAMOR acceleration.
(II) AMDGPU(0): Acceleration enabled
(==) AMDGPU(0): DPMS enabled
(==) AMDGPU(0): Silken mouse enabled
(II) AMDGPU(0): Set up textured video (glamor)
(II) AMDGPU(0): RandR 1.2 enabled, ignore the following RandR disabled message.
(--) RandR disabled
Xorg: /dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/dix/dispatch.c:4049: AttachOffloadGPU: Assertion `new->current_master == pScreen' failed.
```

The USB keyboard does not work, and the system has to be controlled remotely over SSH. Plugging in the DisplayPort cable into the internal Intel graphics ports the Linux messages can be seen, but nothing else works. Stopping GDM does not bring back the TTY screen. The keyboard still does work. Plugging the USB cable out and back in doesn’t fix it either.

Trying to disable the internal Intel graphics card in the firmware, does not fix the problem either.

But unloading the module i915 helps. When loading it while GDM has been started, the messages below are seen.

```
[Mon Aug 14 17:50:21 2017] [drm] Memory usable by graphics device = 4096M
[Mon Aug 14 17:50:21 2017] [drm] Replacing VGA console driver
[Mon Aug 14 17:50:21 2017] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[Mon Aug 14 17:50:21 2017] [drm] Driver supports precise vblank timestamp query.
[Mon Aug 14 17:50:21 2017] amdgpu 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[Mon Aug 14 17:50:21 2017] [drm] Initialized i915 1.6.0 20170403 for 0000:00:02.0 on minor 1
[Mon Aug 14 17:50:21 2017] [drm] Finished loading DMC firmware i915/skl_dmc_ver1_26.bin (v1.26)
[Mon Aug 14 17:50:22 2017] [drm] Cannot find any crtc or sizes - going 1024x768
[Mon Aug 14 17:50:22 2017] i915 0000:00:02.0: fb1: inteldrmfb frame buffer device
[Mon Aug 14 17:50:22 2017] [drm] RC6 on
[Mon Aug 14 17:50:23 2017] gdm[755]: gdm-binary[755]: WARNING: GdmDisplay: display lasted 0.872975 seconds
[Mon Aug 14 17:50:24 2017] gdm[755]: gdm-binary[755]: WARNING: GdmDisplay: display lasted 0.443200 seconds
[Mon Aug 14 17:50:24 2017] gdm[755]: gdm-binary[755]: WARNING: GdmDisplay: display lasted 0.432522 seconds
[Mon Aug 14 17:50:24 2017] gdm[755]: gdm-binary[755]: WARNING: GdmDisplay: display lasted 0.432689 seconds
[Mon Aug 14 17:50:25 2017] gdm[755]: gdm-binary[755]: WARNING: GdmDisplay: display lasted 0.435029 seconds
[Mon Aug 14 17:50:25 2017] gdm[755]: gdm-binary[755]: WARNING: GdmDisplay: display lasted 0.433734 seconds
[Mon Aug 14 17:50:25 2017] gdm[755]: gdm-binary[755]: WARNING: GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors
```

Starting an X session as root under GDB, gives the stack trace below.

```
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f0529ebb75a in __GI_abort () at abort.c:89
#2  0x00007f0529eb3027 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x594298 "new->current_master == pScreen", file=file@entry=0x594248 "/dev/shm/bee-root/xorg-server/xorg-server-1.19.3-
0/source/dix/dispatch.c", line=line@entry=4049, function=function@entry=0x5942e0 <__PRETTY_FUNCTION__.19941> "AttachOffloadGPU") at assert.c:92
#3  0x00007f0529eb30d2 in __GI___assert_fail (assertion=assertion@entry=0x594298 "new->current_master == pScreen", file=file@entry=0x594248 "/dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/dix/dispatch
.c", line=line@entry=4049, function=function@entry=0x5942e0 <__PRETTY_FUNCTION__.19941> "AttachOffloadGPU") at assert.c:101
#4  0x000000000043584e in AttachOffloadGPU (pScreen=<optimized out>, new=<optimized out>) at /dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/dix/dispatch.c:4049
#5  0x00000000004a8b96 in xf86AutoConfigOutputDevice (pScrn=0x85deb0, master=0x85d270) at /dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/hw/xfree86/modes/xf86Crtc.c:3485
#6  0x0000000000477603 in xf86AutoConfigOutputDevices () at /dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/hw/xfree86/common/xf86Init.c:307
#7  InitOutput (pScreenInfo=pScreenInfo@entry=0x831c60 <screenInfo>, argc=argc@entry=2, argv=argv@entry=0x7ffca4dc1328) at /dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/hw/xfree86/common/xf86Init.c:8
84
#8  0x0000000000438d06 in dix_main (argc=2, argv=0x7ffca4dc1328, envp=<optimized out>) at /dev/shm/bee-root/xorg-server/xorg-server-1.19.3-0/source/dix/main.c:197
#9  0x00007f0529ea7520 in __libc_start_main (main=0x424250 <main>, argc=2, argv=0x7ffca4dc1328, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffca4dc1318) at ../csu/libc-sta
rt.c:295
#10 0x000000000042427e in _start () at ../sysdeps/x86_64/start.S:122
```

[1] https://lists.freedesktop.org/archives/amd-gfx/2017-August/012045.html
Comment 1 Michel Dänzer 2017-08-15 01:17:00 UTC
Please attach the full Xorg log file leading up to the crash.

I can't find the xf86AutoConfigOutputDevice(s) functions referenced in the backtrace in upstream xserver, so this might be due to a downstream patch.
Comment 2 Paul Menzel 2017-08-15 04:08:54 UTC
Created attachment 133520 [details]
X server messages (`/var/log/Xorg.5.log`), with BLFS patch adding PRIME support

(In reply to Michel Dänzer from comment #1)
> Please attach the full Xorg log file leading up to the crash.

Please find it attached.

> I can't find the xf86AutoConfigOutputDevice(s) functions referenced in the
> backtrace in upstream xserver, so this might be due to a downstream patch.

You are right. The book *Beyond Linux From Scratch* applies a patch adding PRIME support to the X.Org Server to make GPU offloading work [1][2]. I’ll remove that.

[1] http://www.linuxfromscratch.org/blfs/view/svn/x/xorg-server.html
[2] http://www.linuxfromscratch.org/patches/blfs/svn/xorg-server-1.19.3-add_prime_support-1.patch
Comment 3 Paul Menzel 2017-08-15 04:18:35 UTC
Without the patch adding PRIME support GDM starts (at least judging from the output of `systemctl status gdm.service`).

I am sorry for the noise.
Comment 4 Paul Menzel 2017-08-15 04:20:36 UTC
Created attachment 133521 [details]
Messages (`/var/log/Xorg.0.log`) from X server without patch adding PRIME support

Just for the record, here are the X server messages from an X.Org X server build without the BLFS patch adding PRIME support.


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.