安装 bumblebee 以管理双显卡,下面命令会自动安装NVIDIA显卡驱动
sudo add-apt-repository ppa:bumblebee/stablesudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia
重启
sudo reboot查看显卡状态
lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev ff)
第一行是Intel核芯显卡信息,第二行是NVIDIA独立显卡信息,最后的 rev ff 表示独立显卡已经关闭
查看显卡驱动是否安装成功
sudo optirun nvidia-settings -c :8
则修改:sudo gedit /etc/bumblebee/bumblebee.conf
将“KernelDriver=nvidia-current"改为“KernelDriver=nvidia”
至此,显卡驱动已安装成功,如果要以独立显卡运行某个程序,例如 test 程序
sudo optirun test