Install cuda and optimus on Kali Linux

Source: Internet
Author: User
Tags kali linux

It's a hard job to install cuda and optumus on Kali Linux, I tried all day and finally success, this is how it words.

Install cuda and nvidia driver
It's really simple, and it may take some time, it's not the latest version, but it works.

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 unzip libcudart4 libcufft4 libnpp4 libnvidia-compiler libcuda1 runtime libnvidia-ml1 unzip libcusparse4 libcurand4 python-pycuda-doc python-pycuda-headers python-pycuda nvidia-cuda- doc nvidia-cuda-gdb
During the process, there are some information to confirm, just press OK. After that, we need to add these to the/root/. 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
Reboot the computer.

Install pyrit-cuda
The wo will compile a pyrit with cuda, download the source from here.

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

We nedd both pyrit-0.4.0.tar.gz and cpyrit-cuda-0.4.0.tar.gz, and wo need soom lib and tools to complete the compile.

Atp-get install libpcap-dev python2.7-dev
Decompress the 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 wo nedd edit the setup. py, line 35, edit it from

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

For path in ('/usr/local/cuda', '/usr/lib/nvidia-cuda-toolkit', '/opt/cuda '):
So the nvcc cocould be found during the process, then install

Python setup. py build
Python setup. py install
After that, We can try it

Pyrit list_cores
You shoshould find the CUDA-Device

#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
Get the apt-key

Wget-O-http://suwako.nomanga.net/suwako.asc | apt-key add-
Edit the source of Bumblebee to the/etc/apt/source. list

Deb http://suwako.nomanga.net/debian sid main contrib
Deb-src http://suwako.nomanga.net/debian sid main
Then install

Apt-get update
Apt-get install bumblebee-nvidia
Add the root to the bumblebee group

Adduser root bumblebee
Reboot, and you can run

Glxspheres
Optirun glxspheres
You will find out the fps is different.

Related Article

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.