18. October 2013 6 min read

Upgrade from Ubuntu 13.04 to 13.10 causes blank screen after login

Setup is NVIDIA gfx card with NVIDIA drivers. As I have upgraded from Ubuntu 13.04 to 13.10, that is from 3.8 kernel to 3.11 kernel I have found nasty glitch which took me almost 5 hours to figure out and fix. As normally as soon as stable upgrade is out, I hit that nice UPGRADE button and let Ubuntu upgrade. Today it was no different, but after rebooting into new 3.11 kernel of Ubuntu 13.10 I was put into login screen. Nice, I though, it works, but after trying to Log in to my gnome desktop I was faced with black blank screen with cursor blinking. After some time I ended with mouse and blank background. This all lead me to graphics problems, but I found out it is a bug in kernel. So you move through your screens with ctrl+alt+F1,ctrl+alt+F2, etc. Anyway the fix:
Problem was that apt-get did not find any nouveau drivers installed at all, but first thing you will need to do is blacklist nouveau driver and purge everything you can see with apt-get on nvidia. This is something it has not happened when there were just kernel upgardes as dkms was working just normally. You do this by

sudo apt-get purge nouveau nvidia

After that you need to blacklist nouveau with modprobe. You check if it ran by

sudo lsmod | grep nouveau

and you remove it by editing

sudo vim /etc/modprobe.d/blacklist.conf 

where you add

# nouveau is anyoing my Nvidia drivers so it should be blacklisted, although I have never 
# installed it
blacklist nouveau
# we want to ensure it does not load under anything
install nouveau /bin/false

This will however not remove "Fatal error: nvidia module not found", but it will give the nvidia module a fighting chance of starting up.
Next step is to download NVIDIA driver to your hard drive (if you are reading this before upgrade, make sure you download it sooner as otherwise you'll have to bother yourself with wget or even lynx). You can find it onhttp://www.nvidia.com/object/linux-display-amd64-325.08-driver.html. Once you have it in your download directory you will perform following commands. Remember this is something you only have to do if you're in 3.10 or 3.11 kernel, as the installer will install just OK on lower 3. kernels.

sudo chmod a+x ./NVIDIA-Linux-x86_64-325.15.run
sudo ./NVIDIA-Linux-x86_64-325.15.run

Now I will assume you will run this on tty1 screen (ctrl+alt+F1), so after you run it, go to tty2 (ctrl+alt+F2) and login. Then run

sudo vim /tmp/selfgzSOMENUM/NVIDIA-Linux-x86_6/325.15/kernel/nv-linux.h
# Now search for NV_NUM_PHYSPAGES and make it like
NV_NUM_PHYSPAGES   get_num_physpages()
# (you will need to add get on front and () behind. I do not know why NVIDIA did not do a simple
# define to check if kernel version is above 3.10, then use this function, otherwise keep the 
# old variable.

Now go back to tty1 and install the NVIDIA driver to end. After you finish installing you might hit on DKMS bug where it cannot install a modprobe. Dont worry, just run

sudo dkms nvidia remove --all # attention this removes nvidia module from ALL kernels that you have 
# registered, but by my experience they do not work on other kernel versions anymore because of 
# above fix we have made anyway.
# now you need to add dkms module manually
sudo dkms build -m nvidia -v 325.15 -k 3.11(+tab to autocomplete)
# you can use here command to just throw in nvidia module in blank space using
sudo dkms build -m nvidia -v 325.15 --all
# then also add nvidia to modprobe using nvidia command
sudo nvidia-modprobe

and you will solve that problem. To check if it was really loaded

lsmod | grep nvidia

now you can hit reboot and everything should work. If it does not, you might want to run sudo nvidia-xconfig, to make a nice config

Beside the blank screen, which I have also received, if I just installed NVIDIA drivers, you will also get various error messages, if you will not follow my steps like for example installer will fail claiming "DKMS error, nvidia module was not installed in kernel 3.11.".

After each kernel update I still run commands

sudo dkms build -m nvidia -v 325.15 --all
sudo nvidia-modprobe

just to make sure that dkms registers my driver to newly installed kernel and that after restart everything keeps working.

Newest from this category: