Saturday, November 3, 2012

How to Install CUDA on nVIDIA Optimus with Backtrack 5 R3

In this post you will learn how to setup a notebook with nVidia Optimus technology working with CUDA.

All this information that I will present you here, would not be possible without the help of "Samiux" that helped me to pass through this problem.
You can find his blog here: http://samiux.blogspot.hk

This was tested in my own notebook with the below specs:

Brand : Asus n82jv-vx072v
CPU : Intel i5 450M, 2.4Ghz
RAM : 4096MB DDR3 1066
Display card : nVidia GeForce GT335M 1G VRAM DDR3




the Display card as you can see is a nVidia card, so if you are lucky it's compatible with CUDA. You can check if your nVidia is CUDA-capable in the following link:https://developer.nvidia.com/cuda-gpus

At this point you should be able to startx without any problem in your device.
If you cannot please check the following link: Fix Blank Screen when using Startx

Do not "startx". When installing the nVIDIA toolkit you should not have the x session started.

Step 1

Download CUDA 5.0 for 64-bit using the following command:
Note: at the time of this tutorial there might be a more recent version, you should download it instead.

Check:https://developer.nvidia.com/cuda-downloads and download the most recent one for your distribution.

Example:

wget http://developer.download.nvidia.com/compute/cuda/5_0/rel/installers/cuda_5.0.35_linux_64_ubuntu10.04.run



When it's downloaded issue the following command, it changes the permission of the file, to allow you to execute it.

chmod +x cuda_5.0.35_linux_64_ubuntu10.04.run

And then run it:

./cuda_5.0.35_linux_64_ubuntu10.04.run

Press "accept" and go ahead in all the wizards, I recommend install everything, and keep the "defaults".


Step 2

Now you should edit the bashrc, to do so follow the below commands:

nano /root/.bashrc

Append the following :

PATH=$PATH:/usr/local/cuda-5.0/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib
export PATH
export LD_LIBRARY_PATH

Or, you can do the following instead for any Linux distributions.

nano /etc/ld.so.conf.d/cuda.conf

/usr/local/cuda-5.0/bin
/usr/local/cuda-5.0/lib
/usr/local/cuda-5.0/lib64
/lib

Save the file and then run the following command :

ldconfig

After all reboot.

Step 3

To take use of the nVIDIA optimus technology you have to install bumblebee.
To do so, follow the commands:

sudo add-apt-repository ppa:bumblebee/stable

sudo apt-get update

sudo apt-get install bumblebee bumblebee-nvidia
 
After it Reboot your machine again.

Step 4

Before we move ahead we should test if the nVIDIA driver working properly,
issue the following command and see the diference:

glxspheres

optirun glxspheres

Step 5

Now if you want to install Pyrit follow the next few step:

Go to the official site of pyrit: http://code.google.com/p/pyrit/downloads/list and download the most recent version of pyrit and cpyrit.

After it issue the following commands:

tar -xzvf pyrit-0.4.0.tar.gz
cd pyrit-0.4.0
python setup.py build
python setup.py install

tar -xzvf cpyrit-cuda-0.4.0.tar.gz
cd cpyrit-cuda-0.4.0
python setup.py build
python setup.py install

Now if you want to test pyrit and optimus too, issue the following commands:

optirun pyrit list_cores
optirun pyrit benchmark
optirun pyrit benchmark_long

That's all!

You have CUDA installed, with Optimus technology working and pyrit ready to crack password.

Again: This tutorial was not possible without the help and support of "Samiux" who helped me during a series of problems in my own Backtrack installation.

His blog can be found here:http://samiux.blogspot.hk

Thank's "Samiux"  

1 comment:

  1. a query, I installed everything correctly,
    when running list_cores: shows me this.
    all right, let me know as I do that
    "'CUDA-Device # 1' GeForce 410 '' 'show me
    the other 3 cores?

    #1: 'CUDA-Device #1 'GeForce 410''
    #2: 'CPU-Core (SSE2)'
    #3: 'CPU-Core (SSE2)'
    #4: 'CPU-Core (SSE2)'

    ReplyDelete