知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

Install cuda and optimus on Kali Linux

发布时间:2014-09-05 14:17:14作者:知识屋

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 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
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 the 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 could 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 should 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 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.

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜