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 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 |
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 |
Decompress cpyrit-cuda-0.4.0.tar.gz
tar -xzvf cpyrit-cuda-0.4.0.tar.gz |
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
After installation, run
We should be able to see the GPU.
#1: 'CUDA-Device #1 'GeForce 8400 GS'' |
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 install bumblebee bumblebee-nvidia |
After installation, add root to the bemblebe group and restart
After restart, you can test and run them separately.
The number of frames is different.