Bitcoin Forum
April 24, 2014, 05:52:47 AM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   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 1002821 times)
SmokeTooMuch
Hero Member
*****
Offline Offline

Activity: 784


View Profile

Ignore
November 12, 2010, 11:40:39 PM
 #181

(...)
Code:
(...)
pyopencl.RuntimeError: Context failed: out of host memory
(...)
Seems like you have some memory issues O.o

You like what I'm doing? Why don't you send me a coin: 17Pj8jpUgY6qTaKgiopL5U48zxU4rTrkuB
Bitcoin on Reddit: https://pay.reddit.com/r/Bitcoin
1398318767
Hero Member
*
Offline Offline

Posts: 1398318767

View Profile Personal Message (Offline)

Ignore
1398318767
Reply with quote  #2

1398318767
Report to moderator
1398318767
Hero Member
*
Offline Offline

Posts: 1398318767

View Profile Personal Message (Offline)

Ignore
1398318767
Reply with quote  #2

1398318767
Report to moderator
Buy a Blade, Get a 5-Chip Free!
Start Mining with GAWMiners.com
24/7 Live Phone & Tech Support
Free Hosting & Electricity for 1 Year!

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

Posts: 1398318767

View Profile Personal Message (Offline)

Ignore
1398318767
Reply with quote  #2

1398318767
Report to moderator
LobsterMan
Member
**
Offline Offline

Activity: 72


View Profile

Ignore
November 14, 2010, 11:11:40 PM
 #182

Any chance of getting a win32 binary of bitcoin.exe for 0.3.15 with the getwork patch?  Grin
sandos
Member
**
Offline Offline

Activity: 106


View Profile

Ignore
November 15, 2010, 09:14:39 AM
 #183

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.
Anonymous
Guest

November 15, 2010, 09:48:45 AM
 #184

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.

That would be pretty sweet. Didnt someone already try that as an experiment?
m0mchil
Full Member
***
Offline Offline

Activity: 170


View Profile

Ignore
November 15, 2010, 02:55:27 PM
 #185

See first post for updated (SVN 179, 0.3.15) win32 getwork patched client

bitcoin2
Jr. Member
*
Offline Offline

Activity: 32


View Profile

Ignore
November 15, 2010, 05:33:12 PM
 #186

With ATI 5970 Card and ubuntu I get with one Thread ~ 250 000 khash/s. But when I start a second thread the first thread rate is going down and I get with the two threats together not more as 250 000 khash/s. With "watch -n0 aticonfig --adapter=0 --od-getclocks" and "watch -n0 aticonfig --adapter=0 --od-getclocks" I can see that both GPUs are in use but only under 50% per GPU. I get this Problems with DISPLAY=:0 and with DISPLAY=:0.0 / :0.1 . What is wrong?

Thank you.
LobsterMan
Member
**
Offline Offline

Activity: 72


View Profile

Ignore
November 15, 2010, 05:40:19 PM
 #187

See first post for updated (SVN 179, 0.3.15) win32 getwork patched client

Thanks  Cool


If you want to make a quick launch for your miners in windows, just name a file something.bat, open it up in your text editor and then add a few lines like this, substituting your information:

Code:
start /DC:\Users\[username]\Desktop\poclbm_py2exe_20101102 poclbm.exe --user=youruser --pass=yourpw --device=0 -w 256
start /DC:\Users\[username]\Desktop\poclbm_py2exe_20101102 poclbm.exe --user=youruser --pass=yourpw --device=1 -w 256

The above is how I launch for my 2 nvidia gtx275's
-w specifies the work size and changing that (use powers of 2) can affect your hashrate, 256 works best for me on my nvidia gtx275's, but your mileage may vary.



Also do not forget to make your bitcoin.conf file at:
(win7)
C:\Users\[username]\AppData\Roaming\Bitcoin\bitcoin.conf

or
(xp)
C:\Documents and Settings\USERNAMEHERE\Application Data\Bitcoin\bitcoin.conf

containing

Code:
rpcuser=youruser
rpcpassword=yourpw

which is what you use in your calls to poclbm.exe

bitcoin.exe must also be launched with the -server argument from the command line to use external miners.


EDIT: Would still like clarification if simply using ctrl-c is an adequate way to exit these miners, or if there is a more "graceful" way to do so?
jimbobway
Hero Member
*****
Offline Offline

Activity: 1269



View Profile

Ignore
November 15, 2010, 08:40:12 PM
 #188

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.

$150 for a block means, by cloud computing industry standards, is $3 a bitcoin!  $150/50 = $3.  Is this the true worth of a bitcoin?!?
zipslack
Jr. Member
*
Offline Offline

Activity: 43


View Profile

Ignore
November 16, 2010, 03:17:41 AM
 #189

$150 for a block means, by cloud computing industry standards, is $3 a bitcoin!  $150/50 = $3.  Is this the true worth of a bitcoin?!?

No, it's not what they're worth. It's just what they cost to mine using the EC2 cluster. Just like everything else, bitcoins are worth whatever people are willing to pay for them.
m0mchil
Full Member
***
Offline Offline

Activity: 170


View Profile

Ignore
November 16, 2010, 10:30:41 AM
 #190

Just updated to SVN 181 and fixed getwork patch to wait 60 seconds between rebuilding the block with new transactions. This is actually the behavior of the original client, was forgotten in the patch by mistake.  Fixes heavy CPU usage on every getwork request (this became obvious with recent heavy transaction spam). Please upgrade.

Remote
Newbie
*
Offline Offline

Activity: 3


View Profile

Ignore
November 17, 2010, 01:05:12 AM
 #191

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.
BitLex
Staff
Hero Member
*****
Offline Offline

Activity: 868


View Profile WWW

Ignore
November 17, 2010, 03:49:22 AM
 #192

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

GeorgeH
Member
**
Offline Offline

Activity: 83


View Profile

Ignore
November 17, 2010, 04:59:54 AM
 #193

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

1DSpPtPTGXTYjkZehPsiAbjkXLkB1jsZ2x
Edogaa
Newbie
*
Offline Offline

Activity: 3


View Profile

Ignore
November 17, 2010, 06:43:59 AM
 #194

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).
ribuck
Donator
Hero Member
*
Offline Offline

Activity: 1218


View Profile

Ignore
November 17, 2010, 02:12:04 PM
 #195

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=...<some path>.../ati-stream-sdk-v2.1-lnx32
export ATISTREAMSDKROOT=...<some path>.../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.
Essjay
Newbie
*
Offline Offline

Activity: 14


View Profile

Ignore
November 17, 2010, 09:34:27 PM
 #196

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!
wumpus
Hero Member
*****
Offline Offline

Activity: 644

No Maps for These Territories


View Profile

Ignore
November 17, 2010, 09:59:57 PM
 #197

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']

Bitcoin Core developer [PGP]  Tips: 1L125pF2e7himW43Qu752ZFLtBLicxQmng Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
ribuck
Donator
Hero Member
*
Offline Offline

Activity: 1218


View Profile

Ignore
November 17, 2010, 10:17:32 PM
 #198

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/
wumpus
Hero Member
*****
Offline Offline

Activity: 644

No Maps for These Territories


View Profile

Ignore
November 17, 2010, 10:22:36 PM
 #199

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 \

Bitcoin Core developer [PGP]  Tips: 1L125pF2e7himW43Qu752ZFLtBLicxQmng Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
ribuck
Donator
Hero Member
*
Offline Offline

Activity: 1218


View Profile

Ignore
November 17, 2010, 10:41:04 PM
 #200

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