You are not logged in.

#1 2015-12-28 18:28:28

TarnaBar
Member
Registered: 2015-12-28
Posts: 7

Pyrit - Nvidia drivers - Cuda

I'm having a lilttle struggle using the graphics card power for pyrit.

I have  a Nvidia 9500GT on this desktop, it's like 5-6 years old. I have installed recently arch linux because I favor linux very much these days , and arch is one of the best I tried amogst others, it suits me.
But I can't seem to find a way to use this card with cuda & pyrit. My drivers are the "extra/nvidia-340xx 340.96-2.1 [installed]" - "extra/nvidia-340xx-libgl 340.96-1 [installed]" - "extra/nvidia-340xx-utils 340.96-1 [installed]" - "extra/opencl-nvidia-340xx 340.96-1 [installed]"  / I even installed the cuda package "community/cuda 7.5.18-1 [installed]"

The easiest way would be to install the nvidia package with the lastest drivers then the other pyrit dependencies, but If I install the lastest driver , my xorg will error out because nvidia doesn't support anymore my card with the new drivers so I must use the legacy one 340xx.
I miss this
"
blackarch/cpyrit-cuda 0.4.0-3
    Pyrit support for Nvidia-CUDA.
blackarch/cpyrit-opencl 0.4.0-2
    Pyrit support for Nvidia-CUDA.
"
blackarch repo packages , that are for sure the cause why my card is not recognized by "pyrit list-cores". Installing those conflicts with the 340xx drivers as they require the lastest nvidia ones.
Installing them from the pyrit website manually errors me out
"
  File "setup.py", line 88
    print "Building modules..."
                              ^
SyntaxError: Missing parentheses in call to 'print'
"
and I am pretty sure that I have all the required packages listed on their website.

Now what am I asking , is it possible to get my card working with pyrit and cuda by any means ? I am a little begginer in this field , but I study informatics and I am pretty fascinated by those kind of things.. I would appreciate any help you could bring up smile

Offline

#2 2015-12-28 19:50:29

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Pyrit - Nvidia drivers - Cuda

Apparently it's using python3 (/usr/bin/python) while it's a python2 script:

[tom@localhost ~]$ python
Python 3.5.1 (default, Dec  7 2015, 12:58:09) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Test"
  File "<stdin>", line 1
    print "Test"
               ^
SyntaxError: Missing parentheses in call to 'print'
>>> print("Test")
Test
>>> 
[tom@localhost ~]$ python2
Python 2.7.11 (default, Dec  6 2015, 15:43:46) 
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Test"
Test
>>> print("Test")
Test
>>> 
[tom@localhost ~]$ 

Offline

#3 2015-12-30 14:59:05

TarnaBar
Member
Registered: 2015-12-28
Posts: 7

Re: Pyrit - Nvidia drivers - Cuda

tom.ty89 wrote:

Apparently it's using python3 (/usr/bin/python) while it's a python2 script:

[tom@localhost ~]$ python
Python 3.5.1 (default, Dec  7 2015, 12:58:09) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Test"
  File "<stdin>", line 1
    print "Test"
               ^
SyntaxError: Missing parentheses in call to 'print'
>>> print("Test")
Test
>>> 
[tom@localhost ~]$ python2
Python 2.7.11 (default, Dec  6 2015, 15:43:46) 
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Test"
Test
>>> print("Test")
Test
>>> 
[tom@localhost ~]$ 

So i should downgrade my phyton to make it work ?

Offline

#4 2015-12-30 15:48:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,349

Re: Pyrit - Nvidia drivers - Cuda

TarnaBar wrote:

So i should downgrade my phyton to make it work ?

No!  Absolutely not.

Arch depends on Python to be Python3 and will fail spectacularly without it.   You can install Python2 alongside Python without problems.

You need to tell your program which Python to use.  You can do this by passing the program name as a parameter to python2.  Even better, find the program and look at the first line of the file.  If there is a "#!" followed by a path, change the path to not use python, but rather use python2.  Here I run a Pyhton3 program.  Then try to force it to run as a Python2 program (badly), then I show the shebang (#!) that tells the shell which interpreter to use.

 ewaller@turing ~/devel/python/Sieve [1]1008 %./sieve.py 100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
ewaller@turing ~/devel/python/Sieve 1009 %python2 sieve.py 100
  File "sieve.py", line 35
    print (count,end=" ")
                    ^
SyntaxError: invalid syntax
ewaller@turing ~/devel/python/Sieve [1]1010 %head -3 sieve.py
#! /usr/bin/python
"""
Implement a sieve of Eratosthenes
ewaller@turing ~/devel/python/Sieve 1011 %

Last edited by ewaller (2015-12-30 15:50:11)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2015-12-31 12:48:07

TarnaBar
Member
Registered: 2015-12-28
Posts: 7

Re: Pyrit - Nvidia drivers - Cuda

ewaller wrote:
TarnaBar wrote:

So i should downgrade my phyton to make it work ?

No!  Absolutely not.

Arch depends on Python to be Python3 and will fail spectacularly without it.   You can install Python2 alongside Python without problems.

You need to tell your program which Python to use.  You can do this by passing the program name as a parameter to python2.  Even better, find the program and look at the first line of the file.  If there is a "#!" followed by a path, change the path to not use python, but rather use python2.  Here I run a Pyhton3 program.  Then try to force it to run as a Python2 program (badly), then I show the shebang (#!) that tells the shell which interpreter to use.

 ewaller@turing ~/devel/python/Sieve [1]1008 %./sieve.py 100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
ewaller@turing ~/devel/python/Sieve 1009 %python2 sieve.py 100
  File "sieve.py", line 35
    print (count,end=" ")
                    ^
SyntaxError: invalid syntax
ewaller@turing ~/devel/python/Sieve [1]1010 %head -3 sieve.py
#! /usr/bin/python
"""
Implement a sieve of Eratosthenes
ewaller@turing ~/devel/python/Sieve 1011 %

Could you explain me better how to install and force python 2 for those scripts , step by step ? Its not so easy to understand at a first look .-.

Offline

#6 2015-12-31 16:39:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,349

Re: Pyrit - Nvidia drivers - Cuda

How do you start those scripts?  What are the names of the files of those scripts?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2015-12-31 17:13:14

TarnaBar
Member
Registered: 2015-12-28
Posts: 7

Re: Pyrit - Nvidia drivers - Cuda

ewaller wrote:

How do you start those scripts?  What are the names of the files of those scripts?

I basically must download these files https://code.google.com/p/pyrit/downloads/list then I must follow this guide https://code.google.com/p/pyrit/wiki/Installation to install them.

The files are called setup.py and I must do the following commands , python setup.py build -> python setup.py install (being in the downloaded and extracted folder of each packet.
But as you said it probably uses python3 and not 2 is it requires so explain me how to force that and the arch linux packet name for py2.

An interesting thing is the requirements of the README file , here it is:

CPyrit-OpenCL
+++++++++++++

A sub-package that adds OpenCL-capability to Pyrit. Please see the main README
for more information about Pyrit.

http://code.google.com/p/pyrit/



Requirements
++++++++++++

CPyrit-OpenCL compiles and runs on Linuxe and MacOS. Windows is not (and
probably never will be) supported; there are however some reports of successful
installations on Windows with the help of MinGW.

A couple of libraries and headers are required to build CPyrit-OpenCL:

  * Python >=2.5 and it's headers
    http://www.python.org
  * The OpenSSL library and headers
    http://www.openssl.org
  * The ZLib library and headers
    http://www.zlib.net
  * An OpenCL-implementing library and it's headers

Linux users running a binary distribution may need to install the development
packages for Python (e.g. python-devel), OpenSSL (e.g. openssl-devel or
libssl-dev) and ZLib (e.g. zlib-devel). You also need a C-compiler like gcc.
Users of MacOS probably only need to have XCode installed.

By default, setup.py looks into '/usr/local/opencl/OpenCL/common/inc',
'/opt/opencl/OpenCL/common/inc' and '/usr/local/opencl/include' to find the
OpenCL-headers. Modify setup.py if you have the include files installed
elsewhere.



Installing
++++++++++

Unpack the source-code into a new directory like this:

    tar xvzf cpyrit-opencl-0.4.0.tar.gz


Switch to the module's directory. We use Python's distutils to compile and
install the code:

    cd cpyrit-opencl-0.4.0
    python setup.py build


If everything went well and no errors are thrown at you, use distutils again to
install CPyrit-OpenCL:

    sudo python setup.py install


You should see your OpenCL-capable devices listed when executing
'pyrit list_cores'.



Reporting bugs / Getting help
+++++++++++++++++++++++++++++

Please take a look at the Troubleshooting-page in Pyrit's Wiki if you have
problems compiling or running Pyrit:

    http://code.google.com/p/pyrit/wiki/Troubleshooting
   
   
Please report bugs, glitches and enhancement proposals using Pyrit's issue-
tracker:
   
    http://code.google.com/p/pyrit/issues/list



License
+++++++

Pyrit is free software - free as in freedom. Everyone can inspect, copy or
modify it and share derived work under the GNU General Public License v3.
You should have received a copy of the GNU General Public License along with
Pyrit. If not, see <http://www.gnu.org/licenses/>.

// If you think i'm missing any of them tell me how to check if they are installed and install if I am missing some ( I know how to use basic pacman commands like "pacman -Ss python / pacman -Ss OpenSSL  but these dont help much , I must do some precise reseach of the database , like finding only the python program and its headers , instead these find and python packet related so I get a bit of a headache trying to see what I have or what I miss.

Thanks again and happy new year eh ^_^

Offline

#8 2016-01-07 21:18:26

TarnaBar
Member
Registered: 2015-12-28
Posts: 7

Re: Pyrit - Nvidia drivers - Cuda

After some days I really have found a solution, seems that
running these scripts as python 2 is as simple as : python2 setup.py build / install.
Tough the intallation of these didnt help me with using pyrit ( I belive my card isnt supported anymore by the nvidia drivers itself ) I have to thank anyone for answering ^_^

Offline

Board footer

Powered by FluxBB