Install cuda and optimus on Kali Linux

來源:互聯網
上載者:User

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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.