"GPU has fallen off the bus" after some time of playing games (optimus + primusrun)

I use Gentoo Linux (kernel 3.15.1, problem exists also with earlier kernels) on Lenovo Ideapad Z570 with Optimus (NVidia GeForce 630M). Driver version is 331.79 (problem exists also with 340.17). I use primusrun to run games (e.g. Portal 2 with Steam) on NVidia card. When I launch the game and play some minutes, the game hangs (it is even impossible to kill is with kill -9, zombie remains with child thread consuming 100% cpu) and the following message in kernel log appears:

NVRM: GPU at 0000:01:00.0 has fallen off the bus.

After that it is possible to restore computer functionality only after cold reboot. If I do hot reboot, computer hangs with black screen when it starts booting UEFI.

The first thought was about broken hardware, but I did some diagnostics and found out that with driver 304.121 all things work, there is no hangs, I was able to play game much longer than it takes to hang with driver 331.79. Also I tried playing under Windows 8.1, the game was also hanging but after some seconds the game continued.

Here is nvidia-bug-report.sh output: http://pastebin.com/Q4xbvxg5

Here is Xorg.8.log (bumblebee X-server): http://pastebin.com/qa9JeSKV

Please help me with this problem, it is really bad idea to stick with old drivers.

I’ve seen this error too, even with older drivers and kernels, used to get it all the time when I would fire up virtualbox and play a game in a windows guest (havent tested it in a long time, bug might still be there), it would crash the linux driver, machine would just have a black screen.

I did some more tests and found out the following.

These configurations work:

These configurations does not work:

  • Driver 331.79 on Gentoo with kernel 3.10.44 and xorg 1.14.5
  • Driver 331.79 on Gentoo with kernel 3.15.1 and xorg 1.15.0
  • Driver 340.17 on Gentoo with kernel 3.15.1 and xorg 1.15.0

I hope this information will help somehow.