Pyrit icon indicating copy to clipboard operation
Pyrit copied to clipboard

Can someone please help on writing the commands to insall pyrit on ubuntu 17.10 GPU

Open nightshadow36 opened this issue 6 years ago • 20 comments

@JPaulMora Hello.

I have bee awake 3 days now trying to get my 750 Ti to work with pyrit and GPU

1: I have tried this https://askubuntu.com/questions/967332/how-can-i-install-cuda-9-on-ubuntu-17-10 I had no errors and the Simulations/smokeParticles worked 2: I also tried this https://docs.kali.org/general-use/install-nvidia-drivers-on-kali-linux 3: And this https://github.com/JPaulMora/Pyrit/issues/553 4: Tried a few other posts that I cannot even find now, also tried Kali install.

Does anyone have a working guide on how to get it installed on ubuntu 17.10 what ever I try using pyrit list_cores its not showing my nvidia card also changed the ./pyrit config folder to enable CUDA this also did not work. the closest i got was at the bottom of pyrit it said CUDA: rest was blank. Must have reinstalled linux about 30 times now.

5: nvidia-smi VIDIA-SMI 390.42 Driver Version: 390.42
0 GeForce GTX 750 Ti Off GPU-Util Compute M. GPU Name Persistence-M

6: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA Corporation Built on Fri_Nov__3_21:07:56_CDT_2017 Cuda compilation tools, release 9.1, V9.1.85

The ouput of number 5 and 6 does that mean I have the nvidia and cuda installed correctly? Is there another part of a config file I should be reading up on now?

Please help. Thank you.

nightshadow36 avatar Mar 21 '18 02:03 nightshadow36

@nightshadow36 You don't need to reinstall Ubuntu 17.10. What's the output of 'setup.py install' from within the modules/cpyrit_cuda directory?

texasbe2trill-zz avatar Mar 22 '18 04:03 texasbe2trill-zz

Thanks for getting back to me. I tried installing kali because i thought most of it would be set up. Still problems though - CUDA and GPU drivers is installed as its working in Hashcat. When trying Pyrit I just get this

WARNING: Unknown option 'use_CUDA' in configfile '/root/.pyrit/config' WARNING: Unknown option 'use_OpenCL' in configfile '/root/.pyrit/config' The following cores seem available... #1: 'CPU-Core (SSE2)' #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)'

modules/cpyrit_cuda directory? I am trying to find this on Kali at the moment.

nightshadow36 avatar Mar 22 '18 13:03 nightshadow36

It wont work-Have to uninstall Pyrit and then (build make install) it yourself! Do this guide 👍

apt install nvidia-driver ocl-icd-libopencl1 nvidia-cuda-toolkit

apt install python2.7-dev python-pycuda-doc python-pycuda python3-pycuda mesa-utils libgl1-nvidia-glx

apt install libssl-dev zlib1g-dev libpcap-dev nvidia-xconfig

reboot

*********Pyrit prep

git clone https://github.com/JPaulMora/Pyrit.git

gedit /root/.bashrc

*Add these lines 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

*Pyrit_Cuda Prep and Install

cd /root/Pyrit/modules/cpyrit_cuda/

gedit setup.py

Edit the setup.py, line 34,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'):

line 88,edit it from*

nvcc_cmd = NVCC+ bit_flag + ' -ccbin clang -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu'

*to:

nvcc_cmd = NVCC + bit_flag + ' -ccbin clang-3.8 -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu'

*then

cd /root/Pyrit/modules/cpyrit_cuda

*and install

python setup.py clean build install

cd /root/Pyrit/

python setup.py clean build install

yes 2 times in differnt dir *last thing

gedit /root/.pyrit/config

*change from:

use_CUDA = false

*to

use_CUDA = true

*now check your GPU

pyrit list_cores

ENJOY !!!

*Note: GPU works best with 1 CPU core gedit /root/.pyrit/config *set: limit_ncpus = 1

My score:

root@kali:/# pyrit benchmark Pyrit 0.5.1 (C) 2008-2011 Lukas Lueg - 2015 John Mora https://github.com/JPaulMora/Pyrit This code is distributed under the GNU General Public License v3+

Running benchmark (123359.7 PMKs/s)... |

Computed 123359.69 PMKs/s total. #1: 'CPU-Core (SSE2/AES)': 1195.8 PMKs/s (RTT 2.9) CUDA: #1: 'CUDA-Device #1 'GeForce GTX 1060 3GB'': 133063.0 PMKs/s (RTT 1.0)

for powermizer and manual fan control nvidia-xconfig --cool-bits=12 reboot

Hackitfree avatar Mar 22 '18 13:03 Hackitfree

Just follow-copy paste -and try not to make mistakes..Its not too hard..Point is that the version Pyrit 0.5,1 needs upgrade and some sorrections.Also Linux(Kali or Ubuntu) have to know where are the libraries-cuda... Every time i install Kali or Ubuntu i have to do this guide!

Hackitfree avatar Mar 22 '18 13:03 Hackitfree

This is really strange thanks for posting. I am in the middle of already installing following your instructions on another post

nightshadow36 avatar Mar 22 '18 13:03 nightshadow36

@Hackitfree These two error messages have gone WARNING: Unknown option 'use_CUDA' in configfile '/root/.pyrit/config' WARNING: Unknown option 'use_OpenCL' in configfile '/root/.pyrit/config'

I followed the guide but for some reason it`s still not showing the GPU It shows CUDA but nothing after

Computed 1480.46 PMKs/s total. #1: 'CPU-Core (SSE2/AES)': 191.8 PMKs/s (RTT 3.0) #2: 'CPU-Core (SSE2/AES)': 193.7 PMKs/s (RTT 3.0) #3: 'CPU-Core (SSE2/AES)': 200.3 PMKs/s (RTT 3.0) #4: 'CPU-Core (SSE2/AES)': 195.8 PMKs/s (RTT 3.1) #5: 'CPU-Core (SSE2/AES)': 205.0 PMKs/s (RTT 2.9) #6: 'CPU-Core (SSE2/AES)': 197.5 PMKs/s (RTT 3.1) #7: 'CPU-Core (SSE2/AES)': 196.8 PMKs/s (RTT 3.1) #8: 'CPU-Core (SSE2/AES)': 203.1 PMKs/s (RTT 3.0) CUDA:

Thank you.

nightshadow36 avatar Mar 22 '18 14:03 nightshadow36

Hi-So youfollowed all the guide correctly?.. Please go into your cloned directory named Pyrit.. If you are not root you have to use sudo-youknow that... then try: cd /modules/cpyrit_cuda/ if you edited "setup.py" file here already rigt...... then type: python setup.py clean build install

copy all what you get here and i will instruct you further 👍

Hackitfree avatar Mar 22 '18 14:03 Hackitfree

I must ask you if you uninstalled the old Pyrit.. with: sudo apt uninstall pyrit

you have to do this so the new pyrit takes effect

Hackitfree avatar Mar 22 '18 14:03 Hackitfree

@Hackitfree I think i uninstalled pyrit. sudo apt uninstall pyrit ----- E: Invalid operation uninstall

So rm -rf /usr/local/lib/python2.7/dist-packages/pyrit apt-get purge pyrit* apt-get autoremove.

~/Pyrit/modules/cpyrit_cuda# python setup.py clean build install running clean Removing temporary files and pre-built GPU-kernels... running build running build_ext Compiling CUDA module using nvcc 9.1, V9.1.85... Executing '/usr/local/cuda/bin/nvcc -m64 -ccbin clang-3.8 -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' clang-3.8: No such file or directory Traceback (most recent call last): File "setup.py", line 166, in setup(**setup_args) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "setup.py", line 91, in run subprocess.check_call(nvcc_cmd, shell=True) File "/usr/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/cuda/bin/nvcc -m64 -ccbin clang-3.8 -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' returned non-zero exit status 1

Thank you for the help so far.

nightshadow36 avatar Mar 22 '18 15:03 nightshadow36

Ok.. you dont have to remove the pyrit program from Python or bin dir-coz compiling it again will overwrite it! just remove the first Pyrit(its in differnt dir-by doing:

apt remove pyrit

no "uninstall command in Linux"

I see that the actual "fix" that we aply here-(ading clang-3.8) inyour case is not needed..So delete the Pyrit directory and once more download it via git command-(you have git installed i hope) So:

git clone https://github.com/JPaulMora/Pyrit.git

and then try to compile it again so we can see what errors we came up with:

cd /modules/cpyrit_cuda/

python setup.py clean build install

copy all what you get here and i will instruct you further 👍

Hackitfree avatar Mar 22 '18 15:03 Hackitfree

You are a * Thank you very much, very happy now to see my graphics card.+ :) The following cores seem available... #1: 'CPU-Core (SSE2/AES)' #2: 'CPU-Core (SSE2/AES)' #3: 'CPU-Core (SSE2/AES)' #4: 'CPU-Core (SSE2/AES)' #5: 'CPU-Core (SSE2/AES)' #6: 'CPU-Core (SSE2/AES)' #7: 'CPU-Core (SSE2/AES)' #8: 'CPU-Core (SSE2/AES)'

The following CUDA GPUs seem aviable... #1: 'CUDA-Device #1 'GeForce GTX 750 Ti''

nightshadow36 avatar Mar 22 '18 16:03 nightshadow36

YW dude :)

Now limit number of CPU's to get best score in Pyrit

gedit /root/.pyrit/config *set: limit_ncpus = 1

Im interested how well that 750ti scores so please send me output :) TY.

Hackitfree avatar Mar 22 '18 16:03 Hackitfree

Kali 2018 / USB install

Computed 38283.30 PMKs/s total. #1: 'CPU-Core (SSE2/AES)': 293.8 PMKs/s (RTT 3.0) CUDA: #1: 'CUDA-Device #1 'GeForce GTX 750 Ti'': 43117.9 PMKs/s (RTT 2.7)

Again thank you, nice that people are out there willing to help.

nightshadow36 avatar Mar 22 '18 16:03 nightshadow36

@Hackitfree Hi hope you don't mind me asking a question I was thinking of getting 2 x unbranded gtx 780 ti from eBay as I have a sli motherboard. Do the graphic cards still need to be bridged to work together with pyrit? Thank you

nightshadow36 avatar Mar 24 '18 18:03 nightshadow36

Hi my friend :) I think (and by that 99.9% sure) that you wont need bridge to use both those cards for Pyrit or hashcat. The only downside to using those 2 cards is big power draw so you will need big powersupply for that.. Im glad if i can help you and you are welcome any time :)

Hackitfree avatar Mar 24 '18 22:03 Hackitfree

@Hackitfree

Hi! I am using cuda9.2 and when i install pyrit it says

" Executing '/usr/local/cuda/bin/nvcc -m64 -ccbin clang -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' nvcc fatal : The version ('6.0') of the host compiler ('clang') is not supported "

does that means I should downgrade my cuda version ? cuda9.2 didn't support 6.0clang anymore?

Now i am using openCL mode with pyrit and it works well

darksty avatar Aug 28 '18 12:08 darksty

@Hackitfree

Already fixed this problem when i changed to clang-4.0

it print so many errors..

running clean Removing temporary files and pre-built GPU-kernels... running build running build_ext Compiling CUDA module using nvcc 9.2, V9.2.148... Executing '/usr/local/cuda/bin/nvcc -m64 -ccbin clang-4.0 -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' Building modules... building 'cpyrit._cpyrit_cuda' extension creating build creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-rHYsq1/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _cpyrit_cuda.c -o build/temp.linux-x86_64-2.7/_cpyrit_cuda.o -Wall -fno-strict-aliasing -DVERSION="0.5.0" _cpyrit_cuda.c: In function ‘cudadev_init’: _cpyrit_cuda.c:134:5: warning: ‘cuFuncSetBlockShape’ is deprecated [-Wdeprecated-declarations] CUSAFECALL(cuFuncSetBlockShape(self->kernel, THREADS_PER_BLOCK, 1, 1)); ^~~~~~~~~~ In file included from _cpyrit_cuda.h:22, from _cpyrit_cuda.c:44: /usr/local/cuda/include/cuda.h:9819:36: note: declared here __CUDA_DEPRECATED CUresult CUDAAPI cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z); ^~~~~~~~~~~~~~~~~~~ _cpyrit_cuda.c: In function ‘calc_pmklist’: _cpyrit_cuda.c:199:5: warning: ‘cuParamSetv’ is deprecated [-Wdeprecated-declarations] cuParamSetv(self->kernel, offset, &ptr, sizeof(ptr)); ^~~~~~~~~~~ In file included from _cpyrit_cuda.h:22, from _cpyrit_cuda.c:44: /usr/local/cuda/include/cuda.h:9986:36: note: declared here __CUDA_DEPRECATED CUresult CUDAAPI cuParamSetv(CUfunction hfunc, int offset, void *ptr, unsigned int numbytes); ^~~~~~~~~~~ _cpyrit_cuda.c:204:5: warning: ‘cuParamSetv’ is deprecated [-Wdeprecated-declarations] cuParamSetv(self->kernel, offset, &ptr, sizeof(ptr)); ^~~~~~~~~~~ In file included from _cpyrit_cuda.h:22, from _cpyrit_cuda.c:44: /usr/local/cuda/include/cuda.h:9986:36: note: declared here __CUDA_DEPRECATED CUresult CUDAAPI cuParamSetv(CUfunction hfunc, int offset, void *ptr, unsigned int numbytes); ^~~~~~~~~~~ _cpyrit_cuda.c:207:5: warning: ‘cuParamSetSize’ is deprecated [-Wdeprecated-declarations] cuParamSetSize(self->kernel, offset); ^~~~~~~~~~~~~~ In file included from _cpyrit_cuda.h:22, from _cpyrit_cuda.c:44: /usr/local/cuda/include/cuda.h:9885:36: note: declared here __CUDA_DEPRECATED CUresult CUDAAPI cuParamSetSize(CUfunction hfunc, unsigned int numbytes); ^~~~~~~~~~~~~~ _cpyrit_cuda.c:208:5: warning: ‘cuLaunchGrid’ is deprecated [-Wdeprecated-declarations] CUSAFECALL(cuLaunchGrid(self->kernel, buffersize / THREADS_PER_BLOCK, 1)); ^~~~~~~~~~ In file included from _cpyrit_cuda.h:22, from _cpyrit_cuda.c:44: /usr/local/cuda/include/cuda.h:10062:36: note: declared here __CUDA_DEPRECATED CUresult CUDAAPI cuLaunchGrid(CUfunction f, int grid_width, int grid_height); ^~~~~~~~~~~~ creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/cpyrit x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-rHYsq1/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-rHYsq1/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/_cpyrit_cuda.o -lcrypto -lcuda -lz -o build/lib.linux-x86_64-2.7/cpyrit/_cpyrit_cuda.so running install running install_lib copying build/lib.linux-x86_64-2.7/cpyrit/_cpyrit_cuda.so -> /usr/local/lib/python2.7/dist-packages/cpyrit running install_egg_info Writing /usr/local/lib/python2.7/dist-packages/cpyrit_cuda-0.5.0.egg-info

but when i use pyrit list_cores, I can see my CUDA device..

darksty avatar Aug 30 '18 13:08 darksty

Hi, I have been trying to make pyrit find my GPU for the past 6 hours with no success can you please help me @Hackitfree

That's what I'm getting,

/usr/include/crt/common_functions.h:93:10: fatal error: 'new' file not found #include ^ 1 error generated. Traceback (most recent call last): File "setup.py", line 166, in setup(**setup_args) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "setup.py", line 91, in run subprocess.check_call(nvcc_cmd, shell=True) File "/usr/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'nvcc -m64 -ccbin clang-3.8 -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' returned non-zero exit status 1

Aldosari95 avatar Nov 14 '18 14:11 Aldosari95

@Aldosari95 try removing the arguments: -ccbin clang from modules/cpyrit_cuda/setup.py

vido89 avatar Nov 14 '18 15:11 vido89

@Aldosari95 or try this version

vido89 avatar Nov 14 '18 15:11 vido89