uayazzz / pyrit

Automatically exported from code.google.com/p/pyrit
0 stars 0 forks source link

/usr/bin/ld: cannot find -lOpenCL #230

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The downloaded files was copied to /usr/local
cm:/usr/local# aptitude install pyrit
Selecting previously deselected package pyrit.
(Reading database ... 188506 files and directories currently installed.)
Unpacking pyrit (from .../pyrit_0.3.0-2_amd64.deb) ...
Processing triggers for man-db ...
Setting up pyrit (0.3.0-2) ...
Processing triggers for python-support ...
2.
cm:/usr/local# svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn
...
3.
cm:/usr/local# tar xvzf ati-stream-sdk-v2.3-lnx64.tgz 
...
4.
cm:/usr/local# mv ati-stream-sdk-v2.3-lnx64 opencl
cm:/usr/local# export ATISTREAMSDKROOT=/usr/local/opencl
cm:/usr/local# export ATISTREAMSDKSAMPLESROOT=/usr/local/opencl
cm:/usr/local# export 
LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86_64:$LD_LIBRARY_PATH
cm:/usr/local# cd /
cm:/# tar xfz icd-registration.tgz
tar (child): icd-registration.tgz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
cm:/# cp /usr/local/opencl/icd-registration.tgz .
cm:/# tar xfz icd-registration.tgz
5.
cm:/# cd /usr/local/opencl/samples/opencl/bin/x86_64/
cm:/usr/local/opencl/samples/opencl/bin/x86_64# ./HelloCL
HelloCL!
Getting Platform Information
No protocol specified
Creating a context AMD platform
Getting device info
Loading and compiling CL source
Running CL program
Done
Passed!
6.
cm:/usr/local/opencl/samples/opencl/bin/x86_64# cd /usr/local
cm:/usr/local/# cd cpyrit-opencl-0.3.0
cm:/usr/local/cpyrit-opencl-0.3.0# ls
COPYING           _cpyrit_opencl.c  PKG-INFO  setup.py
_cpyrit_oclkernel.cl  _cpyrit_opencl.h  README
cm:/usr/local/cpyrit-opencl-0.3.0# python setup.py build
svn: '.' is not a working copy
running build
running build_ext
Building modules...
building 'cpyrit._cpyrit_opencl' extension
creating build
creating build/temp.linux-x86_64-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/opencl/include -I/usr/include/python2.6 
-c _cpyrit_opencl.c -o build/temp.linux-x86_64-2.6/_cpyrit_opencl.o 
-DVERSION="0.3.0"
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/cpyrit
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-2.6/_cpyrit_opencl.o -lssl -lOpenCL -lz -o 
build/lib.linux-x86_64-2.6/cpyrit/_cpyrit_opencl.so
/usr/bin/ld: cannot find -lOpenCL
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
cm:/usr/local/cpyrit-opencl-0.3.0# 

cm:/usr/local/cpyrit-opencl-0.3.0# 
cm:/# cd usr/local
cm:/usr/local# tar xvzf cpyrit-opencl-0.3.0.tar.gz
...
cm:/usr/local# cd cpyrit-opencl-0.3.0
cm:/usr/local/cpyrit-opencl-0.3.0# python setup.py build
svn: '.' is not a working copy
running build
running build_ext
Building modules...
building 'cpyrit._cpyrit_opencl' extension
creating build
creating build/temp.linux-x86_64-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/opencl/include -I/usr/include/python2.6 
-c _cpyrit_opencl.c -o build/temp.linux-x86_64-2.6/_cpyrit_opencl.o 
-DVERSION="0.3.0"
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/cpyrit
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-2.6/_cpyrit_opencl.o -lssl -lOpenCL -lz -o 
build/lib.linux-x86_64-2.6/cpyrit/_cpyrit_opencl.so
/usr/bin/ld: cannot find -lOpenCL
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
7.
cm:/usr/local/cpyrit-opencl-0.3.0# chown root:root /usr/local/opencl
cm:/usr/local/cpyrit-opencl-0.3.0# ln -s 
/usr/local/opencl/lib/x86_64/libOpenCL.so /usr/lib/libOpenCL.so
cm:/usr/local/cpyrit-opencl-0.3.0# python setup.py buildsvn: '.' is not a 
working copy
running build
running build_ext
Building modules...
cm:/usr/local/cpyrit-opencl-0.3.0# sudo python setup.py install
svn: '.' is not a working copy
running install
running build
running build_ext
Building modules...
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.6/dist-packages/cpyrit_opencl-0.3.0.egg-info
Writing /usr/local/lib/python2.6/dist-packages/cpyrit_opencl-0.3.0.egg-info
cm:/usr/local/cpyrit-opencl-0.3.0# pyrit list_cores
Pyrit 0.3.0 (C) 2008-2010 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

The following cores seem available...
#1:  'CPU-Core (SSE2)'
#2:  'CPU-Core (SSE2)'
#3:  'CPU-Core (SSE2)'
#4:  'CPU-Core (SSE2)'
#5:  'Network-Clients'

What is the expected output? What do you see instead?
I don't see GPU-Cores

cm:/usr/local/cpyrit-opencl-0.3.0# pyrit list_cores
Pyrit 0.3.0 (C) 2008-2010 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

The following cores seem available...
#1:  'CPU-Core (SSE2)'
#2:  'CPU-Core (SSE2)'
#3:  'CPU-Core (SSE2)'
#4:  'CPU-Core (SSE2)'
#5:  'Network-Clients'

What version of the product are you using? On what operating system?
I'm using Debian Squeeze
cm:/# uname -a
Linux cm 2.6.32-5-amd64 #1 SMP Fri Dec 10 15:35:08 UTC 2010 x86_64 GNU/Linux
cm:/# lspci |grep VGA
01:00.0 VGA compatible controller: ATI Technologies Inc RV730XT [Radeon HD 4670]
I have installed and working "ati-driver-installer-10-12-x86.x86_64.run"

Please provide any additional information below.

cm:/usr/local/cpyrit-opencl-0.3.0# python -c 'from cpyrit import _cpyrit_opencl'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name _cpyrit_opencl

cm:/usr/local/cpyrit-opencl-0.3.0# pyrit benchmark
Pyrit 0.3.0 (C) 2008-2010 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

Running benchmark (4031.3 PMKs/s)... / 

Computed 4080.98 PMKs/s total.
#1: 'CPU-Core (SSE2)': 968.9 PMKs/s (RTT 2.8)
#2: 'CPU-Core (SSE2)': 978.3 PMKs/s (RTT 3.0)
#3: 'CPU-Core (SSE2)': 977.2 PMKs/s (RTT 3.0)
#4: 'CPU-Core (SSE2)': 964.4 PMKs/s (RTT 3.0)
#5: 'Network-Clients': 0.0 PMKs/s (RTT 0.0)

Original issue reported on code.google.com by GersonH...@gmail.com on 2 Jan 2011 at 12:30

GoogleCodeExporter commented 8 years ago
i can't really tell what you are doing with all this. You are on some 
debian-based system and installing from apt, then checking out the development 
version from svn but not using it.

The point seems to be that in your step 7 you symlink the opencl-library, but 
in point 6 setup.py already complained about missing libopencl ("/usr/bin/ld: 
cannot find -lOpenCL"). Try rebuilding and installing the opencl-module now 
that libopencl can be found.

"svn: '.' is not a working copy" is just a warning that the directory you are 
building from has not subversion-files in it. This can be ignored if you are 
installing from packed tarballs.

Original comment by lukas.l...@gmail.com on 2 Jan 2011 at 12:38

GoogleCodeExporter commented 8 years ago
Ok! It's works.

But I think the controller (ATI Technologies Inc RV730XT [Radeon HD 4670]) do 
not performance well. :(

$ pyrit benchmark
Pyrit 0.3.0 (C) 2008-2010 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

Running benchmark (1379.4 PMKs/s)... \ 

Computed 1379.39 PMKs/s total.
#1: 'OpenCL-Device 'ATI RV730'': 770.3 PMKs/s (RTT 2.7)
#2: 'CPU-Core (SSE2)': 291.6 PMKs/s (RTT 2.9)
#3: 'CPU-Core (SSE2)': 269.9 PMKs/s (RTT 3.7)
#4: 'CPU-Core (SSE2)': 290.0 PMKs/s (RTT 3.1)

Any other thing to do?

Tanks.

Original comment by GersonH...@gmail.com on 2 Jan 2011 at 2:07

GoogleCodeExporter commented 8 years ago
closed

you may try the calpp-plugin which is in 0.4.0-dev - it gives better 
performance on ati cards

Original comment by lukas.l...@gmail.com on 2 Jan 2011 at 7:28