Ubuntu – How to update to Ubuntu kernel 3.13.0 on 12.04 LTS without breaking the Nvidia graphics driver

12.04drivershardware-enablement-stacknvidianvidia-optimus

I'm running Ubuntu 12.04 "LTS" on a Lenovo W530 (Nvidia Optimus architecture) and updated the kernel to 3.13.0-32-generic as the version of the kernel I was running was going out of support, 3.5.0-52-generic. I was getting the following warning;

"Your current Hardware Enablement Stack (HWE) is going out of support
on 08/07/14. After this date security updates for critical parts
(kernel and graphics stack) of you system will no longer be available."

I went through some pain to get a second monitor working with this machine in the past and after the update to the new kernel all that work went away. The screen resolution went to 800×600 and the secondary monitor no longer worked. My machine is a work laptop and I thought LTS was a safe bet but obviously not…

I did some investigation on the problem and tried the following;

Purged the nvidia drivers, reinstalled nvidia current and restart;

sudo apt-get purge 'nvidia*'
sudo apt-get install nvidia-current
sudo reboot

Tried to install the latest version of the nvidia drivers in the repo;

sudo apt-get purge 'nvidia*'
sudo apt-get install nvidia-331
sudo reboot

Configured nvidia xconfig, load the drivers and restart the UI;

sudo nvidia-xconfig
sudo modprobe nvidia
sudo service lightdm restart

This lead me to an error in dmesg thrown by trying to load the Nvidia driver with modprobe. Basically the driver doesn't load.

nvidia: module licence 'NVIDIA' taints kernel

nvidia: Unknown symbol acpi_os_wait_events_complete (err 0)

Which lead me to the nvidia forum which outlines a way to patch the system
https://devtalk.nvidia.com/default/topic/644906/linux/331-20-on-3-13-rc1-kernel/

There's a mix bag of information around a fix with nothing really concrete there. There's a bug in the new kernel that breaks the Nvidia driver (from my understanding) and there's some steps to patch it yourself. Again this machine is for work and I don't want to be messing around so I decided to revert back to the previous working kernel;

sudo apt-get remove linux-image-3.13.0-32-generic
sudo reboot
uname -r

3.5.0-52-generic

sudo apt-get purge 'nvidia*'
sudo apt-get install nvidia-current
sudo nvidia-xconfig
sudo modprobe nvidia
sudo service lightdm restart

Everything is back the way I had it but this doesn't solve the fact that after August I'll no longer recieve security updates. I thought this was a LTS…

Is there any information around an official fix for this before August. Or if anyone knows how I can update to 3.13.0 without breaking Nvidia graphics driver?

Best Answer

This is a bug and I expect them to fix this so it will work out of the box soon, but if you want to use the new kernel you can do the update and do the following afterwards after booting to get it working again.

Open a terminal (hold in CTRL and ALT while pressing T) Add xorg-edgers PPA and update

sudo add-apt-repository ppa:xorg-edgers/ppa

You'll have to supply your password when prompted. You'll get all sorts of info about this repo but to continue just press ENTER

Now in the same terminal:

sudo add-get update
sudo apt-get install nvidia-current

If you have an old machine you just replace nvidia-current with nvidia-304. You need to press Y + ENTER for it to be installed.

When it's finifshed you restart your system. To confirm that you are indeed using Nvidia drivers you may open System settings in the menu on top right and choose Additional Drivers from the Hardware section. It takes some time for it to start up but when it's there it will tell you if you are using Nvidia driver. It might be that you could in fact activate your driver from this view after sudo add-get update but I didn't do that so I'm not 100% sure. Before the HWE update I had several choices here but now I only have the one I have installed.

Hope this fixes things until April 2017 :-p