Thursday, August 22, 2013

Ubuntu 12.04 64bit Kernel freeze on dual VGA

I had Ubuntu 12.04 (3.2.0-45) 64bit installed on a Dell laptop. The kernel used to freeze very frequently on a daily basis. Followed various posts and kept apt-get up to date but did not fix the issue. I could not narrow it down by the actual cause of the issue by analyzing the system logs. So I was reluctant to re-install the OS and verify as there is no guarantee that the problem will not re-appear.
However by absorbing the various freeze scenarios it boiled down to whenever I was using more to do with graphics drivers from the application. So I did the following steps and it did not freeze after that, it's been more than a week and it did not freeze even once, though its not an actual fix and but this work around greatly works for me.

1. lspci | grep VGA - confirmed that I had two video drivers (Intel and Nvidia)
2. But Nvidia was not active and I could not successfully install the Nvidia driver while Intel one is active.
3. So by disabling the "Optimus" in BIOS settings, I booted with recovery mode, and installed the Nvidia recommended drivers through Additional Drivers setting. When it's using with Intel driver the Nvidia drivers may not be listed through Additional Drivers setting and also apt-get install current-nvidia did not work for me. So I had to run it with low graphics mode so that I could successfully install the Nvidia driver.
4. Once the Nvidia driver is successfully installed and I re-booted the laptop without Intel VGA and Ubuntu sees only the Nvidia driver (so lspci | grep VGA shows only one driver) and that's all I had to do to overcome my kernel freeze issue!!!
5. This has one side effect of not being able to connect with dual external monitors but only one additional monitor works for me than living with freezing problem!