天天看點

Ubuntu12.10 GT650M 混合顯示卡/雙顯示卡驅動安裝

UEFI+WIN7+Ubuntu就夠坑了,這回還來一個hybrid顯示卡,搜來搜去,搜到個外國友人解決方案,譯來共勉

source:http://eternalvoid.net/tutorials/linux-optimus-gt650m/

先安裝這幾個非官方包

    • sudo add-apt-repository ppa:bumblebee/stable
    • sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

更新系統

    • sudo apt-get update
    • sudo apt-get upgrade

安裝幾個軟體 大黃蜂神碼的

    • sudo apt-get install build-essential ia32-libs git automake autoconf libtool virtualgl virtualgl-libs virtualgl-libs-ia32 bbswitch-dkms
    • sudo apt-get build-dep bumblebee bumblebee-nvidia

下載下傳官方驅動 (版本304.22b以後的). 64位 

http://www.nvidia.com/object/linux-display-amd64-304.22-driver.html

32位:

http://www.nvidia.com/object/linux-display-ia32-304.22-driver.html

If you don't know whether you need a 64-bit or 32-bit driver, you should probably learn a lot of things about computers before proceeding any further with these instructions.

檢測nouveau 核心模組是否已載入

    • lsmod | grep nouveau

若你看見任何輸出(任何反映),跑下面的兩句

    • sudo su -
    • echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf

黑名單屏蔽nvidia子產品,因為咱不想讓他自動安裝

    • echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf

 屏蔽nouveau之後就reboot吧,确認nouveau沒再跑

    • reboot

啟動完成再檢測是否已屏蔽它

    • lsmod | grep nouveau

If the last command outputs nothing, you're good to continue. If instead you see some references to nouveau, then you haven't blacklisted the module properly and the method for doing so may be different on your system. Please make sure you've blacklisted nouveau before continuing past this point.

如果檢測無反映,即可繼續

Give the NVidia driver installer the execute permission:

給驅動權重限

    • chmod 755 ~/Downloads/NVIDIA-Linux-x86_64-304.22.run

Now start the NVidia driver installer with some special command line arguments. The arguments are super-important, and if you do this part wrong you'll break your existing OpenGL install, possibly not fixable without reinstalling your operating system!!:

開始裝驅動,字尾非常重要,否則可能破壞已安裝的opengl,可能重裝才能解決

    • sudo ~/Downloads/./NVIDIA-Linux-x86_64-304.22.run --no-recursion --no-rpms --no-distro-scripts --no-x-check --dkms --x-prefix=/usr/nvidia --x-module-path=/usr/lib/xorg/nvidia/modules --x-library-path=/usr/nvidia/lib --opengl-prefix=/usr/nvidia --utility-prefix=/usr/nvidia --documentation-prefix=/usr/nvidia -e -q

During the install some errors may be reported, but this should be okay, and so long as the install completes successfully there's nothing to worry about.

安裝過程中可能出現一些錯誤,隻要最後顯示'completes'就行

Copy the 32-bit libraries into the right place (this only applies to 64-bit installations):

64位的機器如下操作(不過我12.10這兩行不成功也搞定了)

    • sudo mkdir -p /usr/nvidia/lib32
    • sudo cp -a /emul/ia32-linux/usr/lib/* /usr/nvidia/lib32

Reboot:

重新開機

    • sudo reboot

Get the bumblebee git repository (because for the GT650M you need Bumblebee version 3.0.1 or newer):

取得大黃蜂

    • mkdir -p ~/src
    • cd src
    • git clone https://github.com/Bumblebee-Project/Bumblebee.git

Configure, compile, install, and set up Bumblebee:

反正就是跑了

    • cd Bumblebee
    • git checkout v3.0.1
    • autoreconf -fi
    • ./configure --prefix=/usr --sysconfdir=/etc CONF_DRIVER=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia CONF_LDPATH_NVIDIA=/usr/nvidia/lib:/usr/nvidia/lib32:/usr/lib/xorg/nvidia/modules/drivers:/usr/lib/xorg/nvidia/modules/extensions:/usr/lib/xorg/nvidia/modules:/usr/lib/xorg/modules:/usr/lib/xorg/modules/drivers:/usr/lib/xorg/modules/extensions CONF_MODPATH_NVIDIA=/usr/lib/xorg/nvidia/modules/drivers,/usr/lib/xorg/nvidia/modules,/usr/lib/xorg/modules
    • make
    • sudo make install
    • sudo groupadd bumblebee
    • sudo addgroup _your_username_here_ bumblebee

Make sure you change _your_username_here_ above to your actual Linux regular user account name. 

上邊語句中的_your_username_換成自己的使用者名

Configure your system to start bumblebeed during bootup. This procedure may need to be different on non-Debian-based Linux distributions:

設定大黃蜂随系統啟動

    • sudo cp -a scripts/sysvinit/bumblebeed /etc/init.d
    • sudo chmod 755 /etc/init.d/bumblebeed
    • cd /etc/rc2.d
    • sudo ln -s ../init.d/bumblebeed S20bumblebeed

Rename an NVidia X server module to keep it from being loaded through bumblebee, because X really needs to load the stock version instead to work properly:

跑~

    • sudo mv /usr/lib/xorg/nvidia/modules/libwfb.so /usr/lib/xorg/nvidia/modules/libwfb.so.bak

Reboot:

重新開機

    • sudo reboot

If all went well, you can now run programs using your discrete NVidia card by launching them with the optirun command, like this:

應該搞定了,下邊是測試一下獨顯

    • optirun glxspheres

And, you still have your stock OpenGL stuff installed, so when you don't want to use the better video card, you can run programs as normal and they will be run using the primary display device. You can easily see the performance difference (check the FPS):

測自帶的intel顯示卡,看對比

    • glxspheres

If you try to do this setup the wrong way, you'll overwrite all the stock OpenGL stuff, and on Linux Mint 13 Cinnamon this means you won't be able to use the Cinnamon desktop. I hope it all worked out for you, thanks for reading / loving Linux.

Troubleshooting

If you followed these instructions correctly, but when running something with the optirun command, it fails with an error similar to:

[29.675070] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the

[ 29.675096] [ERROR]Aborting because fallback start is disabled.

...and if your /var/log/Xorg.8.log looks similar to this: http://pastebin.com/GnFzaJcD

You should try changing a setting in your xorg.conf.nvidia like this:

    • sudo gedit /etc/bumblebee/xorg.conf.nvidia &

Change:

Option "ConnectedMonitor" "DFP"

to

Option "ConnectedMonitor" "CRT"

Thanks to kudlata for figuring out this fix!

If nothing's working and you have a Lenovo or Toshiba brand system, try following the instructions outlined here: lenovo hack

轉載于:https://www.cnblogs.com/ishiiwa/archive/2012/10/28/2743088.html

git