Originally Posted by bactrimel
OK, obviously such symptoms could be the result of different underlying problems, but...
in my case, what *completely* cured the problem of random freezes and Xid messages (after weeks of painful experimentation) was removing all kernel modules that have to do with thermal sensors. I have also disabled all the relevant plugins from gkrellm, in order to prevent such modules from being loaded automatically.
The system is rock solid now, running for 2+ days straight under KDE+composite without a single glitch.
I suspect that some such program or kernel module is periodically polling/generating interrupts under nvidia driver's nose, messing up the interface. It would be nice if someone could debug this to the end, though.
Hope this helps,
In my system i have loaded two modules for sensors and then there's the nvidia built-in thermal and frequency monitor.
It looks like disabling the Thermal Monitor
in nvidia-settings configuration is enough! (GeForce GT240 with 304.43 and linux 3.2.0-31-generic)
I need to do further testing though