сряда, 6 август 2014 г.

How to turn on that nvidia video-card

For long time, I had no idea how to turn on my nvidia video card, because I have an internal intel card and Sabayon seems to prefer it.
Today, totally at random I managed to turn it on. Ok, it wasn't that random, because my webcam is not working and I was looking for possible bios and kernel solutions, but anyway, it was quite random finding the error ( Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130517/nsarguments-95))  because of which I couldn't switch my video cards.
Here's what I did (source):
1. Install latest bbswitch (read more on the Bumblebee project) + nvidia stuff
$sudo equo install bbswitch nvidia-drivers nvidia-userspace
2. Add  the following line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet rcutree.rcu_idle_gp_delay=1"
in /etc/default/sabayon-grub
(or whatever grub folder you have in /etc/default)
3. Reboot
4. To check if you can switch to nvidia use:
$sudo optirun -vvv glxspheres
If it works, you'll get a very pretty and colorful animation of spheres.
If it doesn't you'll get an error.
5. To play any program using nvidia instead of your internal video card use
$optirun program
(i.e. $optirun smplayer or $optirun /path/to/maple/xmaple)
I checked with Maple's 3d plot engine, it indeed recognise my nvidia card and use the hardware acceleration on the plots! So a serious WOW today! Cool, huh?! :)
Btw, my nvidia card still doesn't appear when I do $sudo lshw -C display and I still use Xorg and Mesa as my opengl engine, because it's energy-saving and because for some reasons switching to nvidia didn't produce any difference when I checked with $glxinfo
On the other hand, this was before I messed with /etc/defaults/sabayon-grub, so maybe now switching to nvidia will be more successful. But then, my internal video-card is doing just fine and if I can use nvidia whenever I need it, that's just amazing!