NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

Stopping display-manager leads to black screen on 15.09 #9755

Closed khumba closed 7 years ago

khumba commented 9 years ago

On NixOS 15.09 (f9799e7), if I stop display-manager.service, then my laptop's display powers off and doesn't come back, even if I start the service again and try switching back and forth between the X server and the ttys. I'm on an ASUS N550JK with:

$ lspci -knn
...
00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller [8086:0416] (rev 06)
        Subsystem: ASUSTeK Computer Inc. Device [1043:11cd]
        Kernel driver in use: i915
01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 850M] [10de:1391] (rev a2)
        Subsystem: ASUSTeK Computer Inc. Device [1043:11cd]

and I'm only using the Intel card (I have the nouveau kernel module blacklisted, previously it was causing problems).

Curiously, having the X server restart at the end of a session isn't problematic.

Works fine on 14.12 (0341382).

khumba commented 9 years ago

Happens regardless of choice of DM. Tested with SLiM and KDE.

domenkozar commented 9 years ago

I've just tried it on 15.09.295.f9799e7 (Dingo) and it works for me (i3 + xfce), intel graphics

khumba commented 9 years ago

Good to know, thanks Domen. It might just be a hardware bug with this kernel; I'd like to test a different version. As far as I recall, it works fine on my Gentoo install as well (with linux-4.0.5, no systemd), and this kernel (3.18.21) is between that and the 14.12 kernel (3.14.50).

vcunat commented 9 years ago

Maybe related: during the last few months, whenever I leave my notebook unattended for a long time, it tries to make the display sleep or something, and it stays blank afterwards. The only work-around for me is to switch to a virtual terminal and back to X. This didn't happen before; I'm using 3.18.x kernels and always was using nvidia (binary) drivers.

domenkozar commented 9 years ago

@vcunat I get that too. And when I switch back from terminal, X crashes.

Using Intel, kernel 4.1, and external monitor.

[47070.549076] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.550074] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.551070] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.552059] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.552558] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.553057] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.555809] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.559749] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47070.560742] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47089.095046] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47089.096090] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47089.097123] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47089.098153] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47089.101078] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47089.105482] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)!
[47095.239906] ------------[ cut here ]------------
[47095.239924] WARNING: CPU: 2 PID: 762 at /tmp/nix-build-linux-4.1.6.drv-0/linux-4.1.6/drivers/gpu/drm/i915/intel_dp.c:140 intel_dp_max_link_bw.isra.7+0x31/0x60 [i915]()
[47095.239925] invalid max DP link bw val 0, using 1.62Gbps
[47095.239926] Modules linked in: ctr ccm fuse af_packet cmac rfcomm bnep snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ext2 mbcache uvcvideo videobuf2_vmalloc videobuf2_memops btusb btbcm videobuf2_core btintel joydev bluetooth mousedev v4l2_common cdc_mbim cdc_wdm cdc_acm crc16 videodev cdc_ncm usbnet crc32_pclmul mii iwlmvm ghash_clmulni_intel coretemp mac80211 crct10dif_pclmul intel_powerclamp x86_pkg_temp_thermal snd_pcm_oss evdev i915 snd_mixer_oss mac_hid intel_gtt drm_kms_helper serio_raw psmouse arc4 iwlwifi drm thermal cfg80211 ecb tpm_tis wmi battery ac snd_hda_intel agpgart tpm video i2c_algo_bit snd_hda_controller i2c_core snd_hda_codec e1000e snd_hda_core button snd_hwdep shpchp mei_me snd_pcm ptp processor mei snd_timer lpc_ich pps_core thermal_sys ppp_mppe ppp_generic
[47095.239958]  slhc loop cpufreq_ondemand vboxnetflt(O) vboxnetadp(O) vboxdrv(O) thinkpad_acpi nvram hwmon rfkill snd soundcore kvm_intel kvm ipv6 autofs4 atkbd libps2 aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd sd_mod xhci_pci rtc_cmos i8042 serio unix crc32c_generic crc32c_intel btrfs zlib_deflate xor raid6_pq hid_lenovo led_class ums_realtek usb_storage hid_generic ohci_hcd usbhid hid uhci_hcd ahci libahci libata scsi_mod ehci_pci ehci_hcd xhci_hcd usbcore usb_common dm_crypt dm_mod
[47095.239984] CPU: 2 PID: 762 Comm: X Tainted: G        W  O    4.1.6 #1-NixOS
[47095.239985] Hardware name: LENOVO 20BS006BSC/20BS006BSC, BIOS N14ET25W (1.03 ) 12/01/2014
[47095.239986]  ffffffffa0bddc90 ffff8800b591f958 ffffffff814cca34 0000000000000007
[47095.239988]  ffff8800b591f9a8 ffff8800b591f998 ffffffff8106d2ca 0000000000000000
[47095.239990]  0000000000000000 ffffffffa0bc86e8 ffff88021ff08000 ffff8800b591fa98
[47095.239992] Call Trace:
[47095.239998]  [<ffffffff814cca34>] dump_stack+0x45/0x57
[47095.240001]  [<ffffffff8106d2ca>] warn_slowpath_common+0x8a/0xc0
[47095.240004]  [<ffffffff8106d346>] warn_slowpath_fmt+0x46/0x50
[47095.240012]  [<ffffffffa0b9bc41>] intel_dp_max_link_bw.isra.7+0x31/0x60 [i915]
[47095.240019]  [<ffffffffa0b9d3ea>] intel_dp_common_rates+0x3a/0x100 [i915]
[47095.240026]  [<ffffffffa0a1c458>] ? drm_crtc_get_hv_timing+0x48/0x80 [drm]
[47095.240033]  [<ffffffffa0b9da18>] intel_dp_compute_config+0xb8/0x7b0 [i915]
[47095.240040]  [<ffffffffa0b97418>] intel_ddi_compute_config+0x48/0xa0 [i915]
[47095.240048]  [<ffffffffa0b7bbea>] intel_modeset_compute_config+0x6da/0x10c0 [i915]
[47095.240056]  [<ffffffffa0b820f0>] intel_crtc_set_config+0x780/0x1040 [i915]
[47095.240063]  [<ffffffffa0a1ddc6>] drm_mode_set_config_internal+0x66/0x100 [drm]
[47095.240069]  [<ffffffffa0a2227b>] drm_mode_setcrtc+0x25b/0x610 [drm]
[47095.240074]  [<ffffffffa0a129e5>] drm_ioctl+0x1a5/0x6a0 [drm]
[47095.240077]  [<ffffffff811cd410>] do_vfs_ioctl+0x2e0/0x4e0
[47095.240080]  [<ffffffff811bb3a5>] ? __sb_end_write+0x35/0x70
[47095.240082]  [<ffffffff811b9022>] ? vfs_write+0x182/0x1b0
[47095.240084]  [<ffffffff811cd691>] SyS_ioctl+0x81/0xa0
[47095.240087]  [<ffffffff814d236e>] system_call_fastpath+0x12/0x71
[47095.240088] ---[ end trace d6567219f70e6fb3 ]---
vcunat commented 9 years ago

I get no problems from it and dmesg is clear.

khumba commented 9 years ago

It's a problem with xf86-video-intel since the last release, 2.99.917. I switched back to that version and the problem is gone. I'd like to try git HEAD and failing that, bisect.

khumba commented 9 years ago

Upstream bug here:

https://bugs.freedesktop.org/show_bug.cgi?id=91974

domenkozar commented 9 years ago

Awesome job.

khumba commented 9 years ago

:). I tried switching from 15.09 to a full system built off of master (83a5cfb), and unfortunately downgrading to 2.99.917 doesn't fly here, X just fails to start:

[    54.800] (WW) Falling back to old probe method for cirrus
[    54.800] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20150327
[    54.800] (WW) Falling back to old probe method for vesa
[    54.800] (WW) Falling back to old probe method for modesetting
[    54.800] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 4600
[    54.800] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2
[    54.800] (II) intel(0): Creating default Display subsection in Screen section
    "Screen-intel[0]" for depth/fbbpp 24/32
[    54.800] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[    54.800] (==) intel(0): RGB weight 888
[    54.800] (==) intel(0): Default visual is TrueColor
[    54.801] (EE) 
[    54.801] (EE) Backtrace:
[    54.801] (EE) 0: /nix/store/w4nh4907ihcbm0szg6q5n56g5ija5bqh-xorg-server-1.17.2/bin/X (xorg_backtrace+0x49) [0x587a19]
[    54.801] (EE) 1: /nix/store/w4nh4907ihcbm0szg6q5n56g5ija5bqh-xorg-server-1.17.2/bin/X (0x400000+0x18b999) [0x58b999]
[    54.801] (EE) 2: /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libpthread.so.0 (0x7f4fa188a000+0x103e0) [0x7f4fa189a3e0]
[    54.801] (EE) 
[    54.801] (EE) Segmentation fault at address 0x0
[    54.801] (EE) 
Fatal server error:
[    54.801] (EE) Caught signal 11 (Segmentation fault). Server aborting
[    54.801] (EE) 
[    54.801] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[    54.801] (EE) Please also check the log file at "/var/log/X.0.log" for additional information.
[    54.801] (EE) 
[    54.804] (EE) Server terminated with error (1). Closing log file.
jagajaga commented 8 years ago

PIng.

khumba commented 8 years ago

Nothing new right now; I wiped my laptop and haven't finished getting my NixOS environment set up again but I want to see if this is still an issue for me on the 16.03 branch. I'll finish that up and let you know.

jagajaga commented 8 years ago

@khumba thank you!

khumba commented 8 years ago

Still the same problem on release-16.03, 89d9159.

jagajaga commented 8 years ago

That's too sad :(

khumba commented 8 years ago

I tried this on Gentoo with xorg-server-1.17.4 (same version as NixOS), xf86-video-intel at 636b5291 (2016-02-13), and OpenRC, and couldn't repro.

vcunat commented 8 years ago

I really don't know what to think of the intel driver in general. Last stable release (2.21.15) was more than two years ago and the least pre-release (2.99.917) more than a year ago...

@khumba: what about trying the same driver version on NixOS?

diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index bb9e73d..b1458ee 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -1799,11 +1799,11 @@ let
   }) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};

   xf86videointel = (mkDerivation "xf86videointel" {
-    name = "xf86-video-intel-2015-11-14";
+    name = "xf86-video-intel-2016-02-13";
     builder = ./builder.sh;
     src = fetchurl {
-      url = http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/0340718366d7cb168a46930eb7be22f2d88354d8.tar.gz;
-      sha256 = "0x11dig1wmpjz5n35sh30zs58ar8q8836w3zrkwkvgxj6q6smvvr";
+      url = http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/636b5291.tar.gz;
+      sha256 = "1pmhf1kwpai4x5bxna7zdfr9zs4j50c6v56jqxjkclr811p8w3pw";
     };
     buildInputs = [pkgconfig dri2proto dri3proto fontsproto libdrm libpng udev libpciaccess presentproto randrproto renderproto libX11 xcbutil libxcb libXcursor libXdamage libXext xextproto xf86driproto libXfixes xorgserver xproto libXrandr libXrender libxshmfence libXtst libXvMC ];
     meta.platforms = stdenv.lib.platforms.unix;
khumba commented 8 years ago

Hi, sorry but I'm heading on vacation for two months starting this morning and won't be able to test this until I get back. Since that's the case, please don't hold 16.03 up for me :).

vcunat commented 8 years ago

OK. As noone else here seems to complain, I think this issue certainly won't block the release.

khumba commented 8 years ago

I did a fresh round of testing, and am still seeing the problem on vanilla release-16.03 at 6e0dddf, and also master at 06aae7c plus linux-4.6 and the latest git of xf86-video-intel (25d2c2d). See comment 13 on the Freedesktop bug.

fpletz commented 7 years ago

We don't support 16.03 anymore. Please open a new ticket for 17.03 is this still happens on master. Thanks!