(Guide) Installing Nvidia + Bumblebee + CUDA for Optimus enabled Laptops

来源:互联网 发布:淘宝网恒源祥女装 编辑:程序博客网 时间:2024/06/05 02:44

Updated:

EDIT: I recommend you install the newer drivers at the post linked below as they are compatible with the newer video cards and do not need as much installed from backports (always a good thing)

Post 25 to install NVIDIA 340.24 Driver and CUDA 6. Link below:

https://forums.kali.org/showthread.p...ll=1#post35420

I have seen a few people now having issues with installing Nvidia + bumblebee for their Optimus enabled laptop. Hopefully the steps here help everyone out as I know I spent a good long while getting this to work.

What to expect
At the end of this guide you will (should) have an up-to-date Kali 1.0.7 installed with Nvidia 331.67 + Bumblebee 3.2.1 and CUDA 5.5 ready for pyrit and hashcat

Note
Please read everything and don’t make assumptions. If the Nvidia installer tells you to run nvidia-xconfig and I haven’t –DON’T RUN IT. Also, i've never tried this on 32bit. I can't confirm it works.

Assumptions
I’m installing everything from and to my home directory (/root). I’m assuming you are too.

Prerequisites
• Clean Kali 1.0.7 installed and fully updated (I’m assuming this is the case, venture forward at your own peril)
apt-get update && apt-get upgrade && apt-get dist-upgrade
• I’m using 64bit Kali (on an EFI boot with an Nvidia 740M and Intel 4000 graphics). If you are not on 64bit, you will need to change the VirtualGL downloaded to the 32bit version.
• When you add the CUDA libraries, add the lines for 32bit to the same location (the installer will print them)
• I’m also assuming as you are using Kali, you are familiar with terminal (not an expert, but can use it)

Downloads
You will need the files below (one of each be it 32 or 64 bit) I always go with 64bit as I am on Kali 64bit
• Pick one of the following
• CUDA 5.5 for Ubuntu 12.04 64Bit
http://developer.download.nvidia.com...2_linux_64.run
• CUDA 5.5 for Ubuntu 12.04 32Bit
http://developer.download.nvidia.com...2_linux_32.run

• Pick one of the following
• VirtualGL for 64Bit
http://downloads.sourceforge.net/pro...se_mirror=ufpr
• VirtualGL for 32Bit
http://downloads.sourceforge.net/pro...se_mirror=ufpr

First, install the linux headers. We need this so we can compile bbswitch later
apt-get install linux-headers-$(uname -r)

Some dependencies for CUDA later
apt-get install freeglut3-dev libxmu-dev

Install VirtualGL
cd ~
dpkg -i virtualgl*.deb


Add the path for VirtualGL to .bashrc
nano ~/.bashrc
Add a line somewhere near the top that reads:
export PATH=$PATH:/opt/VirtualGL/bin

Save the file and then log out and in. You should be able to run glxspheres64 without the full path

Add the wheezy backports Repo
nano /etc/apt/sources.list
Add the following line to the file and then save
deb http://ftp.debian.org/debian wheezy-backports main contrib non-free
apt-get update


Install Bumblebee. You will see a couple of pop ups, just acknowledge them.
apt-get install bumblebee-nvidia primus

Now install the nvidia drivers
apt-get install nvidia-glx

Check where your Nvidia card is installed. Record the results for later. For example, mine is installed at 03:00.0 3D Controller: NVIDIA Corporation Device 1292 (rev FF). The 03:00.0 is the important bit.
lspci | egrep 'VGA|3D'

Add the address to the xorg.conf.nvidia file
nano /etc/bumblebee/xorg.conf.nvidia

Find the section which reads as below and add a line so that is has my new BusID line but with the value recorded earlier. Note the . has become a : before the last digit
Section "Device"
Identifier "DiscreteNvidia"
Driver "nvidia"
VendorName "Nvidia Corporation
BusID "PCI:03:00:0"

Save and exit

Open the bumblebee.conf file
nano /etc/bumblebee/bumblebee.conf

Edit line 22 to read
Driver=nvidia

Edit line 55 to read
KernelDriver=nvidia-current

Save and exit

Restart Bumblebee
/etc/init.d/bumblebeed restart

Run the command below to confirm that bumblebee is working
optirun glxspheres64


Look at that! We now have bumblebee! notice the frame rate is much higher than if we used glxspheres64 by itself.


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



We are part way there, next is to install CUDA. But first, we need some libs.
apt-get install libcuda1

Now, install CUDA itself

cd ~
chmod +x cuda*.run
./cuda*.run


Scroll to the bottom of the file with space-bar and accept the EULA (Which you read)
Select yes to continue with an unsupported configuration
Select NO. YOU DO NOT WANT TO INSTALL THE NVIDIA DRIVER
Select yes. You do want the CUDA 5.5 Toolkit
Enter for default location (i'm assuming you have chosen this)
Select yes for CUDA 5.5 samples
Enter for default location (i'm assuming you have chosen this)
Wait a while

Ignore the WARNING about the installation being incomplete.
Take note of the LD_LIBRARY_PATH. As with before, i'm on 64bit. Adjust if you are on 32bit.

Open a new terminal window (so you have the library paths as a reference in the old one)

Adding the libraries
nano /etc/ld.so.conf

Add the following below the line already in this file. The result will look like:
include /etc/ld.so.conf.d/*.conf
/usr/local/cuda-5.5/lib64
/lib


Save and exit

Run
ldconfig

Now to fix the nvidia-uvm module (You don't know this yet, but it's broken.)

cd /usr/src/nvidia-current-331.67
make

cp Module.symvers uvm/

cd uvm/
make


Please take care with this next command
rm /lib/modules/`uname -r`/updates/dkms/nvidia-uvm.ko

cp /usr/src/nvidia-current-331.67/uvm/nvidia-uvm.ko /lib/modules/`uname -r`/updates/dkms/


The next command will have no errors if all went well
modprobe nvidia-uvm

Now to make the CUDA samples and confirm it works! This make will take a little while...
cd ~/NVIDIA_CUDA-5.5_Samples/NVIDIA_CUDA-5.5_Samples/
make


Lets confirm it works!
cd 1_Utilities/deviceQuery
optirun ./deviceQuery


You should see Result = PASS!

Congratulations, you have Kali 1.0.7 + Nvidia 331.67 + CUDA 5.5 + Bumblebee 3.2.1 installed and working


Note:

If you get some error, make sure about the version of nvidia-kernel-dkms larger than the cuda required.

the version of nvidia-kernel-dkms:

aptitude show nvidia-kernel-dkms

the cuda required: show you when cuda be installed


---------------------------------------------------------------------------------------------------------------------------------------------------------------------




First, remove the wheezy repo. You may either comment out the line we added or delete it.
nano /etc/apt/sources.list
Save the file
apt-get update

The following instructions are slightly modified from the pyrit google code page here. Give them all your love.
https://code.google.com/p/pyrit/wiki/Installation

Moving to home directory as I'm installing there
cd ~

Checkout pyrit
svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn


Install required libraries
apt-get install libpcap-dev

cd pyrit_svn/pyrit/
python setup.py build
python setup.py install


Now to add CUDA support
cd ../cpyrit_cuda/
python setup.py build
python setup.py install


Now, what we have been waiting for this entire time. Lets see it work.
optirun pyrit benchmark

And we are done.




https://forums.kali.org/showthread.php?21956-%28Guide%29-Installing-Nvidia-Bumblebee-CUDA-for-Optimus-enabled-Laptops

kiba update at 2015.01.17

0 0
原创粉丝点击