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.
- If you have a SSH server running on the affected machine, or a serial console, you can try connecting to the box and kill X by hand. While doing this you can also run
topand confirm that X is stuffing its face with CPU. - If you have an AGP video card try reducing the AGP speed from the BIOS. Go down to AGP 4x, 2x or even 1x. There’s almost no detectable difference in performance between 8x and 4x so you may not even percieve this as a penalty of any kind.
- Try using the native AGP driver from X instead of the NVidia driver. This is done by setting the NvAGP option in
xorg.confto the value 2. - Try disabling the AGP driver completely by setting NvAGP to 0 (zero).
- Stop using the NVidia driver and go with the native X driver (nv). The main advantage of the binary driver is hardware acceleration, which many people don’t actually need for usual desktop work. If you don’t play games and most of your work consists of office and Internet applications then you’d probably be perfectly happy with the X driver.
- Try various versions of the NVidia drivers. People regularly report certain versions to “fix the problem” for them, but take such reports with a grain of salt.
- Try
noapicorpci=noacpi(no, there’s no spelling error!) as boot prompt parameters.
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.
