May 3, 2015

Ubuntu 15.04 with Intel+GeForce: Boot freezes: solution was acpi

TL;DR

After migration to Ubuntu 15.04 had lots of issues with my Intel+GeForce graphics. Boot screen sometimes was freezing just before Login screen, but sometimes everything just worked. And finally (I hope) I found the solution:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi=force
sudo update-grub
See full instruction at:
http://www.unixmen.com/fix-shutdown-power-computer-ubuntu-14-04/

So sharing this, so others could google error codes and save some time.

If this does not work, see Alternative section

Troubleshooting

The hardest part was to find the cause of the problem, because you do not see error messages and there are no information in logs about the error (will explain later, why). So lets find the cause of the problem:

1. Show information during boot

To do that:
sudo gedit /etc/default/grub
And change:
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT=""
To take effect, we also need to:
sudo update-grub

We disabled beautiful boot animation/picture, and now we can see the error, and at lest we know, what to look for:

2. Go to Ubuntu recovery screen

We could use LiveCD to debug, but for most of Video card problems there should be FailsafeX mode. Problem was that it was hard to choose recovery mode during boot, because default timeout was 0 seconds.

So going to the same file:
sudo gedit /etc/default/grub
And change:
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT=2
 To take effect, we also need to:
 sudo update-grub
So now, computer boots 2 seconds longer, but I have time to press [Esc] and go to GRUB menu with normal and recovery mode boot.

Funny thing is, when I choose recovery mode and press resume, everything loads normally. It could be workaround, but then my HDMI port does not work with GeForce.
However, using recovery mode, computer fully shut downs, so next time video card does not throw tons of error messages.

3. Where are all the logs

I tried various log files, but there were nothing related with nouveau.
After some time googling, I found that those errors should be in:
sudo gedit /var/log/kern.log
But there were no error messages. Why? System hung out before logs were saved to hard drive. Instead there were logs of \00 symbols in the place, where actual log messages should be.
So after booting with recovery mode or LiveCD I saw only good notifications or not finished logs.

The lost noveau error messages in kern.log

To ease pain of other, I did the hard part. Those are textual representation of my error logs:

[  OK  ] Started /etc/rc.local Compatibility.
         Starting Wait for Playmouth Boot Screen to Quit...
         Starting WPA supplicant...
wpa_supplicant.service
[  OK  ] Started WPA supplicant.
[  16.483006] nouveau E [   PBUS][0000:01:00.0] MMIO read of 0x00000000 FAULT at 0x122130 [ IBUS ]
[  16.487699] nouveau E [  PIBUS][0000:01:00.0] HUB0: 0x10ecc0 0xffffffff (0x1b40822c)
[  16.488461] nouveau E [  PIBUS][0000:01:00.0] ROP4: 0xbadf1100 0xbadf1100 (0xbadf1100)

[  16.486078] nouveau E [  PIBUS][0000:01:00.0] ROP6: 0xbadf1100 0xbadf1100 (0xbadf1100)
[  16.489743] nouveau E [  PIBUS][0000:01:00.0] ROP7: 0xbadf1100 0xbadf1100 (0xbadf1100)
[  16.490378] nouveau E [  PIBUS][0000:01:00.0] ROP9: 0xbadf1100 0xbadf1100 (0xbadf1100)
[  16.491015] nouveau E [  PIBUS][0000:01:00.0] ROP11: 0xbadf1100 0xbadf1100 (0xbadf1100)
[  16.491617] nouveau E [  PIBUS][0000:01:00.0] ROP12: 0xbadf1100 0xbadf1100 (0xbadf1100)
[  16.492289] nouveau E [  PIBUS][0000:01:00.0] ROP13: 0xbadf1100 0xbadf1100 (0xbadf1100) 
[  16.492903] nouveau E [  PIBUS][0000:01:00.0] ROP15: 0xbadf1100 0xbadf1100 (0xbadf1100)
[  16.493489] nauveau E [   PBUS][0000:01:00.0] MMIO read of 0x00000000 FAULT at 0x120058 [ IBUS TIMEOUT ]
[  16.737517] nouveau E [  PIBUS][0000:01:00.0] HUB0: 0x17e348 0x00000000 (0x1c400200)
[  16.738244] nouveau E [  PIBUS][0000:01:00.0] ROP0: 0x10f904 0xffffffff (0x19408201)
[  17.186060] nouveau E[    PBUS][0000:01:00.0] MMIO read of 0x00000000 FAULT at 0x132020 [ IBUS ]
[  OK  ] Started Detect the avaiable GPYs and deal with any system changes
         Starting GNOME Display Manager...
gdm.service
[  OK  ] Started GNOME Display manager.
[  OK  ] Started MySQL Community Server.

Also, you could see rows of these:

[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]
[  20.969399] nouveau E[  PFIFO][0000:01:00.0] SCHED_ERROR [ UNK06 ]

But after, those computer just restarts.
So that is main symptoms of wrongly shut down computer.
 

Other related information

If this error is related to particular hardware, there are some of mine and commands to find it: 
sudo lshw -c video
 *-display             
      description: 3D controller
      product: GM107M [GeForce GTX 860M]
...
 *-display
      description: VGA compatible controller
      product: 4th Gen Core Processor Integrated Graphics Controller

 modinfo i915
filename:       /lib/modules/3.19.0-15-generic/kernel/drivers/gpu/drm/i915/i915.ko
license:        GPL and additional rights
description:    Intel Graphics
author:         Intel Corporation
author:         Tungsten Graphics, Inc.
srcversion:     B934DBB1B6D215F088A1EE3
...

Conclusion

Ubuntu distributions can have issues (especially fresh releases), but they also have huge community, where all variants of bugs workaround and solutions are documented.
I home you will google these error codes and found the cause and solution of the problem much faster.

Update: Alternative

After a while, problem appeared again. So latest fix working good, so far...
Update to proprietary nvidia and install bumblebee:


sudo apt-get install nvidia-346-updates nvidia-346-updates-dev nvidia-346-updates-uvm bumblebee-nvidia

Restart may be required.