Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm having trouble stopping X over SSH, on an Ubuntu 11.10 system. I'm nowhere near the computer so the usual Control-Alt-F1 is out, although I'm not sure if this actually stops X in 11.10. I'm trying to install the 285.05.33 Nvidia developer driver.

ERROR: An NVIDIA kernel module 'nvidia' appears to already be loaded in your kernel.  This may be because it is in use (for example, by the X server), but may also happen if your  
     kernel was configured without support for module unloading.  Please be sure you have exited X before attempting to upgrade your driver.  If you have exited X, know that     
     your kernel supports module unloading, and still receive this message, then an error may have occured that has corrupted the NVIDIA kernel module's usage count; the         
     simplest remedy is to reboot your computer. 

Installation log file - http://db.tt/YNyYF0wR

In /etc/default/grub,

GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX=""

and in /etc/modprobe.d/blacklist.conf,

blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist nvidia

Lastly,

sudo stop lightdm

does not recognize a job to stop, when the 'text' flag is in the grub configuration file. Also I am not porting X over SSH.

Thanks for any ideas

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

There is currently a process using the nvidia module. If X is running, this is surely it. You can try to stop things somewhat nicely (all graphical applications will die) by e.g.

sudo service lightdm stop

or less nicely by

pkill Xorg

Now you can do

sudo modprobe -r nvidia
sudo modprobe nvidia

to reload the Nvidia module. Note the message that is written to the terminal: it should give you the new version of the Nvidia driver.

Now

sudo service lightdm start

should get the graphical subsystem going again.


If there are still processes using the nvidia module, you can try e.g.

lsof /dev/nvidia*

to see if there is a suspicious process there. In that case, kill it. If the problem persists, try manually looking through the output of ps a to find possible processes there. If it still won't work, you can check

lsmod | grep nvidia

to see if there is some module dependency that can give you any information, but usually this won't help you much.

If nothing of the above works, you can always reboot (or just wait until a natural reboot and run the old nvidia module version until then).

I regularly update the Nvidia module in Debian Sid, and it almost always suffices to just kill X, reload module and restart. The reason I give a more elaborate process searching scheme is that I had trouble with an Opera bug in this regard, where the process operapluginwrapper kept hogging the module even after Opera itself was dead.

share|improve this answer
    
Part of the problem was a duplicate driver maintained by apt-get; after removing it with sudo apt-get remove nvidia-current, I followed your instructions to unload the other driver. I don't know why these two drivers didn't cause problems, earlier. Thanks! –  Peter Becich Mar 31 '12 at 8:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.