Constant X crashes when resuming from suspend to ram with external VGA display connected

On my Lenovo T61 with Quadro NVS 140M the X server always crashes when resuming from suspend to ram. This worked in 90% of cases before I did a major system update (Xorg, KDE, …).

Current versions: Xorg 1.14.2, Vanilla kernel 3.9.9, nvidia driver 325.15

Xorg log shows:
[ 191.064] (II) NVIDIA(0): Setting mode “DFP-0:nvidia-auto-select{},CRT-0:nvidia-auto-select{}”
[ 193.174] (EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.
[ 193.174] (EE) NVIDIA(0): *** Aborting ***

Steps to reproduce:

  1. While Laptop is powered off connect external display to VGA port
  2. Switch on laptop, KDM starts with X expanded to both monitors
  3. Login to KDE
  4. Suspend to RAM
  5. Resume -> crash, X is restarted, KDM shows login screen

Since KDM automatically restarted X after the crash the log parts from the nvidia bug report zip don’t contain the error. Please refer to the attached Xorg.0.log.old instead.

Thanks,
Jens

Xorg.0.log.old.gz (20.4 KB)
nvidia-bug-report.log.gz (83.3 KB)

Actually it might be unrelated to the external monitor. Right now it also happens quite often when suspending and resuming without the external monitor. The error in the log is the same.

Same here. Also with KDE and with twinview (two monitors).

This seems to happen when VRAM is full and there’s a framebuffer resize/reallocation. Resuming from suspend or just connecting extra monitors triggers it sometimes.

Jul 14 10:09:12 hive gdm-Xorg-:0[481]: (II) NVIDIA(0): Setting mode "VGA-0: nvidia-auto-select @1920x1080 +0+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0}"
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) NVIDIA(0):  *** Aborting ***
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     may not be running or the "AcpidSocketPath" X
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     configuration option may not be set correctly.  When the
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     ACPI event daemon is available, the NVIDIA X driver will
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     try to use it to receive ACPI event notifications.  For
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     details, please see the "ConnectToAcpid" and
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     "AcpidSocketPath" X configuration options in Appendix B: X
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(0):     Config Options in the README.
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(GPU-0): Display (NEC E231W (CRT-0)) does not support NVIDIA 3D Vision
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(GPU-0):     stereo.
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(GPU-0): Display (AU Optronics Corporation (DFP-0)) does not support
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (II) NVIDIA(GPU-0):     NVIDIA 3D Vision stereo.
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE)
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) Backtrace:
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 0: /usr/libexec/Xorg.bin (OsLookupColor+0x119) [0x59b6f9]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f44b8f87c7f]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) unw_get_proc_name failed: no unwind info found [-10]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 2: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (?+0x0) [0x7f44b2e64a90]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 3: /lib64/libnvidia-glcore.so.340.24 (nvidiaAddDrawableHandler+0x50c7b9) [0x7f44b387f5b9]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 4: /lib64/libnvidia-glcore.so.340.24 (nvidiaAddDrawableHandler+0x510f04) [0x7f44b38884b4]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 5: /lib64/libnvidia-glcore.so.340.24 (nvidiaAddDrawableHandler+0x520b32) [0x7f44b38a7d32]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 6: /lib64/libnvidia-glcore.so.340.24 (nvidiaAddDrawableHandler+0x5183c1) [0x7f44b3896e51]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 7: /usr/libexec/Xorg.bin (xf86VTEnter+0x10b) [0x477eab]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 8: /usr/libexec/Xorg.bin (WakeupHandler+0x6b) [0x43dc6b]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 9: /usr/libexec/Xorg.bin (WaitForSomething+0x1c7) [0x594937]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 10: /usr/libexec/Xorg.bin (SendErrorToClient+0x111) [0x438e31]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 11: /usr/libexec/Xorg.bin (remove_fs_handlers+0x416) [0x43d166]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 12: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f44b8f720c0]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 13: /usr/libexec/Xorg.bin (_start+0x29) [0x4275ce]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) 14: ? (?+0x29) [0x29]
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE)
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE) Segmentation fault at address 0x30
Jul 14 10:09:13 hive gdm-Xorg-:0[481]: (EE)

xorg.txt (153 KB)

In order not to create a new thread,
I am confirming here the same problem, without any external display.

Suspend / resume often works, but quite often there is a crash at resume with
(EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.

(EE) Segmentation fault at address 0x24
Then a restart of X + kdm + kde follows. The address 0x24 is always the same.

Internet search leads to no solution, just confirms that the issue has been there for a few years.

My hardware / software:
Lenovo T61, Quadro NVS 140M, Debian 8.4,
NVIDIA 340.96 installed by Debian packages,
Xorg etc - as default in Debian.
Screen size 1680x1050, depth 24,
nvidia-settings often shows high usage of Used Dedicated Memory, like 98% out of 128 MB.

There was no such such problem with Debian 6 and NVIDIA 195.36.31.

Additional info. Sometimes the message
(EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.
is not related to a segfault.

I have the same problem on my aged XPS M1330 laptop running Kubuntu 16.04 resuming from
suspend to RAM and with no external display.
I would guess 2 out of 5 times the machine resumes but the x-server dies and restarts,
losing my session.

To be honest I have had this problem with the nvidia driver for several years and several
releases of Ubuntu, maybe going back to about 10.? or 12.?. There was a time when I
used suspend to disk and it was more reliable, but that doesn’t seem to an option these days.
I seem to be stuck with suspend to RAM.

lspci reports:
01:00.0 VGA compatible controller: NVIDIA Corporation G86M [GeForce 8400M GS] (rev a1)

with nvidia driver
||/ Name Version Architecture Description
++±=======================-================-================-===================================================
ii nvidia-340 340.101-0ubuntu0 amd64 NVIDIA binary driver - version 340.101

though, as I say it has been this way for a few driver releases

current kernel is:
Linux 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I boot with the nopat option and have 8Gb of RAM and 8Gb of swap.

[   103.339] (II) NVIDIA(GPU-0): Display (Toshiba Matsushita Display Technology Co., Ltd
[   103.339] (II) NVIDIA(GPU-0):     (DFP-0)) does not support NVIDIA 3D Vision stereo.
                       <<< suspend and resume here??
[ 15108.526] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"
[ 15109.841] (EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.
[ 15109.841] (EE) NVIDIA(0):  *** Aborting ***
[ 15109.849] (II) NVIDIA(GPU-0): Display (Toshiba Matsushita Display Technology Co., Ltd
[ 15109.849] (II) NVIDIA(GPU-0):     (DFP-0)) does not support NVIDIA 3D Vision stereo.
[ 15109.853] (EE) 
[ 15109.853] (EE) Backtrace:
[ 15109.873] (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4e) [0x5643beae5ade]
[ 15109.873] (EE) 1: /usr/lib/xorg/Xorg (0x5643be933000+0x1b6e69) [0x5643beae9e69]
[ 15109.873] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (0x7f02c918e000+0x354b0) [0x7f02c91c34b0]
[ 15109.873] (EE) 3: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f02c30b2000+0x8d8cd) [0x7f02c313f8cd]
[ 15109.873] (EE) 4: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f02c30b2000+0x62cbf9) [0x7f02c36debf9]
[ 15109.873] (EE) 5: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f02c30b2000+0x631354) [0x7f02c36e3354]
[ 15109.873] (EE) 6: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f02c30b2000+0x640e72) [0x7f02c36f2e72]
[ 15109.873] (EE) 7: /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so (0x7f02c30b2000+0x638841) [0x7f02c36ea841]
[ 15109.873] (EE) 8: /usr/lib/xorg/Xorg (xf86VTEnter+0x10b) [0x5643be9c824b]
[ 15109.873] (EE) 9: /usr/lib/xorg/Xorg (WakeupHandler+0x6d) [0x5643be98b95d]
[ 15109.873] (EE) 10: /usr/lib/xorg/Xorg (WaitForSomething+0x1ef) [0x5643beae281f]
[ 15109.874] (EE) 11: /usr/lib/xorg/Xorg (0x5643be933000+0x53b8e) [0x5643be986b8e]
[ 15109.874] (EE) 12: /usr/lib/xorg/Xorg (0x5643be933000+0x57dd3) [0x5643be98add3]
[ 15109.874] (EE) 13: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf0) [0x7f02c91ae830]
[ 15109.874] (EE) 14: /usr/lib/xorg/Xorg (_start+0x29) [0x5643be975049]
[ 15109.874] (EE) 
[ 15109.874] (EE) Segmentation fault at address 0x30
[ 15109.874] (EE) 
Fatal server error:
[ 15109.874] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 15109.874] (EE) 
[ 15109.874] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[ 15109.874] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 15109.874] (EE) 
[ 15111.559] (EE) Server terminated with error (1). Closing log file.

I could upload an nvidia-bug-report.log.gz, if there was an option in this web interface,
but because the X-server restarts, the included Xorg.0.log is not the one that failed.

Thanks
Doug
nvidia-bug-report.log.gz (66.9 KB)