Saturday, August 18, 2012

Desktop Reinstallation Struggle

For many years, I struggled to stay with KDE 3.5 in my primary desktop computer, as I found it much more stable than the KDE 4, which had serious issues every time I tried it. Kubuntu 8 was the last system version to come with KDE 3.5, so I was stuck with it. After a hard drive failure some two years ago, I finally installed a newer Kubuntu, and also went for 64-bit to get a bit more memory. My life has been struggle since then.

Issues, issues

Often after some upgrades, the machine has worked well for a day or two, and then become sluggish as hell, with random jams that can last from 5 to 30 seconds. Some applications cause especially much problems. One is Thunderbird, for some odd reason. Another is Digikam, for which the reason is that it doesn't really scale up very well and hogs memory (2.5 GB currently).

Also, successive system upgrades from Kubuntu 9 to 12 had also broken something. One of the most problematic background processes was "semantic Nepomuk Desktop". Do not even ask me what that is, but it is currently an integrated part of KDE. It can be disabled, but doing so causes a lot of annoying alerts that it should not be disabled, even though those alerts are only relevant if you use KMail, which I don't.

I've been struggling to identify the underlying problem. I've suspected an interrupt in DMAs, interrupts, or some other resources. However, the most probable cause is the Nvidia GeForce 8800 GT, which was the source of most problems with this installation as well.

I wholeheartedly agree with Linus's opinion about Nvidia. While they do offer a proprietary driver for Linux, it is riddled with problems and they refuse to give out specs for making a possibly better driver.

Linus delicately expressing his opinion about Nvidia

For the most time in these two years of struggle, the system has worked reasonably well for a few days, before the memory has fragmented, etc. So, after the two years, I finally bought another 4 GB of memory this week, hoping that it would make the problems easier. It didn't at all. So, I finally decided to reinstall everything, even as annoying that is.

Installing the Pangolin

Running the installation for Kubuntu 12.04 LTS (nicknamed Precise Pangolin) was really easy and simple. I have it on two other machines as well, my work computer and my netbook. The only slightly worrying step was not formatting the drive. I took full backups to an external drive (took almost a day), then started the Live Kubuntu, mounted the drive from console, and moved everything under root to an "old" directory. Then, did not allow the installation to partition and format the drive, but assigned the root mount point for the partition. Well, I've done that probably dozens of times, but you can never be too careful with that.

Nvidia Problems

However, after the installation, the computer didn't work at all. Simply clicking anything with the mouse didn't work. The reason was apparently that compositing was not enabled. The quick (and unobvious) fix to be able to use the system at all was to disable the 3D effects mode with Alt+Shift+F12. Also, all fonts were so tiny that I couldn't read them. The reason was probably with my monitor (a 42" TV actually), which detects the signal so slow that the system can't detect it, and then calculates the DPI resolution with some insane defaults.

So, to edit xorg.conf. Actually, it wasn't really initialized at all, but running nvidia-xconfig in console reinitialized it with a bit more sane values. Then, make the following monitor settings to get the DPI resolution sane:

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Philips FTV"
    HorizSync       15.0 - 70.0
    VertRefresh     48.0 - 62.0
    Option         "DPMS"
    Option         "UseEdidDpi" "False"
    Option         "DPI" "120 x 120"

Those aren't really the correct DPI values for the TV, which would be about 47 DPI, but something that makes it readable from 1,5 meters.

Then, the compositing:

Section "Extensions"
    Option         "Composite" "Enable"

The biggest issue was the nvidia 290.40 display driver, which was essentially broken, so that the user interface became unbearably slow. Simply switching between windows would take some 15 seconds. The driver had broken at about version 290.33 or so, and while many versions had made some fixes for some cards, they didn't work for me. After struggling for hours, the finally working solution was to install the latest driver from an alternative repository:

sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current

This installed the 304.37 driver version from the 304.37-0ubuntu1~precise~xup1 package, which actually worked.

So, for the first time in two years, everything seems to work pretty well. For now.

The Rest of It

The rest of the installation was very boring routine. KDE has a zillion settings with which I'm not satisfied and making it bearable always takes half a day, which is the reason I don't want to make installs very often. I did my netbook install just a month earlier, so most of the difficult-to-find settings were in almost fresh memory.

The required KDE configurations change a bit from time to time, as some defaults become better and some worse. Just to mention some:

  • Disable unnecessary desktop effects and configure others
  • Change desktop theme to a prettier one
  • Configure Task (window) Switcher to a vertical layout
  • Configure virtual desktops (I always use 8)
  • Configure desktop animations, etc.
  • Configure switching desktops with Win+Tab and Win+Ctrl+Tab (this actually has couple of bugs in KDE 4 which makes the configuration difficult)
  • Configure window behavior rules (force certain windows to always start in certain desktop)
  • Disable annoying confirmations for the KDEWallet
  • Configure other global shortcuts (minimize/maximize windows, etc)
  • Configure session control - restore manually saved session
  • Disable logout confirmation
  • Disable screensaver
  • Disable screen power saving from Power Management
  • Disable network settings in KDE and set them in /etc/network/interfaces
  • Configure printer
  • Configure screen resolution if not correct
  • Delete unnecessary default folders from home folder
  • Change the location of the Desktop folder
  • Set up Firefox as default browser in KDE and with update-alternatives
  • Set up Konsole configurations for root, Irc, and normal use
  • Set up panel
    • Change the terrible new Windows-style application launcher to traditional launcher (great that it's still there as an alternative)
    • Set up application launchers
    • Set up Konsole configuration launchers
    • Set up clock
    • Set up other panel layout
    • Enable auto-hiding
  • Set up desktop background photo
  • ...and other small tuning...

So, there it is (with my System desktop).


2012-08-20: Some occasional jams still occur, typically freezing the keyboard for half a minute in one application, such as Firefox. But it's quite different, system loads stay quite low, but one core jumps to 100% when a jam occurs.

No comments: