测试的机器是acer 4750g, GT540M
转自http://www.linuxidc.com/Linux/2012-07/66193.htm
和http://duxyng.wordpress.com/2012/01/26/finally-working-nvidia-optimus-on-fedora-16/
有些地方根据我遇到的情况作了小小修改,更清楚了一点。
Fedora 17下NVIDIA双显卡闭源驱动的安装,执行命令 lspci|grap VGA
看能否识别两张显卡,不行的就不要安装了
有些nvidia显卡会被识别错误,如我的gt540m被识别为gt555m,这没有关系,识别到了就行
1.添加rpmfusion源
32位 yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-branched.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-branched.noarch.rpm ## OR ## 64位 yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-branched.noarch.rpm yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-branched.noarch.rpm
2.安装一些必要组件
sudo yum install -y libbsd-devel libbsd glibc-devel libX11-devel help2man autoconf git tar glib2 glib2-devel kernel-devel kernel-headers automake gcc dkms
3.安装nvidia显卡驱动
sudo yum install libbsd-devel sudo yum install akmod-nvidia sudo yum install dkms
安装akmod-nvidia之后,删除/etc/X11/xorg.conf,
/etc/X11/xorg.conf.d/00-nvidia.conf
和 /etc/modprobe.d/blacklist-nouveau.conf
(可使用命令gvfs-trash /etc/X11/xorg.conf,进行删除)
使系统默认使用nouveau驱动
从/etc/grub2.cfg删除当前内核的参数 “nouveau.modeset=0 rd.driver.blacklist=nouveau”
5.下载最新版的bbswitch
https://github.com/Bumblebee-Project/bbswitch/downloads
6.通过dkms编译和安装bbswitch
进入下载bbswitch的目录
tar xvzf bbswitch-0.4.2.tar.gz sudo cp -Rv bbswitch-0.4.2 /usr/src ln -s /usr/src/bbswitch-0.4.2/dkms/dkms.conf /usr/src/bbswitch-0.4.2/dkms.conf sudo dkms add -m bbswitch -v 0.4.2 sudo dkms build -m bbswitch -v 0.4.2 sudo dkms install -m bbswitch -v 0.4.2
7.下载和安装最新的VirtualGL RPM
地址:http://www.virtualgl.org/Downloads/VirtualGL
我是32位的,64位的下载64位的文件
32位
sudo yum localinstall VirtualGL-2.3.1.i386.rpm
64位
sudo yum localinstall VirtualGL-2.3.1.x86_64.rpm
9.编译和安装bumblebee
tar xvzf bumblebee-3.0.tar.gz cd bumblebee-3.0 ./configure --prefix=/usr --sysconfdir=/etc make sudo make install sudo cp scripts/systemd/bumblebeed.service /lib/systemd/system
编辑/lib/systemd/system/bumblebeed.service,使其第七行变为:
ExecStart=/usr/sbin/bumblebeed --config /etc/bumblebee/bumblebee.conf
编辑/etc/bumblebee/bumblebee.conf
找到Driver=
变为
Driver=nvidia
在[driver-nvidia]部分里:
KernelDriver=nvidia
编辑/etc/bumblebee/xorg.conf.nvidia
在开头添加
32位
Section "Files" ModulePath "/usr/lib/xorg/modules/extensions/nvidia" ModulePath "/usr/lib/xorg/modules" EndSection
64位
Section "Files" ModulePath "/usr/lib64/xorg/modules/extensions/nvidia" ModulePath "/usr/lib64/xorg/modules" EndSection
末尾添加:
Section "Screen" Identifier "Screen1" Device "Device1" EndSection
10.添加bumblebee用户组,并把你自己添加到用户组内
sudo groupadd bumblebee sudo usermod -a -G bumblebee $USER
11.启动bumblebee服务
sudo systemctl enable bumblebeed.service sudo systemctl start bumblebeed.service
12.用nvidia显卡运行程序
optirun xxx
例如
optirun glxgears
13.一些文件的修正,最好在每次yum update 之后都进行修正
1.su - c "/etc/ld.so.conf.d/nvidia-lib64.conf; ldconfig"
2.sudo mv /usr/lib64/xorg/modules/extensions/nvidia /usr/lib64/xorg
3.在/etc/bumblebee/bumblebee.conf中设置"LibraryPath=/usr/lib64/nvidia”
4.在/etc/bumblebee/xorg.conf.nvidia中把ModulePath改为“/usr/lib64/xorg/nvidia”
5.重启
安装驱动
http://rpmfusion.org/Howto/nVidia#Installing_the_drivers
安装
试试 bumblebee
http://bumblebee-project.org/index.html
https://fedoraproject.org/wiki/Bumblebee
如果上面的配置没有的就参考这个 http://techies.ncsu.edu/wiki/bumblebee
添加源
yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/rhel7/noarch/bumblebee-release-1.0-1.noarch.rpm
yum -y --nogpgcheck install http://mirrors.hustunique.com/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/rhel7/noarch/bumblebee-nonfree-release-1.0-1.noarch.rpm
yum -y install bumblebee bbswitch bumblebee-nvidia primus
重启电脑