[ltp] [W510] how to undo nouveau -> nvidia driver change in debian?

Tom Roche linux-thinkpad@linux-thinkpad.org
Mon, 03 Dec 2012 17:01:06 -0800

I just installed the nvidia driver on a Thinkpad W510 via debian
packages--now the box will boot through GRUB, but now only shows a
blinking white cursor in the upper left corner of the screen after
showing the usual boot messages. How to restore my previous
configuration? Why I ask:

I'm trying to fix a W510 with (what seems to be a) power-management
problem. I'll post about that separately--suffice to say that I could
not turn down the screen brightness from maximum, and I was only getting
~2 hours battery life. Note the box is up-to-date with LMDE (a testing/
wheezy-based distro).

I googled about W510 power management. The best-looking link I could
find said that

> Nvidia Quadro FX 880M graphic card

> You have two options for the nvidia card.

The other was nouveau, which I know has the problem previously

> One is the NVidia proprietary driver that can be installed via their
> installer or using the Debian way (recommended).

I did it "the Debian way," i.e., using APT.

> For the latter, install nvidia-glx, nvidia-kernel-source,
> nvidia-settings and module-assistant.

That worked with `aptitude`. The only error was, the package install
complained about not finding my kernel's header sources (LMDE is
currently running 3.2.0-3), so I installed the appropriate package=
linux-headers-*, and re-ran

sudo aptitude install nvidia-glx nvidia-kernel-source nvidia-settings

(as module-assistant was already installed) with no errors.

> Then run [module-assistant], select the nvidia module, build and
> install it.

That worked with no errors. There was a message saying that nvidia was
incompatible with nouveau, and that I should reboot after install.

> Note that vbetool is incompatible with Nvidia GPU's; purge it from
> your system.

sudo aptitude remove vbetool

ran without errors.

> In order to control the [backlight], you need to add the following
> line in bold

> Section "Device"
>     Identifier      "FX 880M"
>     VendorName      "NVIDIA Corporation"
>     Driver          "nvidia"
*     Option "RegistryDwords" "EnableBrightnessControl=1"
> EndSection

> /etc/X11/xorg.conf

That was a problem: /etc/X11/xorg.conf did not exist on that box. (My
other up-to-date LMDE box also lacks that file.) I skipped that edit,
hoping the nvidia install would supply the file.

> Also the kernel module thinkpad_acpi reports [the] wrong number of
> brightness levels which confuses power managers. To solve it, create a
> file /etc/modprobe.d/w510.conf with the line

>     options thinkpad_acpi brightness_enable=0

I created that file, with that line, and ...

> With xfce4-power-manager installed, you can issue

> /usr/sbin/xfpm-power-backlight-helper --get-max-brightness

> to query the number of levels detected. The current brightness level
> can be obtained/set by reading/writing to

> /sys/class/backlight/acpi_video0/brightness

... I installed debian package=xfce4-power-manager, also without errors.

> Unfortunately, the later proprietary nvidia drivers (304.*) have
> problems, the most annoying one being the fact that suspend to RAM
> fails about every 10 times. To work around this issue, create a file,
> say, /etc/pm/config.d/suspend-workaround and add to it


I created that file, with that line.

I then did a cold boot: `sudo shutdown -Ph now` to power down, then hit
the power button to restart. It went to GRUB at a very low screen
brightness, which I was able to increase with Fn-Home. (That seemed like
a good sign :-) I then got the usual white-text-on-black-screen boot
messages, no errors. Then it failed to go graphical: I got only a
blinking white cursor in the upper left corner of the screen.

Worse: when I tried to go to a virtual terminal (via C-A-F1), I got the
usual login prompt only for a few seconds; then it switched back to the 
blinking cursor @ upper left! I got the same result for C-A-F2 through

Worse still: I got the same results booting to recovery mode on the
current kernel, as well as booting to previous kernels.

How to remove the nvidia driver? For that matter, how to get to a point
where I *can* remove the nvidia driver (given that I can't currently
even get to a terminal)? Ordinarily I would just reinstall, but this
week I'm traveling at a conference with my girlfriend, and I wanted her
to have a laptop with which to do travel/event planning. So now I'm
using the box that she was going to be using, because it's old/bad
battery has even worse life than the W510, and the rooms at the
conference which I'm attending have no accessible power outlets :-(

TIA, Tom Roche <Tom_Roche@pobox.com>