Install cuda, pyrit-cuda, And Optimus on Kali Linux

Source: Internet
Author: User
Tags kali linux

I won't talk about the installation of Cuda and Optimus on the theme. I found that some foreigners did not succeed or there were few articles about Kali. After more than one day of repeated installation and testing, this article is the final one, the English version is also released.

Install Cuda and NVIDIA drivers
This step is relatively simple. Before installation, we recommend that you edit the/etc/APT/source. list file, comment out the foreign source and switch it to the Chinese Emy of science and technology, and download it quickly. The address of KE dayuan is as follows:

deb
http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb-src
http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb
http://mirrors.ustc.edu.cn/kali-security kali/updates main contrib non-free

Run the following command to install

apt-get update
 
apt-get install nvidia-detect nvidia-libopencl1 nvidia-opencl-common nvidia-support nvidia-opencl-icd nvidia-visual-profiler nvidia-glx nvidia-installer-cleanup nvidia-kernel-common nvidia-smi nvidia-alternative nvidia-opencl-dev
libglx-nvidia-alternatives nvidia-kernel-dkms nvidia-cuda-toolkit nvidia-vdpau-driver nvidia-xconfig glx-alternative-nvidia libgl1-nvidia-alternatives nvidia-settings libgl1-nvidia-glx xserver-xorg-video-nvidia libcublas4 libcudart4 libcufft4 libnpp4 libnvidia-compiler
libcuda1 libcuinj4 libnvidia-ml1 libxvmcnvidia1 libcusparse4 libcurand4 python-pycuda-doc python-pycuda-headers python-pycuda nvidia-cuda-doc nvidia-cuda-gdb

Because many packages may be a little slow, the installation process will pop up two windows to confirm, just OK. After the execution, the toolkit and driver are installed, and then some variables are written to the system, in/root /. add the following paragraph to the end of bashrc:

PATH=$PATH:/usr/lib/nvidia-cuda-toolkit/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia-cuda-toolkit/lib:/lib
export PATH
export LD_LIBRARY_PATH

You can execute ldconfig to take effect immediately, but it will be restarted once.

Install pyrit-Cuda
Next, recompile A pyrit to try GPU. The download address of pyrit is:

Https://code.google.com/p/pyrit/downloads/list

Download pyrit-0.4.0.tar.gzand cpyrit-cuda-0.4.0.tar.gz. After the download, install the required tool.

atp-get install libpcap-dev python2.7-dev

Decompress pyrit-0.4.0.tar.gz and install

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

Decompress cpyrit-cuda-0.4.0.tar.gz

tar -xzvf cpyrit-cuda-0.4.0.tar.gz
cd cpyrit-cuda-0.4.0

Here we need to make some changes, edit setup. py, and set the 35th rows

for path in ('/usr/local/cuda', '/opt/cuda'):

Change

for path in ('/usr/local/cuda','/usr/lib/nvidia-cuda-toolkit','/opt/cuda'):

Otherwise the installation program cannot find nvcc
Then install

python setup.py build
python setup.py install

After installation, run

pyrit list_cores

We should be able to see the GPU.

#1: 'CUDA-Device #1 'GeForce 8400 GS''
#2: 'CPU-Core (SSE2)'
#3: 'CPU-Core (SSE2)'
#4: 'CPU-Core (SSE2)'
#5: 'CPU-Core (SSE2)'
#6: 'CPU-Core (SSE2)'
#7: 'CPU-Core (SSE2)'
#8: 'CPU-Core (SSE2)'

Install Optimus
Retrieve the source key

wget -O -
http://suwako.nomanga.net/suwako.asc | apt-key add -

Add the bumblebee source to/etc/APT/source. List.

deb
http://suwako.nomanga.net/debian sid main contrib
deb-src
http://suwako.nomanga.net/debian sid main

Then execute the installation

apt-get update
apt-get install bumblebee bumblebee-nvidia

After installation, add root to the bemblebe group and restart

adduser root bumblebee

After restart, you can test and run them separately.

glxspheres
optirun glxspheres

The number of frames is different.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.