Bitcoin Forum
September 30, 2016, 08:20:53 AM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 »
  Print  
Author Topic: python OpenCL bitcoin miner  (Read 1193122 times)
ribuck
Donator
Legendary
*
Offline Offline

Activity: 826


View Profile
February 07, 2011, 04:55:39 PM
 #401

OpenCL HOWTO FOR FEDORA 14 LINUX

Here are some notes which may be useful to anyone who wishes to mine for bitcoins on Fedora 14 Linux. It's simpler than the instructions I posted for Fedora 12, because Bitcoin now supports the 'getwork' call and therefore doesn't need to be recompiled.

===

Check your software versions, and upgrade as necessary. The gcc compiler needs to be 4.x (for PyOpenCL), and Python needs to be 2.4 or newer (again, for PyOpenCL), but not Python 3.x.

Code:
$ gcc --version
gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)

$ python --version
Python 2.7

You need to have either the full kernel source, or the kernel headers (because the ATI GPU driver is installed by compiling a kernel module). You also need the Python headers.

Code:
$ rpm -q kernel-devel
kernel-devel-2.6.35.10-74.fc14.x86_64

$ rpm -q python-devel
python-devel-2.7-8.fc14.1.x86_64

===

Update your display driver.

I followed the instructions from here:
http://gofedora.com/how-to-install-ati-catalyst-fglrx-98-drivers-fedora-11/
except that I used the version 11.1 11.2 of the ATI Catalyst Display Driver for Linux x86 from here:
http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx?type=2.4.1&product=2.4.1.3.42&lang=English

Supposedly some of the installation steps are no longer needed with version 11.1, but I wasn't completely certain which ones, so I did them all anyway.

===

Get the ATI Stream SDK v2.1 (NOT any later version, according to brocktice), from here: http://developer.amd.com/gpu/ATIStreamSDK/pages/ATIStreamSDK-Archive.aspx

You need two downloads from that page: the Linux SDK (32-bit or 64-bit according to your version of Linux), plus icd-registration.tgz

Untar the SDK anywhere convenient. Add these lines to your .bash_profile file (in your login directory):

Code:
export ATISTREAMSDKSAMPLESROOT=...<some path>.../ati-stream-sdk-v2.1-lnx64
export ATISTREAMSDKROOT=...<some path>.../ati-stream-sdk-v2.1-lnx64
export LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86_64:$LD_LIBRARY_PATH

These pathnames will vary slightly if you have a 32-bit Fedora installation.

Move icd-registration.tgz into your root directory and (as root) untar it from there. It puts some essential config files into /etc.

If you like, follow the documentation that is included in the SDK to compile the examples. Execute ati-stream-sdk-v2.1-lnx64/samples/opencl/bin/x86_64/CLInfo to check that things are working and that your GPU card is detected.

===

Install the Python OpenCL module (PyOpenCL). Broadly, follow the instructions here:
http://wiki.tiker.net/PyOpenCL/Installation/Linux

However, in step 2 I couldn't install the Numpy dependency this way. Instead I ran "System | Administration | Add/Remove Software", then searched for numpy and installed it.

In step 3, the OpenCL headers and libraries weren't found, so I had to use the longer configure.py example and provide explicit paths.

I don't think the "Boost C++" libraries are required for this version of PyOpenCL.

===

Install the JSON-RPC module for Python. This was straightforward using the instructions here:
http://json-rpc.org/wiki/python-json-rpc

===

Go to m0mchil's Git repository:
https://github.com/m0mchil/poclbm

Click the "Download" button. Download and unpack these files anywhere convenient. Change poclbm.py to executable and check that it's working:

Code:
chmod 744 poclbm.py
./poclbm.py --help

===

If you don't already have a file bitcoin.conf in your ~/.bitcoin directory, create one and put a username and password in it:

Code:
rpcuser=yourusername
rpcpassword=yourpassword

Go back to the bitcoin/bin/64 directory and start bitcoin in rpc server mode:

Code:
./bitcoin -server &

Go to the directory where you built poclbm.py and run it:

Code:
./poclbm.py --user=yourusername --pass=yourpassword

It will tell you which devices it can see. Choose the one that's not your CPU, and add that one to the command line with the "-d" switch:

Code:
./poclbm.py --user=yourusername --pass=yourpassword -d1

Watch the khash/s figures with sweet delight, and enjoy the few moments before the roar of your GPU fan starts up.

Many thanks to m0mchil and the many others who have offered code or helpful tips.

(PS: If you upgrade your kernel, the ATI driver might hang on startup. If this happens, boot into runlevel 3, delete /etc/X11/xorg.conf , reboot and reinstall the ATI driver.)
1475223653
Hero Member
*
Offline Offline

Posts: 1475223653

View Profile Personal Message (Offline)

Ignore
1475223653
Reply with quote  #2

1475223653
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1475223653
Hero Member
*
Offline Offline

Posts: 1475223653

View Profile Personal Message (Offline)

Ignore
1475223653
Reply with quote  #2

1475223653
Report to moderator
1475223653
Hero Member
*
Offline Offline

Posts: 1475223653

View Profile Personal Message (Offline)

Ignore
1475223653
Reply with quote  #2

1475223653
Report to moderator
1475223653
Hero Member
*
Offline Offline

Posts: 1475223653

View Profile Personal Message (Offline)

Ignore
1475223653
Reply with quote  #2

1475223653
Report to moderator
Cablesaurus
Sr. Member
****
Offline Offline

Activity: 302



View Profile WWW
February 07, 2011, 09:32:04 PM
 #402

What is the -askrate flag doing? How does it help if set to something non-default? thanks for any input.

PCIe Extender Cables; Dummy Plugs, Fans; PSU Cables; Cases & More
Visit www.Cablesaurus.com and our forum thread at http://bitcointalk.org/index.php?topic=6128.0
TheKoziTwo
Legendary
*
Offline Offline

Activity: 1442



View Profile
February 08, 2011, 01:38:47 AM
 #403

I just get 3500 khash/s

--device=0 -f 5 -v -w 128 (tried different combinations like f 30 and w 256 etc)

What am I doing wrong?


Cryptoman
Hero Member
*****
Offline Offline

Activity: 728



View Profile
February 08, 2011, 02:32:50 AM
 #404

I just get 3500 khash/s

--device=0 -f 5 -v -w 128 (tried different combinations like f 30 and w 256 etc)

What am I doing wrong?

Device 0 is your CPU, most likely.  Try device=1 or start the miner with no options and it will list the devices.

"A small body of determined spirits fired by an unquenchable faith in their mission can alter the course of history." --Gandhi
Cablesaurus
Sr. Member
****
Offline Offline

Activity: 302



View Profile WWW
February 08, 2011, 08:34:44 AM
 #405

Is anyone else having trouble, with not finding any blocks at all with the last 2 versions of this miner post 2/1/11?

I've mined for well over 5 or 6 days with nothing and I'm running about 630khash between the 2 cores on my 5970. I'm just using -v -w 128 -f 120........... I haven't found a block in what seems like far too long.

PCIe Extender Cables; Dummy Plugs, Fans; PSU Cables; Cases & More
Visit www.Cablesaurus.com and our forum thread at http://bitcointalk.org/index.php?topic=6128.0
jakakxl
Newbie
*
Offline Offline

Activity: 18


View Profile
February 08, 2011, 10:08:33 AM
 #406

Hello, I currently have 2x6950 in crossfire, i7 2600k, 11.1a drivers, ATi Stream 2.3.

When I try to run it with the following parems:
poclbm.exe --user=x --pass=y --host=http://mining.bitcoin.cz:8332 -d 0

  •      Cayman
  • [1]     Cayman
    [2]            Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz

    It gives me this error:

    InvalidURL: nonnumeric port: ''
    Unexpected error:
    Traceback (most recent call last):
      File "BitcoinMiner.pyc", line 171, in mine
      File "BitcoinMiner.pyc", line 157, in getwork
      File "jsonrpc\proxy.pyc", line 42, in __call__
      File "urllib.pyc", line 89, in urlopen
      File "urllib.pyc", line 208, in open
      File "urllib.pyc", line 334, in open_http
      File "httplib.pyc", line 1008, in __init__
      File "httplib.pyc", line 656, in __init__
      File "httplib.pyc", line 673, in _set_hostport

    Any help? Thanks!
DarkMatter
Member
**
Offline Offline

Activity: 86


Stop breeding! Save the Earth! www.vhemt.org


View Profile WWW
February 08, 2011, 12:23:15 PM
 #407

Hello, I currently have 2x6950 in crossfire, i7 2600k, 11.1a drivers, ATi Stream 2.3.

When I try to run it with the following parems:
poclbm.exe --user=x --pass=y --host=http://mining.bitcoin.cz:8332 -d 0

  •      Cayman
  • [1]     Cayman
    [2]            Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz

    It gives me this error:

    InvalidURL: nonnumeric port: ''
    Unexpected error:
    Traceback (most recent call last):
      File "BitcoinMiner.pyc", line 171, in mine
      File "BitcoinMiner.pyc", line 157, in getwork
      File "jsonrpc\proxy.pyc", line 42, in __call__
      File "urllib.pyc", line 89, in urlopen
      File "urllib.pyc", line 208, in open
      File "urllib.pyc", line 334, in open_http
      File "httplib.pyc", line 1008, in __init__
      File "httplib.pyc", line 656, in __init__
      File "httplib.pyc", line 673, in _set_hostport

    Any help? Thanks!
Hi,
get rid of "http://:8332" from the host line, and put the port number after the "--port=" switch.

Feed The Troll!! | 1JKdTyUjxo5VJoaQKjp4oUnXqdSSErC1mp
TheKoziTwo
Legendary
*
Offline Offline

Activity: 1442



View Profile
February 08, 2011, 12:28:49 PM
 #408

I just get 3500 khash/s

--device=0 -f 5 -v -w 128 (tried different combinations like f 30 and w 256 etc)

What am I doing wrong?

Device 0 is your CPU, most likely.  Try device=1 or start the miner with no options and it will list the devices.
You're right, I see now, the only options I have is:
Code:
[0] Intel(R) Core(TM) i7 CPU 920 @ 2.67 GHz
But no GPU? Why is that?

DarkMatter
Member
**
Offline Offline

Activity: 86


Stop breeding! Save the Earth! www.vhemt.org


View Profile WWW
February 08, 2011, 12:33:33 PM
 #409

I just get 3500 khash/s

--device=0 -f 5 -v -w 128 (tried different combinations like f 30 and w 256 etc)

What am I doing wrong?

Device 0 is your CPU, most likely.  Try device=1 or start the miner with no options and it will list the devices.
You're right, I see now, the only options I have is:
Code:
[0] Intel(R) Core(TM) i7 CPU 920 @ 2.67 GHz
But no GPU? Why is that?

My fault, didn't notice Smiley
I read somewhere that you should use ati stream 2.1 or 2.2, not the latest one.

Feed The Troll!! | 1JKdTyUjxo5VJoaQKjp4oUnXqdSSErC1mp
TheKoziTwo
Legendary
*
Offline Offline

Activity: 1442



View Profile
February 08, 2011, 12:52:47 PM
 #410

Weird, I just tried 2.2, but same result.

bitcool
Legendary
*
Offline Offline

Activity: 1441

Live and enjoy experiments


View Profile
February 08, 2011, 03:58:12 PM
 #411

Weird, I just tried 2.2, but same result.

wierd, so your GPU Caps viewer sees the card but poclbm.exe can't.  I remember read from somewhere you can't run this remotely via RDP, the driver won't load in a RDP session.
jakakxl
Newbie
*
Offline Offline

Activity: 18


View Profile
February 08, 2011, 08:42:28 PM
 #412

Hello, I currently have 2x6950 in crossfire, i7 2600k, 11.1a drivers, ATi Stream 2.3.

When I try to run it with the following parems:
poclbm.exe --user=x --pass=y --host=http://mining.bitcoin.cz:8332 -d 0

  •      Cayman
  • [1]     Cayman
    [2]            Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz

    It gives me this error:

    InvalidURL: nonnumeric port: ''
    Unexpected error:
    Traceback (most recent call last):
      File "BitcoinMiner.pyc", line 171, in mine
      File "BitcoinMiner.pyc", line 157, in getwork
      File "jsonrpc\proxy.pyc", line 42, in __call__
      File "urllib.pyc", line 89, in urlopen
      File "urllib.pyc", line 208, in open
      File "urllib.pyc", line 334, in open_http
      File "httplib.pyc", line 1008, in __init__
      File "httplib.pyc", line 656, in __init__
      File "httplib.pyc", line 673, in _set_hostport

    Any help? Thanks!
Hi,
get rid of "http://:8332" from the host line, and put the port number after the "--port=" switch.

Thank you, it works!
jakakxl
Newbie
*
Offline Offline

Activity: 18


View Profile
February 08, 2011, 08:49:50 PM
 #413

Hello, I currently have 2x6950 in crossfire, i7 2600k, 11.1a drivers, ATi Stream 2.3.

When I try to run it with the following parems:
poclbm.exe --user=x --pass=y --host=http://mining.bitcoin.cz:8332 -d 0

  •      Cayman
  • [1]     Cayman
    [2]            Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz

    It gives me this error:

    InvalidURL: nonnumeric port: ''
    Unexpected error:
    Traceback (most recent call last):
      File "BitcoinMiner.pyc", line 171, in mine
      File "BitcoinMiner.pyc", line 157, in getwork
      File "jsonrpc\proxy.pyc", line 42, in __call__
      File "urllib.pyc", line 89, in urlopen
      File "urllib.pyc", line 208, in open
      File "urllib.pyc", line 334, in open_http
      File "httplib.pyc", line 1008, in __init__
      File "httplib.pyc", line 656, in __init__
      File "httplib.pyc", line 673, in _set_hostport

    Any help? Thanks!
Hi,
get rid of "http://:8332" from the host line, and put the port number after the "--port=" switch.

Thank you so much!

Anyone got 6950/6970 w/ any recommended settings? Any results?
t3h
Newbie
*
Offline Offline

Activity: 19


View Profile
February 09, 2011, 05:18:54 AM
 #414

Got it running on OS X.

Install MacPorts if you haven't already,
sudo port -dv install py26-pyopencl
and install the json rpc library.

Speed isn't great though - only about 4700khashes/sec on an i7 MBP's GT330M. 2700khashes/sec on the CPU (about right I think).
dishwara
Legendary
*
Offline Offline

Activity: 1358


Truth may get delay, but NEVER fails


View Profile
February 09, 2011, 09:04:08 AM
 #415

Here's what I've observed with a 5970 and now a 5870 as well.  Hope it helps someone.  First and foremost, a few posts back someone noted to use the "Known Best Settings".  I added the -f5 switch and I went from about 560Mhash/sec to consistently over 600Mhash/sec on the 5970 alone. 

Next, the first post in this thread says . . .
"5970 is actually two 5870s with internal crossfire. OpenCL doesn't work with crossfire. It must be switched off. You can't switch it off on Windows. For now, 5970 can be used fully on Linux only."
I have used the 5970 for over a month on Windows 7 and get results from both cores, about 300Mhash/sec each.  So I don't know what that comment is all about.

Next, I finally was happy with my results with the 5970 and I can never leave well enough alone.  So I bought a 5870 tonight and threw that into my motherboard as well.  At first I was getting "Disabled Adapter" in Catalyst Control Center, although I could see the third GPU (now as GPU #1) in MSI Afterburner.  It did nothing and just sat there very cool.  poblcm only recognized the two 5970 cores and the CPU.  After looking at posts on Google as far back as 2008, someone said, "Plug in another monitor".  Not having another monitor, I plugged in my monitor to the 5870 instead.  Now, the 5870 GPU was the only core recognized by poblcm along with the CPU.  So I ran poblcm with a device=1 and it worked!  Then I unplugged the monitor from the 5870 and replugged it into the 5970.  Now, even though the 5870 was the disabled adapter again, poblcm was still running on the 5870.  Then I ran poblcm again on device=1 and device=0 and both of the 5970 cores were running alongside the 5870, for a total of about 875Mhash/sec.  Pretty good.  So that's just FYI for anyone running multiple 5870's, 5970's or combinations thereof.  I wish there was a way to get Catalyst Control Center, or ATI Stream, or whatever ATI driver it is to enumerate all three cores so I would not have to unplug and replug the monitor into different cards every time I want to run poblcm on the 5870 and 5970 at the same time.  I would suspect this would be a similar problem, and a similar solution, for running poblcm on  two 5970's on Windows.


For 2 monitor needed, instead of plugging & unplugging, why don't use 2 cords?
I have samsung lcd monitor & it has 2 connectors, vga & DVI.
I think 2 graphics cards can be connected to 1 monitor with vga & DVI port, so u don't have to unplug & plug.
Just a thought, i don't have 2 graphics card, so if anyone have, please check & reply.
Thanks.
rmartins
Newbie
*
Offline Offline

Activity: 6


View Profile
February 09, 2011, 11:19:48 AM
 #416

Anyone got 6950/6970 w/ any recommended settings? Any results?

I have a 6950 with unlocked shaders (not a 6970 bios) and I get about 253 Mhash/s at the default clocks with -f 5 -w 256. I'm currently running it at 880 core / 1300 memory, with -f 5 -w 128 -v, which gives me about 282 Mhash/s. I'm using the 10.12 driver and SDK 2.3.

13qEUok3N4yEpfmDZdqmVJ8FbsL5hMAUGf
dingus
Full Member
***
Offline Offline

Activity: 126



View Profile
February 09, 2011, 06:55:16 PM
 #417

Here's what I've observed with a 5970 and now a 5870 as well.  Hope it helps someone.  First and foremost, a few posts back someone noted to use the "Known Best Settings".  I added the -f5 switch and I went from about 560Mhash/sec to consistently over 600Mhash/sec on the 5970 alone. 

Next, the first post in this thread says . . .
"5970 is actually two 5870s with internal crossfire. OpenCL doesn't work with crossfire. It must be switched off. You can't switch it off on Windows. For now, 5970 can be used fully on Linux only."
I have used the 5970 for over a month on Windows 7 and get results from both cores, about 300Mhash/sec each.  So I don't know what that comment is all about.

Next, I finally was happy with my results with the 5970 and I can never leave well enough alone.  So I bought a 5870 tonight and threw that into my motherboard as well.  At first I was getting "Disabled Adapter" in Catalyst Control Center, although I could see the third GPU (now as GPU #1) in MSI Afterburner.  It did nothing and just sat there very cool.  poblcm only recognized the two 5970 cores and the CPU.  After looking at posts on Google as far back as 2008, someone said, "Plug in another monitor".  Not having another monitor, I plugged in my monitor to the 5870 instead.  Now, the 5870 GPU was the only core recognized by poblcm along with the CPU.  So I ran poblcm with a device=1 and it worked!  Then I unplugged the monitor from the 5870 and replugged it into the 5970.  Now, even though the 5870 was the disabled adapter again, poblcm was still running on the 5870.  Then I ran poblcm again on device=1 and device=0 and both of the 5970 cores were running alongside the 5870, for a total of about 875Mhash/sec.  Pretty good.  So that's just FYI for anyone running multiple 5870's, 5970's or combinations thereof.  I wish there was a way to get Catalyst Control Center, or ATI Stream, or whatever ATI driver it is to enumerate all three cores so I would not have to unplug and replug the monitor into different cards every time I want to run poblcm on the 5870 and 5970 at the same time.  I would suspect this would be a similar problem, and a similar solution, for running poblcm on  two 5970's on Windows.


For 2 monitor needed, instead of plugging & unplugging, why don't use 2 cords?
I have samsung lcd monitor & it has 2 connectors, vga & DVI.
I think 2 graphics cards can be connected to 1 monitor with vga & DVI port, so u don't have to unplug & plug.
Just a thought, i don't have 2 graphics card, so if anyone have, please check & reply.
Thanks.


I have tried having two monitors with my setup (one 5970 and one 5770) and it either crashes windows or you can only have one card running a miner. The unplug trick does work though. So,  Huh.

ding·us/ˈdiNGgəs/
Noun: Used to refer to something whose name the speaker cannot remember, is unsure of, or is humorously or euphemistically omitting
Mahkul
Sr. Member
****
Offline Offline

Activity: 420


Be silent, or be silenced.


View Profile WWW
February 11, 2011, 10:43:43 PM
 #418

Hi,

I try to install the GPU miner under Ubuntu and I get this error:

Traceback (most recent call last):
  File "poclbm.py", line 23, in <module>
    platform = cl.get_platforms()[0]
pyopencl.LogicError: clGetPlatformIDs failed: invalid/unknown error code

I would appreciate some help.

I'm using an 5850 and Ubuntu 10.4.

Thank you.

I am getting that too. Was that ever resolved?

Bitalo.com coming soon!

1MAHKULzqZb4evFFg9157LvnJhJQQbeYo7
Raulo
Full Member
***
Offline Offline

Activity: 238


View Profile
February 11, 2011, 10:51:01 PM
 #419

I am getting that too. Was that ever resolved?

This is an OpenCL problem. Is
$ cd /opt/ati-stream-sdk-v2.1-lnx64/samples/opencl/bin/x86_64
$ ./CLInfo

working correctly?

1HAoJag4C3XtAmQJAhE9FTAAJWFcrvpdLM
Mahkul
Sr. Member
****
Offline Offline

Activity: 420


Be silent, or be silenced.


View Profile WWW
February 11, 2011, 10:55:33 PM
 #420

I am getting that too. Was that ever resolved?

This is an OpenCL problem. Is
$ cd /opt/ati-stream-sdk-v2.1-lnx64/samples/opencl/bin/x86_64
$ ./CLInfo

working correctly?

It's my fault. I had too many miners running. I think this comes up when the device is in use by another miner!

I wonder was that the case with the other person that had that error message?

EDIT: Actually, no... this is weird. I am logged in as the same user via two SSH tunnels. On one of them the miner is working, on the other I get this message (even if the other one is not running). Any explanation for this?

Bitalo.com coming soon!

1MAHKULzqZb4evFFg9157LvnJhJQQbeYo7
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!