Sunday, May 18, 2014

nomodeset to correct nouveau driver black screen after login

I have an 11 year old computer in my workshop running debian squeeze, and figured I'd upgrade to wheezy.  After replacing 'squeeze' with 'wheezy' in the /etc/apt/sources.list I rant apt-get update, apt-get upgrade, apt-get dist-upgrade.  The computer functioned fine after the upgrade.  Until I rebooted.  I could log in but not start the xserver.  My TTY was periodically flooded with some gibberish with the final line reading
[drm] nouveau 0000:01:04.0: DDC responded, but no EDID for DVI-I-1
 This machine has a GeForceFX 5500 that has only VGA output.  I was confused and google did not resolve the issue when I focused on that error line.  Unfortunately I did not save the error messages from the xserver failing to start but it was along the lines of  'number of displays does not match the number of screens'.

Out of ideas I grabbed the latest version of Debian Jessie and did a fresh install on all partitions except /home - to preserve my data.  The install seemed to go smoothly but this time after logging in I got just a blank screen not even a TTY.  A little more searching on this issue revealed the solution was to prevent the kernel from loading video drivers but just use the BIOS modes until after X is started.  The nouveau driver seems particularly problematic with modesetting.  To temporarily set the boot option (so I could log in without the blackout screen) highlight the kernel on the GRUB2 screen but press 'e' instead of 'Enter'.  You are then presented with the GRUB2 boot commands.  Find the line reading  
linux /boot/... quiet splash
Where ... will depend on your particular kernel and such.  Append the 'nomodeset' command to the end of this line.
linux /boot/... quiet splash nomodeset
Then CTRL-x to boot with the new GRUB2 commands.  You can then login, su to root, and change the /etc/default/grub file to add the nomodeset command permanently to your GRUB2 commands.  Find the line with the 'quiet' command 
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
and add 'nomodeset' within the same parenthesis.
GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"
The machine should now boot as normal.

Some of the sites I learned about this issue and solution.
nomodeset to fix black screen tutorial (Linux Mint forums)
nomodeset (and other boot options) explained (Ubuntu forums)
GRUB2 nomodeset (Open Suse forums)

I still don't know whether the 'no EDID' problem in wheezy was related or could have been solved with the nomodeset solution.