Bitcoin Forum

Other => Beginners & Help => Topic started by: acidblue on June 16, 2011, 09:32:51 PM



Title: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 16, 2011, 09:32:51 PM

 
Code:
Traceback (most recent call last):
  File "poclbm.py", line 3, in <module>
    import pyopencl as cl
  File "/usr/lib/pymodules/python2.6/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory

I'm on Ubuntu 10.10 x86_64 using a NVidia 8400GS
I followed this giude: http://forum.bitcoin.org/index.php?topic=2636.0
I would post my question in that forum but being new I have to post here instead.

Everything installed fine, but when I try to run the Miner I get the above error.
Not sure why I'm getting that error.

Can anyone give me a clue?


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: cynikal on June 16, 2011, 09:50:34 PM

 
Code:
Traceback (most recent call last):
  File "poclbm.py", line 3, in <module>
    import pyopencl as cl
  File "/usr/lib/pymodules/python2.6/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory

I'm on Ubuntu 10.10 x86_64 using a NVidia 8400GS
I followed this giude: http://forum.bitcoin.org/index.php?topic=2636.0
I would post my question in that forum but being new I have to post here instead.

Everything installed fine, but when I try to run the Miner I get the above error.
Not sure why I'm getting that error.

Can anyone give me a clue?

for starters, look at the pyopencl.py file, see what the binary it imports is, and ldd that (you should be able to see what libraries it's dynamicaly linked against, and you'll likely see 'not found' for the opencl one.. then to work-around that, set your LD_LIBRARY_PATH environment variable containing the directory that libOpenCL.so.1 directory.. if you want to fix it more permanently, you'll need to re-compile pyopencl and this time specify a rpath (which hardcodes a path to the library) containing the dir libOpenCL.so is in


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: mjoz on June 16, 2011, 10:14:36 PM

 
Code:
Traceback (most recent call last):
  File "poclbm.py", line 3, in <module>
    import pyopencl as cl
  File "/usr/lib/pymodules/python2.6/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory

I'm on Ubuntu 10.10 x86_64 using a NVidia 8400GS
I followed this giude: http://forum.bitcoin.org/index.php?topic=2636.0
I would post my question in that forum but being new I have to post here instead.

Everything installed fine, but when I try to run the Miner I get the above error.
Not sure why I'm getting that error.

Can anyone give me a clue?

I think the problem here is you're mining with an Nvidia 8400.  Does it take 4 months to generate a bitcoin?


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 16, 2011, 10:56:31 PM
Where would I find pyopencl.py?
I looked in /usr/lib/pymodules/python2.6/pyopencl
Didn't see it.


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: hacker on June 16, 2011, 11:05:56 PM
Looks like OpenCL is not installed or installed incorrectly, try running this and paste the result: -

Code:
sudo apt-get install python-pyopencl


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: cynikal on June 16, 2011, 11:07:07 PM
Where would I find pyopencl.py?
I looked in /usr/lib/pymodules/python2.6/pyopencl
Didn't see it.

sorry, it might also be called __init__.py if it's within in the pyopencl directory too.. check in there what opencl related modules it imports, chances are one of them is binary, run ldd on that file..

also you probably want to start look where libOpenCL.so* is your filesystem


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 16, 2011, 11:18:43 PM
Code:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python-pyopencl is already the newest version.
The following packages were automatically installed and are no longer required:
  mesa-utils python-wxgtk2.8 libglew1.5 zlib-bin freedroid-data
  python-wxversion
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

It appears pyopencl is installed.

The file in question is in fact called _init_.py
This is what it imports:
import pyopencl._cl as _cl
from pyopencl._cl import *
import inspect as _inspect

Running ldd on pyopen_.cl gives "no such file or directory".


Doing whereis libOpenCL.so* gives me :
/usr/lib/libOpenCL.so /usr/lib64/libOpenCL.so

How do I set the LD_LIBRARY_PATH environment variable ?





Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: hacker on June 17, 2011, 12:01:22 AM
Code:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python-pyopencl is already the newest version.
The following packages were automatically installed and are no longer required:
  mesa-utils python-wxgtk2.8 libglew1.5 zlib-bin freedroid-data
  python-wxversion
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

It appears pyopencl is installed.

The file in question is in fact called _init_.py
This is what it imports:
import pyopencl._cl as _cl
from pyopencl._cl import *
import inspect as _inspect

Running ldd on pyopen_.cl gives "no such file or directory".


Doing whereis libOpenCL.so* gives me :
/usr/lib/libOpenCL.so /usr/lib64/libOpenCL.so

How do I set the LD_LIBRARY_PATH environment variable ?


Code:
export LD_LIBRARY_PATH=/usr/lib64/;${LD_LIBRARY_PATH}


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 17, 2011, 12:06:12 AM
Thanks.  ;D
But I'm still getting the same error.
Code:
Traceback (most recent call last):
  File "poclbm.py", line 3, in <module>
    import pyopencl as cl
  File "/usr/lib/pymodules/python2.6/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory



Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: hacker on June 17, 2011, 12:10:22 AM
Make sure its in the current directory from where you are calling
Code:
python poclbm.py

Code:
find /home -name "poclbm.py" | cd
Will find and put you in the right directory.


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 17, 2011, 12:11:35 AM
DOH!
Edited last post.


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: hacker on June 17, 2011, 12:18:25 AM
Thanks.  ;D
But I'm still getting the same error.
Code:
Traceback (most recent call last):
  File "poclbm.py", line 3, in <module>
    import pyopencl as cl
  File "/usr/lib/pymodules/python2.6/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory



Lets give these a shot: -

Code:
sudo ln -s /usr/lib/libOpenCL.so /usr/lib/libOpenCL.so.1
sudo ln -s /usr/lib64/libOpenCL.so /usr/lib64/libOpenCL.so.1


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 17, 2011, 12:27:29 AM
Ok making some progress. After doing sym links and trying again I'm now getting a different error.

Code:
Traceback (most recent call last):
  File "poclbm.py", line 5, in <module>
    from BitcoinMiner import *
  File "/home/rocko/BitcoinMiner.py", line 8, in <module>
    from sha256 import *
ImportError: No module named sha256




Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: hacker on June 17, 2011, 12:29:24 AM
Ok making some progress. After doing sym links and trying again I'm now getting a different error.

Code:
Traceback (most recent call last):
  File "poclbm.py", line 5, in <module>
    from BitcoinMiner import *
  File "/home/rocko/BitcoinMiner.py", line 8, in <module>
    from sha256 import *
ImportError: No module named sha256




Code:
wget --no-check-certificate https://github.com/m0mchil/poclbm/raw/master/sha256.py


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 17, 2011, 12:37:27 AM
Damn this is getting to be a pain.
BTW thanks for the help, but now getting a Logic error.

Code:
Traceback (most recent call last):
  File "poclbm.py", line 27, in <module>
    platforms = cl.get_platforms()
pyopencl.LogicError: clGetPlatformIDs failed: invalid/unknown error code
rocko@nova:~$ python poclbm.py -d 0 --user un --pass pwTraceback (most recent call last):
  File "poclbm.py", line 27, in <module>
    platforms = cl.get_platforms()
pyopencl.LogicError: clGetPlatformIDs failed: invalid/unknown error code


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: hacker on June 17, 2011, 01:00:34 AM
Damn this is getting to be a pain.
BTW thanks for the help, but now getting a Logic error.

Code:
Traceback (most recent call last):
  File "poclbm.py", line 27, in <module>
    platforms = cl.get_platforms()
pyopencl.LogicError: clGetPlatformIDs failed: invalid/unknown error code
rocko@nova:~$ python poclbm.py -d 0 --user un --pass pwTraceback (most recent call last):
  File "poclbm.py", line 27, in <module>
    platforms = cl.get_platforms()
pyopencl.LogicError: clGetPlatformIDs failed: invalid/unknown error code


OpenCL seems to be returning a code that pyopencl doesn't like, I'm a bit stumped here but it feels like a driver issue.

This is a lot of effort for the 2Mh/s you'll get out of this card.


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: acidblue on June 17, 2011, 01:51:48 AM
Quote
This is a lot of effort for the 2Mh/s you'll get out of this card.

I agree, just wanted too see if I can get this to work.


Title: Re: Python OpenCL Miner on Ubuntu not running.
Post by: ewibit on June 18, 2011, 10:07:05 PM
Code:
[quote author=hacker link=topic=18058.msg229944#msg229944 date=1308272434]

pyopencl.LogicError: clGetPlatformIDs failed: invalid/unknown error code

[/quote]

Hi@all
I have had the same error after trying for now 2 days on now Ubuntu Lucid
now I have this:
-------------------
./poclbm.py
X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  136 ()
  Minor opcode of failed request:  19
  Serial number of failed request:  8
  Current serial number in output stream:  8
-------------------
any hints?
TIA  :)