Every 3rd time I run certain games such as Aion it will crash a short moment after primusrun switches on the GTX660M, followed by fans (I assume GPU fans) running at max speed and the Nvidia card stuck. The indicator LED will remain on, cat /proc/acpi/bbswitch will always return "OFF" despite it apparently being stuck on ON, and echoing OFF or ON into it will not do anything.
The only way is to reboot the notebook again and again everytime this crash happens.
(Unloading bbswitch or nvidia modules doesn't do anything either to help it.)
What if you run primusrun bash and then the command to start the game? I think that bbswitch is called too early to disable the video card. (there seems to be a a new "nvidia unified memory" module, could this be related?)
Ok, I tried that, waiting 3 seconds:
primusrun bash -c 'sleep 3; wine '
but it still caused the bug (tried two times, first was lucky, second was unlucky and had to reboot as usual).
I chose 3 seconds arbitrarily, no idea what kind of time spans "too early" refers to. :)
I have no clue about "nvidia unified memory modules" stuff or any other driver knowledge really.
See dmesg. If you get NVRM messages like rm_init_adapter failed or GPU has fallen off the bus, you may be seeing nvidia -- kernel 3.10+ incompatibility. Try the rcutree.rcu_idle_gp_delay=1 workaround.
GPU has fallen off the bus
@Lekensteyn: primusrun bash would not make any difference as all it does is to export some shell variables. You probably meant optirun -b primus bash.
optirun -b primus bash
Oh yeah I do get gpu has fallen off the bus!
I will try the rcutree thing, starting with next reboot.. thanks!
Are there any drawbacks to using that option?
@amonakov Oh yes, that is what I meant. It should not be an issue, but I am slightly lagging behind with the driver.
Unfortunately the problem still occurs. :(
(I verified that cat /proc/cmdline indeed contains "rcutree.rcu_idle_gp_delay=1".)
Can you try kernel 3.9.x and see if it works? It's conceivable that that workaround does not work in your case.
Unfortunately, on Archlinux kernel 3.9 (and other dependant packages) is no longer provided in their archive, and I don't have it in my local cache either.
So it happens only for some games and not others? Please make a list of what works and what doesn't work for you.
@bumblebug For 3.9, you can build the old 3.9.8 package yourself.
wget -O- https://projects.archlinux.org/svntogit/packages.git/snapshot/packages-35c9ef3aa615346bbd3802a036650e548e485cf8.tar.gz | tar tvz packages-35c9ef3aa615346bbd3802a036650e548e485cf8/trunk
makepkg -s -i
The last step actually compiles the package (-s installs dependencies, -i installs package when the build is done). It takes some time, be sure to increase -j in MAKEFLAGS, see https://wiki.archlinux.org/index.php/Makepkg. Save the two generated linux*.pkg.tar.xz files in case you want to test these 3.9 kernels later again. Note: if you update, then these 3.9 packages are reverted again.
No answer from reporter, closing.