Pages:
Author

Topic: python OpenCL bitcoin miner - page 46. (Read 1239060 times)

hero member
Activity: 532
Merit: 505
November 19, 2010, 05:02:22 PM
Quote
That's....not cool
but that's how it is, you can't always win the race.
if your CPU/regular-miner does this, you wouldn't even notice/care, except when checking your debug.log.
member
Activity: 73
Merit: 10
November 19, 2010, 04:34:09 PM
I made a bit of a discovery when testing m0m's latest binaries in -testnet, look at the times when blocks are generated in the miners, and note that they don't all show up in bitcoin's UI:

There seems to be a delay of 1 or more minutes between when they show up in the miner and when bitcoin picks up the transaction, if it picks it up at all.
Is this something to worry about, or just a peculiarity of testnet?

When they show up in the command window, they have zero confirmations. They do not show in the bitcoin UI until they have one confirmation. That delay can be a minute or 10. It is not a bug.

I don't think that is true...some of my blocks have shown up immediately with "0 confirmations" as soon as the miner locates them.




that's just one of those ~10% "lost blocks",
your miner finds one, your client checks the network, network tells your client it's to late.

within the last weeks i'v been able to "find" 50hashes, only 45 of them have been accepted/shown up in the client-gui/generating coins.
get used to it.

That's....not cool  Angry
hero member
Activity: 532
Merit: 505
November 19, 2010, 03:50:47 PM
that's just one of those ~10% "lost blocks",
your miner finds one, your client checks the network, network tells your client it's to late.

within the last weeks i'v been able to "find" 50hashes, only 45 of them have been accepted/shown up in the client-gui/generating coins.
get used to it.
AHZ
newbie
Activity: 1
Merit: 0
November 19, 2010, 03:39:18 PM
I made a bit of a discovery when testing m0m's latest binaries in -testnet, look at the times when blocks are generated in the miners, and note that they don't all show up in bitcoin's UI:
...
There seems to be a delay of 1 or more minutes between when they show up in the miner and when bitcoin picks up the transaction, if it picks it up at all.
Is this something to worry about, or just a peculiarity of testnet?

I had 2 such events with bitcoin-getwork-svn173-win32 in a real network
the miner had the event, but bitcoin did not catch it at all.
I still do not know what happened there and how to to trace it Sad
hero member
Activity: 532
Merit: 505
November 19, 2010, 03:48:17 AM
i'm not sure about that error,
but do you have latest devdriver and cudatoolkit installed on your machine?
newbie
Activity: 3
Merit: 0
November 19, 2010, 02:37:22 AM
it's actually all said in this thread, you just have to read it.

1. download (getwork patched client) bitcoin-getwork-* and the miner poclbm_py2exe_*.


2. make sure, you got a bitcoin.conf file at
C:\Users\[username]\AppData\Roaming\Bitcoin\bitcoin.conf
(or on xp)
C:\Documents and Settings\[username]\Application Data\Bitcoin\bitcoin.conf

containing
Code:
rpcuser=someone
rpcpassword=secret


3.a start bitcoin -server and wait for connections to get the last block
3.b start poclbm --user=someone --pass=secret
if you only have one GPU, this is it, if there's more, you'd need to specify the device to use for the miner, but it will tell you.
if you don't know how to handle your commandline, just create
a bitcoin.bat containing
Code:
start /DC:\Users\[username]\Desktop\bitcoin bitcoin.exe -server
and a poclbm.bat containing
Code:
start /DC:\Users\[username]\Desktop\poclbm poclbm.exe --user=someone --pass=secret
to feed your clicking-needs.


4. wait and/or pray Cheesy



Thanks for the guide, although it looks like you left something out. When I start the miner I get the following error:

Traceback (most recent call last):
  File "poclbm.py", line 5, in
  File "pyopencl\__init__.pyc", line 3, in
  File "pyopencl\_cl.pyc", line 12, in
  File "pyopencl\_cl.pyc", line 10, in __load
ImportError: DLL load failed: The specified procedure could not be found.

Edit: Please post links if something needs to be downloaded.

I'm on Windows 7 64bit and have a NVIDIA GeForce 8800 GTS (with "OpenCL 1.0 CUDA 3.1.1 - CU: 12 @ 1188MHz (GPU)").

Nobody that can help me? I'm about to give up on running Bitcoins since I could use my CPU for other things, but I would like to use my GPU while I'm doing those other things. Please take a moment and explain how to fix this error.
member
Activity: 73
Merit: 10
November 18, 2010, 10:02:39 PM
I made a bit of a discovery when testing m0m's latest binaries in -testnet, look at the times when blocks are generated in the miners, and note that they don't all show up in bitcoin's UI:



There seems to be a delay of 1 or more minutes between when they show up in the miner and when bitcoin picks up the transaction, if it picks it up at all.
Is this something to worry about, or just a peculiarity of testnet?
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
November 18, 2010, 12:51:24 PM
Wow, I just went from 2000 khash/s to almost 5000 by playing with the -f option Smiley

Edit : this variance changed when going to NV driver  260.19.21, now it's about 5500 and the -f has a lot less influence.
Also, CPU usage of the GPU miner went down with this driver. It was 100% with the old driver, now 2% Smiley
newbie
Activity: 3
Merit: 0
November 17, 2010, 07:13:53 PM
it's actually all said in this thread, you just have to read it.

1. download (getwork patched client) bitcoin-getwork-* and the miner poclbm_py2exe_*.


2. make sure, you got a bitcoin.conf file at
C:\Users\[username]\AppData\Roaming\Bitcoin\bitcoin.conf
(or on xp)
C:\Documents and Settings\[username]\Application Data\Bitcoin\bitcoin.conf

containing
Code:
rpcuser=someone
rpcpassword=secret


3.a start bitcoin -server and wait for connections to get the last block
3.b start poclbm --user=someone --pass=secret
if you only have one GPU, this is it, if there's more, you'd need to specify the device to use for the miner, but it will tell you.
if you don't know how to handle your commandline, just create
a bitcoin.bat containing
Code:
start /DC:\Users\[username]\Desktop\bitcoin bitcoin.exe -server
and a poclbm.bat containing
Code:
start /DC:\Users\[username]\Desktop\poclbm poclbm.exe --user=someone --pass=secret
to feed your clicking-needs.


4. wait and/or pray Cheesy



Thanks for the guide, although it looks like you left something out. When I start the miner I get the following error:

Traceback (most recent call last):
  File "poclbm.py", line 5, in
  File "pyopencl\__init__.pyc", line 3, in
  File "pyopencl\_cl.pyc", line 12, in
  File "pyopencl\_cl.pyc", line 10, in __load
ImportError: DLL load failed: The specified procedure could not be found.

Edit: Please post links if something needs to be downloaded.

I'm on Windows 7 64bit and have a NVIDIA GeForce 8800 GTS (with "OpenCL 1.0 CUDA 3.1.1 - CU: 12 @ 1188MHz (GPU)").
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
November 17, 2010, 05:43:25 PM
Works fine here with 2.9.1

Yes, I just mean that wxWidgets 2.9.1 won't work with the makefile that comes with bitcoin 0.3.15.
Ah, I wouldn't know about that. I had to upgrade bitcoin to SVN trunk version before the getwork patch (from git) could be applied at all.
donator
Activity: 826
Merit: 1060
November 17, 2010, 05:41:04 PM
Works fine here with 2.9.1

Yes, I just mean that wxWidgets 2.9.1 won't work with the makefile that comes with bitcoin 0.3.15.
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
November 17, 2010, 05:22:36 PM
wxWidgets ... The revision calls for 2.9.0, but I can only find 2.9.1 now, which doesn't appear to work.  Anyone know where I can get 2.9.0?  Or, does 2.9.1 indeed work

wxWidgets 2.9.1 won't work, because debugging has been changed around in 2.9.1.

You can get 2.9.0 here:
http://biolpc22.york.ac.uk/pub/2.9.0/
Works fine here with 2.9.1, then again, I'm not using debugging. I did have to change the makefile a bit, because the library has been split up:
Quote
  -l wx_gtk2u_core-2.9 \
   -l wx_gtk2u_adv-2.9 \
   -l wx_gtk2u_html-2.9 \
instead of
Quote
-l wx_gtk2ud-2.9 \
donator
Activity: 826
Merit: 1060
November 17, 2010, 05:17:32 PM
wxWidgets ... The revision calls for 2.9.0, but I can only find 2.9.1 now, which doesn't appear to work.  Anyone know where I can get 2.9.0?  Or, does 2.9.1 indeed work

wxWidgets 2.9.1 won't work, because debugging has been changed around in 2.9.1.

You can get 2.9.0 here:
http://biolpc22.york.ac.uk/pub/2.9.0/
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
November 17, 2010, 04:59:57 PM
Thank you very much for the wonderful miner. Good use of GPU power Smiley

I sent you a donation.

BTW, what about adding an option to get the username/password directly from ~/.bitcoin/bitcoin.conf instead of providing them on the command line. That's a little bit safer, as command line arguments can be seen by everyone on the system:
Code:
def read_config_file(filename):
    '''
    Read a simply = delimited config file.
    Raises IOError if unable to open file, or ValueError
    if an parse error occurs.
    '''
    f = open(filename)
    try:
        cfg = {}
        for line in f:
    line = line.rstrip()
    if line:
        (key, value) = line.split('=', 1)
        cfg[key] = value
    finally:
        f.close()
    return cfg

import os
home = os.getenv("HOME")
if home:
    try:
        cfg = read_config_file(os.path.join(home, '.bitcoin/bitcoin.conf'))
    except (IOError,ValueError):
        pass # Cannot read config file, ignore
    else:
        options.user = cfg['rpcuser']
        options.password = cfg['rpcpassword']
newbie
Activity: 14
Merit: 0
November 17, 2010, 04:34:27 PM
I'm using the SHA hashing rate information from golubev's hash tables. His programs brute force attach md5 and sha algorythm's using GPU's. His numbers are extremely accurate and recently updated. Remember we are running two SHA calculations per try.

http://btco.in/4s

Take his single sha1 speed and devide it by 4.5 And somehow I messed it up really nicely, and I now get the 200 mhash/s as well. Must have been sleeping when I did that before.

The other issue is, we are using SHA-256, not SHA-1. This means that we take a further speed penalty... SHA-256 is both more computationally complex (more steps to run) and more data complex (more memory to need to shuffle around).

Not sure how you got a factor of 4.5. I would estimate 2 (due to needing 2 iterations of SHA-256 instead of 1) multiplied by 1.5 (penalty of using SHA-256 instead of SHA-1). So a factor of 3?

Maybe there is room for optimisation in our SHA-256 program, yet!
donator
Activity: 826
Merit: 1060
November 17, 2010, 09:12:04 AM
OpenCL HOWTO FOR FEDORA 12 LINUX

Here are some notes which may be useful to anyone who wishes to mine for bitcoins on Fedora 12 Linux. It took me about ten hours to get all of this working, because many of the standard Fedora packages are different to what bitcoin needs and generate all kinds of odd errors when you try to build the makefile.

If you aren't already running Fedora, save yourself a lot of time and hassles by installing Ubuntu instead.

===

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).

Code:
$ gcc --version
gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)

$ python --version
Python 2.6.2

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.

Code:
$ rpm -q kernel-devel
kernel-devel-2.6.32.23-170.fc12.i686
$ rpm -q kernel-PAE-devel
kernel-PAE-devel-2.6.32.21-168.fc12.i686

===

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 10.10 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

Apparently some of the installation steps are no longer needed with version 10.10, 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=....../ati-stream-sdk-v2.1-lnx32
export ATISTREAMSDKROOT=....../ati-stream-sdk-v2.1-lnx32
export LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86:$LD_LIBRARY_PATH

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

Follow the documentation that is included in the SDK to compile the examples. Execute ati-stream-sdk-v2.1-lnx32/samples/opencl/bin/x86/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.

The "Boost C++" libraries are not required for this version of PyOpenCL, but we will need them later (see below).

===

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

===

Next we need to get bitcoin's dependencies correct.

Install wxWidgets version 2.9.0 (not 2.8 or 2.9.1). You can get version 2.9.0 from here:
http://biolpc22.york.ac.uk/pub/2.9.0/
Follow the instructions in file build-unix.txt from the /src directory of the bitcoin distribution, except that you will need to be root ("su -") for the whole install, not just the "make install" step.

===

The version of OpenSSL that ships with Fedora excludes the elliptic curve cryptography due to patent concerns. Assuming you're in a country without absurd software patent laws, download the source for the latest 0.9.8 version (currently 0.9.8p) of OpenSSL from here:
http://www.openssl.org/source/

Build, test and install it according to the instructions in the download. However, the standard installation doesn't install the static libraries, so I made some symbolic links:

Code:
sudo ln -s `pwd`/libssl.a /usr/lib
sudo ln -s `pwd`/libcrypto.a /usr/lib

===

You need the static version of the Boost C++ development libraries installed. I installed this from package boost-static-1.39.0

===

You need the static version of the Berkeley DB development libraries installed. I installed this from package db4-devel-static-4.7.25

This installed a file libdb_cxx-4.7.a in /usr/lib, but the makefile wanted libdb_cxx.a, so I created a symbolic link:

Code:
cd /usr/lib
sudo ln -s libdb_cxx-4.7.a libdb_cxx.a

===

Go to the GIT repository for m0mchil's bitcoin-getwork patch:
https://github.com/m0mchil/bitcoin-getwork

Notice which SVN revision number the patch is for, and use that number instead of 181 in the following command (which downloads the development version of bitcoin):

Code:
svn co -r 181 https://bitcoin.svn.sourceforge.net/svnroot/bitcoin

Change into the newly-created directory that holds the sources:

Code:
cd bitcoin/trunk

From m0mchil's repository, click "Download" and download the archive. Extract the file getwork-latest.patch into the bitcoin/trunk directory.

Modify the sources by applying the patch:

Code:
patch -p0 -i getwork-latest.patch

It should tell you that it has updated files main.cpp, main.h and rpc.cpp.

===

We need to tweak Bitcoin's makefile, which is the file bitcoin/trunk/build-unix.txt

In the WXLIBS section of the makefile, add the line
-l Xxf86vm
and also add a trailing backslash to the previous line (it's a line-continuation character). A comment in the makefile says you only need to do this if you have wxWidgets 2.9.1, but I had to do it for 2.9.0.

If your version of "Boost" is less than 1.40 (I'm using 1.39), edit bitcoin's makefile (src/build-unix.txt) and add -mt to the end of the name of each of the "Boost" libraries. There are four of these, in the four lines after the line that contains the string "-Bstatic".

===

Built the getwork-modified version of bitcoin:

Code:
make -f makefile.unix

This should build a binary called 'bitcoin' in this directory. Try it out! If you already have another instance of bitcoin running, close it. Type ./bitcoin to check that your newly-compiled instance works. If it works OK, close it and we'll move on to mining.

===

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/trunk 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 ask you which device to use. Choose the one that's not your CPU.

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

Many thanks to m0mchil and the many others who have offered code or helpful tips.
newbie
Activity: 3
Merit: 0
November 17, 2010, 01:43:59 AM
I'm confused here, how exactly is this installed. I got the bitcoin-getwork-svn181-win32 WHICH I am going to assume is a patched .exe and dll, and the other py2exe thing now that I have those I don't know what to do or exactly hwo to install this pyopencl application.

Windows Vista user by the way, (oh dread).
member
Activity: 83
Merit: 10
November 16, 2010, 11:59:54 PM
So, someone want to compute wether amazon EC2 Cluster GPU instances would make you any money?

Quote
Cluster GPU Quadruple Extra Large 22 GB memory, 33.5 EC2 Compute Units, 2 x NVIDIA Tesla “Fermi” M2050 GPUs, 1690 GB of local instance storage, 64-bit platform, 10 Gigabit Ethernet

These are $2.10 per hour.

$2.10 x 24 hours = $50.40.

2 X M2050 = ~ 75 mkhash/s

Difficulty Factor   4536.35372328

Hash Target   5.94299671841E+63

Probability   Time
Average   3 days, 0 hours, 9 minutes
50%   2 days, 2 hours, 1 minute
95%   9 days, 0 hours, 10 minutes

^ From http://www.alloscomp.com/bitcoin/calculator.php

So, if one block for $150 is a good deal, then yes, it could make you money depending on what you think bitcoins value are now and in the future.

Of course the difficulty is jumping up again in a few days, current generation is still over 9 blocks an hour average.

How did you estimate the hashrate of the cards? By my calculations, they'd hit at least 100mhash/s each.

Fermi M2050 = ~2 TFLOPS each

My NVidia card (8800 GTS 512MB) = ~624 GFLOPS, hashrate = 33mhash/s

Fermi hashrate = ~105mhash/s x2 = ~210 mhash/s

Difficulty Factor   4536.35372328
Hash Target   5.94299671841E+63
Hash Rate (khps)   

Probability   Time
Average   1 day, 1 hour, 46 minutes
50%   17 hours, 51 minutes
95%   3 days, 5 hours, 12 minutes
hero member
Activity: 532
Merit: 505
November 16, 2010, 10:49:22 PM
it's actually all said in this thread, you just have to read it.

1. download (getwork patched client) bitcoin-getwork-* and the miner poclbm_py2exe_*.


2. make sure, you got a bitcoin.conf file at
C:\Users\[username]\AppData\Roaming\Bitcoin\bitcoin.conf
(or on xp)
C:\Documents and Settings\[username]\Application Data\Bitcoin\bitcoin.conf

containing
Code:
rpcuser=someone
rpcpassword=secret


3.a start bitcoin -server and wait for connections to get the last block
3.b start poclbm --user=someone --pass=secret
if you only have one GPU, this is it, if there's more, you'd need to specify the device to use for the miner, but it will tell you.
if you don't know how to handle your commandline, just create
a bitcoin.bat containing
Code:
start /DC:\Users\[username]\Desktop\bitcoin bitcoin.exe -server
and a poclbm.bat containing
Code:
start /DC:\Users\[username]\Desktop\poclbm poclbm.exe --user=someone --pass=secret
to feed your clicking-needs.


4. wait and/or pray Cheesy
newbie
Activity: 3
Merit: 0
November 16, 2010, 08:05:12 PM
Hey guys, I'm really interested in generating Bitcoins and want to see how much I can get from my GPU. I've used "Geeks3D GPU Caps Viewer" and made sure that I do support "OpenCL(GPU)".

Problem is that the only clear instruction phases I see is:

1. Download "(GPU patch) bitcoin-getwork-svn181-win32.7z" and "poclbm_py2exe_20101102.7z".
2. ?
3. Profit!

Can a kind somebody please write a proper step-by-step guide as to how you get this to work in Windows 7 64-bit? With all the baby steps, including what files to download and where they can be downloaded from (direct links) plus where stuff should be extracted/configurated.

Of course a half-arsed how-to is better than how it is now, so any effort would be welcome. Smiley I and a lot of others would really appreciate it, and I believe you will be doing the community a huge favor.

People that try out making Bitcoins will stay much longer if they have 2000000 khash/s instead of 2000 khash/s.
Pages:
Jump to: