Putting the nvidia driver into persistent mode (nvidia-smi -pm 1) seems fix the problem by preventing the kernel driver from unloading and reloading during X restart!
The bug seems to be related to how nvidia.ko initiate and re-initiate display devices. By preventing it from unloading/reloading, the reinit process is skipped.
I just installed an Asus GT520 and I got the exact same problem, and this was the only place Google led me when I tried to describe it.
Some more data points for other people coming across this, before I try applying your fix:
I've often used nVidia GPUs before, and on ubuntu. Back as far as GeForce 6100, via GeForce 9400, GT218, GT320M (on a mac mini) all using ubuntu, all using the binary drivers, various versions of Ubuntu up to Quantal - which I overwrote with a fresh Precise install earlier today hoping it might clear this. I never had this problem before.
I'm having it now on an Ubuntu Precise 64-bit install with the nvidia 302.17 driver from ubuntu-x-swat updates ppa. I didn't keep the original nvidia driver version long enough on the new install to see if it happens on that, but I bet it does, seeing as it did for you, and 302.17 didn't have these issues on other nvidia cards.
if you install mcelog, this is logged in /var/log/mcelog when it happens:
mcelog: failed to prefill DIMM database from DMI data
mcelog: mcelog read: No such device
Hardware event. This is not a software error.
MCE 0
CPU 0 BANK 5
MISC 7fff ADDR 3fffa0059e95
TIME 1342806593 Fri Jul 20 18:49:53 2012
MCG status:
MCi status:
Uncorrected error
Error enabled
MCi_MISC register valid
MCi_ADDR register valid
Processor context corrupt
MCA: Internal Timer error
STATUS be00000000800400 MCGSTATUS 0
MCGCAP 1c09 APICID 0 SOCKETID 0
CPUID Vendor Intel Family 6 Model 26
I suspect the issue is with this model of card, which probably has a firmware bug. Like you, I find that otherwise it works perfectly for XBMC, but having it crash the system on logout (Precise seems to have a watchdog that reboots it after a minute or two, which is something) is a bit of a downer.
I shall now try to apply your 'fix'. Where do you put that so it happens on boot? Or do you only need to enter it once and the setting's stored on the card?
Last edited by StrangeNoises; 07-20-2012 at 01:21 PM.
Reason: fix emoticon
when it can handle vdpau fully i might even do that. (I'm also using this for XBMC.) Until then, it's not a very useful suggestion; especially as on the default install, when nouveau is used, it chose to display the X desktop on my TV zoomed in (probably an overscan mode being off) and no obvious way to stop it doing that.
All things being equal I too prefer the open-source driver approach. But things are not equal. (And yes I know it's nVidia's fault for not being more open, but it still works out as the best solution for xbmc.)