X Windows screen freeze and 100% CPU with NVidia drivers

1. Problem

This is a recurring issue for the binary NVidia drivers. If you use an NVidia video card with these drivers there’s a good chance you may have run into it at some point, at least once, or thay you might someday.

The problem manifest itself as a sudden screen freeze. The keyboard is frozen as well and nothing on the screen updates. Sometimes the mouse pointer may still be moved around but nothing can be done with it. If you have hardware devices playing, such as a TV Tuner or radio card on a separate audio line, they will keep playing in the speakers.

Usually the only solution is a hard reboot of the affected machine.

2. Research

From reports on the NVidia
Forum
it seems that the NVidia drivers cause X to suddenly eat up 100% CPU in a very aggressive manner. This explains why inputs that don’t depend on software (such as line-in sound or video-in from the TV tuner) will keep working. An audio player like XMMS would not. Keyboard would not. Mouse would, especially if the pointer is hardware drawn, but it’s no use anyway.

3. Solution

People on the NVidia forum have mentioned many things that they claim to have fixed the problem. I’m going to list some of them, but look for more yourself. The issue seems to manifest itself more seldom as the NVidia drivers evolve, but it’s never been completely out of the question.

2004-02-01: Nowadays I get a freeze very seldom, and not a hard lock anymore, more like a display freeze. I can still use my keyboard and the applications work, I just don’t see it. I can leave them to finish whatever they’re doing (such as writing a CD for instance). Then I can use the keys to exit (sometimes I have to use the magic Alt-SysRq keys). I still have to reboot, since the display is permanently corrupted until I do that.

2005-06-01: I’ve enjoyed a long period of trouble-free functionality using driver 5536 and kernel 2.6.6. The freezes seem to have reappeared with driver 7667, so I’m sticking with the old and tried, even though 76xx seems to increase the GL performance.

2006-11-01: The freezes are back with driver 8774 and kernel 2.6.18. I suspect they may have something to do with the fact I’m keeping my RAM downclocked to make two different sticks work together, which in turn may disturb AGP somehow. I’ve turned to the X driver for now.

2006-11-13: Installed driver 9629. The freezes, when they occur, only last for about 5-10 seconds now. I’ll try to see whether I can catch who’s consuming CPU during those times.