Tuesday, May 11, 2010

Ubuntu 10.04: Fixing mtrr errors

Ah, so many things, so little time to write about them. I'm going to handle my Ubuntu 10.04 programs piecemeal, and in the order that I have time to write about them. So this one isn't the biggest problem, but I've got all the data available here, and it's a quick fix, so here goes:

I was looking at /var/log/messages to try to figure out why my wife's account logged itself off last night (never did find out), when I saw the message

MTRR allocation failed. Graphics performance may suffer.

Googled it, found this fix, which is to add the kernel boot options:

enable_mtrr_cleanup mtrr_spare_reg_nr=1

to the grub command line.

Uh, OK, how do I do that?

In the Good Old Days there was a file, /boot/grub/menu.lst, which had all the information you needed to get your computer started, including booting up and loading the kernel with the desired options. The problem was that this got rewritten every time you did a kernel update. There were some sections of the file that were supposed to be saved, but that required the update program to remember to save them.

Just to make sure the programmer didn't forget those kind of things, all of the user-specified options were moved to the file /etc/default/grub, and menu.lst has become grub.cfg, which is generated from /etc/default/grub by running update-grub.

Got that? Uh, so you just ... Oh, never mind.

Here's the fix for the mtrr problem:

  1. Run
    $ sudo vi /etc/default/grub
    to edit the grub configuration file.
  2. Look for the line
    GRUB_CMDLINE_LINUX=""
    and change it to
    GRUB_CMDLINE_LINUX="enable_mtrr_cleanup mtrr_spare_reg_nr=1"
  3. Save and exit
  4. Run
    $ sudo update-grub
  5. Check /boot/grub/grub.cfg to be sure the changes are in there
  6. Reboot
  7. Check /var/log/messages to be sure that the mtrr message has disappeared.

And, of course, I noticed a fantastic improvement in graphic performance — which means none, actually. But hey! I got rid of the error message.

Thursday, August 13, 2009

Stupid X Tricks

Buried in this Penguin Pete Post and Comments is a trick that I'd never seen before. It could be extremely helpful, albeit tedious to use, if your mouse suddenly scurries off or is otherwise inoperable, and it works in any setup running X:

  • Do a 3-figured salute using Ctrl-Alt-Numlock, (in Gnome and KDE, it's Ctrl-Shift-Numlock)
  • Press one of the arrow keys on the keypad
  • The mouse cursor will move on the screen. A bit of experimenting shows that the "5" key is button 1, and 1-3-7-9 move the cursor diagonally. (OK, I looked here. But the diagram is almost unreadable, and I probably would have hit on it eventually.)
  • Unplug mouse, free up USB port. (Well, maybe not.)
  • Apparently you can also do this with that Microsoft product, though not in the same way.
  • Apple? Don't know.