Cuda on Backtrack 5 R2

After some pyrit problem this is guide to install cuda on Backtrack 5 R2. This guide is to configure cuda drivers and running parallel processing.

Start by preparing your kernel sources for the Nvidia driver installation:

root@bt:~# prepare-kernel-sources
root@bt:~# cd /usr/src/linux
root@bt:~# cp -rf include/generated/* include/linux/

Download Nvidia drivers according to your CPU architecture

http://www.nvidia.in/Download/indexsg.aspx?lang=en-in

Make sure you are not in an X session (log out to console), and run the Nvidia driver installer.

Next, download the CUDA toolkit, according to your CPU architecture:

developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/cudatoolkit_4.1.28_linux_32_ubuntu11.04.run  (32 bit)
developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/cudatoolkit_4.1.28_linux_64_suse11.2.run  (64 bit)

During CUDA toolkit installation give install path folder to /opt.Now Configure your environment variables so that the nvcc command works. You can do this by appending the following lines in your /root/.bashrc file:

PATH=$PATH:/opt/cuda/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cuda/lib
export PATH
export LD_LIBRARY_PATH

Then run:

root@bt:~# source /root/.bashrc
root@bt:~# ldconfig

Now check if everything is setup correctly

root@bt:~# which nvcc
/opt/cuda/bin/nvcc
root@bt:~# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2011 NVIDIA Corporation
Built on Thu_Jan_12_14:36:13_PST_2012
Cuda compilation tools, release 4.1, V0.2.1221

Now Nvidia driver and CUDA toolkit is install lets check it by pyrit.

Following command will create main directory tree for installation with svn support.

Code:
svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit

We have just created a dir /pyrit_svn.This will install libs and other stuff that are needed:

Code:
apt-get install libssl-dev
apt-get install scapy
apt-get install python-dev

Going to construct pyrit

Code:
cd pyrit/pyrit
python setup.py build
python setup.py install
root@bt:~# cd ../../
root@bt:~# cd pyrit/cpyrit_cuda && python setup.py build && python setup.py install

Run a benchmark to see that everything works as expected:

root@bt:~# pyrit benchmark
Pyrit 0.4.1-dev (svn r308) (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

Running benchmark (63787.8 PMKs/s)... \ 

Computed 63787.82 PMKs/s total.
#1: 'CUDA-Device #1 'GeForce GTX 295: 11558.7 PMKs/s (RTT 3.0)
#2: 'CUDA-Device #2 'GeForce GTX 295: 10912.5 PMKs/s (RTT 2.9)
#3: 'CUDA-Device #3 'GeForce GTX 295: 10632.1 PMKs/s (RTT 3.0)
#4: 'CUDA-Device #4 'GeForce GTX 295: 11654.7 PMKs/s (RTT 2.9)
#5: 'CUDA-Device #5 'GeForce GTX 295: 10868.9 PMKs/s (RTT 2.9)
#6: 'CUDA-Device #6 'GeForce GTX 295: 10322.8 PMKs/s (RTT 3.0)
#7: 'CPU-Core (SSE2)': 500.7 PMKs/s (RTT 2.7)
#8: 'CPU-Core (SSE2)': 508.9 PMKs/s (RTT 2.8)

Tada!! Cuda GPU is enabled.

To remove pyrit remove following directories and files

/usr/local/lib/python2.6/dist-packages/cpyrit/*
/usr/local/lib/python2.6/dist-packages/pyrit*
/usr/local/bin/pyrit

I ran the locate command to find these... ~#locate pyrit

In Case you see some core missing it is due to because one core is reserved.So Dont worry if one core is missing during
Benchmark.
That's all..see ya!!!
Advertisements

5 thoughts on “Cuda on Backtrack 5 R2

Add yours

  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)’

Join the Discussion

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: