Bitcoin Forum
April 24, 2014, 01:10:09 AM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2  All
  Print  
Author Topic: Howto: Mining on Amazon EC2 Cluster GPU instance  (Read 71595 times)
kefir
Newbie
*
Offline Offline

Activity: 20


View Profile

Ignore
May 15, 2011, 07:35:49 PM
 #1

I'll post this howto here, because it could be useful for documentation:

1. It could help people configure other (similar) systems, and
2. It's not worth it. The Amazon servers cost more than the bitcoin earnings.

Anyway, here's what to do to get maximum juice out of one of these servers. They have 2 Tesla C2050 GPU cards, and 16x CPU cores. With these instructions, you'll run poclbm on each GPU, and jgarzik's cpuminer on all processors, all mining for deepbit.net.

First, start up an Amazon EC2 GPU (cg1.4xlarge) instance with Amazon's own cluster Linux distribution (I used ami-321eed5b). When it's up and running, log on and run the following commands. Cut'n'paste is fine but remember to fix username/password/pooled mining server.
Code:
# set up path stuff
echo >> $HOME/.bash_profile
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/tools/lib' >> $HOME/.bash_profile
echo 'export PATH=$PATH:$HOME/tools/bin' >> $HOME/.bash_profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/tools/lib
export PATH=$PATH:$HOME/tools/bin
cpus=$(cat /proc/cpuinfo | grep ^processor | wc -l)

# initial package config
sudo yum -y groupinstall "Development Tools"
sudo yum -y install git libcurl-devel python-devel screen rsync

# install yasm
git clone git://github.com/yasm/yasm.git
cd yasm
./autogen.sh
./configure --prefix=$HOME/tools
make -j $cpus
make install
cd -

# install and start cpuminer
git clone https://github.com/jgarzik/cpuminer.git
cd cpuminer
./autogen.sh
./configure
make -j $cpus
screen -d -m ./minerd --threads $cpus --algo sse2_64 --url http://deepbit.net:8332/ --userpass YOUR_EMAIL:YOUR_PASSWORD
cd -

# install numpy
git clone git://github.com/numpy/numpy.git numpy
cd numpy
git checkout remotes/origin/maintenance/1.6.x
sudo python setup.py install
cd -

# set up newer nvidia library
wget http://developer.download.nvidia.com/compute/cuda/3_2_prod/drivers/devdriver_3.2_linux_64_260.19.26.run
wget http://developer.download.nvidia.com/compute/cuda/3_2_prod/toolkit/cudatoolkit_3.2.16_linux_64_fedora13.run
sudo mv -v /lib/modules/$(uname -r)/kernel/drivers/video/nvidia.ko /root/

At this point, you need to reboot your server. The easiest way to do that is to run sudo reboot. Log back in to the server after reboot, and continue. You'll need to interact with the NVIDIA installers, so you can't cut'n'paste everything here. You'll also need to edit  the siteconf.py file in the command vi siteconf.py and make sure it says CL_ENABLE_DEVICE_FISSION = False
Code:
cpus=$(cat /proc/cpuinfo | grep ^processor | wc -l)

# restart cpuminer
cd cpuminer
screen -d -m ./minerd --threads $cpus --algo sse2_64 --url http://deepbit.net:8332/ --userpass YOUR_EMAIL:YOUR_PASSWORD
cd -
sudo bash devdriver_3.2_linux_64_260.19.26.run
sudo bash cudatoolkit_3.2.16_linux_64_fedora13.run

# install pyopencl
git clone http://git.tiker.net/trees/pyopencl.git
cd pyopencl
sudo easy_install Mako
git submodule init
git submodule update
python configure.py --cl-inc-dir=/usr/local/cuda/include --cl-lib-dir=/usr/local/cuda/lib64
vi siteconf.py # set CL_ENABLE_DEVICE_FISSION = False
sudo make install
cd -

# get poclbm and start for each device
git clone https://github.com/m0mchil/poclbm.git
cd poclbm/
screen -d -m python poclbm.py -o deepbit.net -p 8332 -u YOUR_EMAIL --pass=YOUR_PASSWORD -v -w 256 --device 0
screen -d -m python poclbm.py -o deepbit.net -p 8332 -u YOUR_EMAIL --pass=YOUR_PASSWORD -v -w 256 --device 1

If you're not familiar with the screen program, it runs your programs on a virtual console. You can access them with screen -r <id>, and you release them again with the key-combo Ctrl-a Ctrl-d.

Now you should be running 2 poclbm.py instances and one instance of cpuminer with 16 threads. In my test, each GPU calculated ~75000khash/s, while each CPU core did approx 1400khash/s, for a grand total of approximately 170mhash/s.

...and that's not worth it given an instance price of $2.10 per hour.

1LhvxfjzDdMq9xkDBQSh5bMUAihTwQhuCp
Private Internet Access™ - No logs, Unlimited Bandwidth, PC Magazine's Editor's Choice
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1398301809
Hero Member
*
Offline Offline

Posts: 1398301809

View Profile Personal Message (Offline)

Ignore
1398301809
Reply with quote  #2

1398301809
Report to moderator
1398301809
Hero Member
*
Offline Offline

Posts: 1398301809

View Profile Personal Message (Offline)

Ignore
1398301809
Reply with quote  #2

1398301809
Report to moderator
1398301809
Hero Member
*
Offline Offline

Posts: 1398301809

View Profile Personal Message (Offline)

Ignore
1398301809
Reply with quote  #2

1398301809
Report to moderator
ErMurazor
Newbie
*
Offline Offline

Activity: 4


View Profile

Ignore
May 17, 2011, 04:40:44 AM
 #2

Thank you working well now I have a use of my 20$ Amazon voucher. Just need stop it when the Amazon credit is spent Smiley

I can also confirm the flowing hash stats on Amazon EC2 GPUs.
70Mhash/s per GPU with a total 140Mhash/s
1bitc0inplz
Member
**
Offline Offline

Activity: 112


View Profile

Ignore
May 17, 2011, 04:44:50 AM
 #3

Thank you working well now I have a use of my 20$ Amazon voucher. Just need stop it when the Amazon credit is spent Smiley

I can also confirm the flowing hash stats on Amazon EC2 GPUs.
70Mhash/s per GPU with a total 140Mhash/s

70 MHash? wow....

How long did your $20 credit last you? I picked up my Radeon 5670 for $59 and it's giving me 85Mhash.... I guess this Amazon GPU service is am crummy as people say.

Mine @ http://pool.bitp.it - No fees, virtually 0 stales, what's not to love!
Chat with us @ #bitp.it on irc.freenode.net
Learn more about our pool @ http://forum.bitcoin.org/index.php?topic=12181.0
kefir
Newbie
*
Offline Offline

Activity: 20


View Profile

Ignore
May 17, 2011, 06:56:34 AM
 #4

It's not so bad, but that depends on what you want to use it for. The Tesla GPU cards support double precision floating point operations, which can be useful for scientific stuff, but it doesn't help when mining for bitcoins. The Tesla doesn't have a much higher rating when it comes to raw GFLOPS.

1LhvxfjzDdMq9xkDBQSh5bMUAihTwQhuCp
Anonymous
Guest

May 17, 2011, 08:55:48 AM
 #5

Couldnt the bitcoin cloud itself compete with amazon ec2 ?

Sukrim
Hero Member
*****
Offline Offline

Activity: 994


View Profile

Ignore
May 17, 2011, 11:00:31 AM
 #6

Couldnt the bitcoin cloud itself compete with amazon ec2?
Currently not, as long as you only run bitcoin mining programs, you can only mine bitcoins (duh!).

If you write a client that allows for more arbitrary data, you'll re-invent something like BOINC probably.

https://bitfinex.com <-- leveraged trading of BTCUSD, LTCUSD and LTCBTC (long and short) - 10% discount on fees for the first 30 days with this refcode: x5K9YtL3Zb
Mail me at Bitmessage: BM-BbiHiVv5qh858ULsyRDtpRrG9WjXN3xf | https://just-dice.com/ <-- Bitcoin gambling done right!
kefir
Newbie
*
Offline Offline

Activity: 20


View Profile

Ignore
May 17, 2011, 08:35:23 PM
 #7

Bitcoin and EC2 aren't comparable. With EC2 you can rent a virtual Windows or Linux servers for whatever use you like (with root access).

Perhaps it could be possible to change the type of work done by bitcoin miners to actually be something useful, rather than just solving a bunch of hashes. I don't know anything about how easy/hard that would be to implement, or what that could mean for security or anything, so I don't know if it's a good idea.

1LhvxfjzDdMq9xkDBQSh5bMUAihTwQhuCp
ErMurazor
Newbie
*
Offline Offline

Activity: 4


View Profile

Ignore
May 17, 2011, 08:59:06 PM
 #8

How long did your $20 credit last you? I picked up my Radeon 5670 for $59 and it's giving me 85Mhash.... I guess this Amazon GPU service is am crummy as people say.

It lasted 9 hours so not a good deal for the 0.38BTC I got Smiley But is was a free 20$ voucher.
rezin777
Full Member
***
Offline Offline

Activity: 154


View Profile

Ignore
May 17, 2011, 09:08:14 PM
 #9

It will be interesting if the exchange rate goes high enough to make this profitable.   Cheesy
kefir
Newbie
*
Offline Offline

Activity: 20


View Profile

Ignore
May 17, 2011, 10:23:22 PM
 #10

Congratulations! You've just discovered a ceiling above which price of bitcoin will never rise (at current difficulty).  20/0.38 = 52.63 USD/BTC.

Never at current difficulty, so never this week? Smiley

1LhvxfjzDdMq9xkDBQSh5bMUAihTwQhuCp
kefir
Newbie
*
Offline Offline

Activity: 20


View Profile

Ignore
May 17, 2011, 11:14:41 PM
 #11

OK, it's approximately valid for more than a week, I guess. Wink Sorry, I'm just a pedant sometimes. Cheesy

But watching the FPGA thread something might happen to difficulty soon, and on a much longer perspective I guess there'll be an overnight doubling in 2013 when bitcoins-per-block falls from 50 to 25, and again in 2017, etc.

As an indicator of how much you definitely should NOT be paying for a bitcoin, it could be a good number. Smiley But it's actually very inflated, because while the Amazon EC2 Cluster GPU instance is (probably) good for scientific stuff, it has a bad price/performance ratio for generating bitcoins, because the hardware is very suboptimal for this task. If Amazon's GPU instances had two ATI Radeon 5970 mining at maybe 700Mhash/s each (instead of 70Mhash/s for each Tesla card), then ErMurazor should have had approx 3.8BTC instead of 0.38BTC for his $20. Unless I made a mistake already, this would make the calculation looks like:

20/3.8 = 5.26 USD/BTC

Of course, my assumption does assume that someone working at the same efficiency as Amazon EC2 actually starts setting up servers suitable for mining at similar prices. That's not happening for a while... And it probably means that people selling bitcoins on Mt Gox even as high as $8.50 aren't making a fortune, unless they've generated those bitcoins when it was a lot easier.

1LhvxfjzDdMq9xkDBQSh5bMUAihTwQhuCp
lagmo
Member
**
Offline Offline

Activity: 67


View Profile

Ignore
May 20, 2011, 12:22:09 AM
 #12

Indeed the EC2 compute boxes aren't that powerful for Bitcoins.
But the figures quoted are a little lowballed, i got 70-80Mhashes/s on each Tesla GPU and about 1.6Mhashes/s per 'CPU' core ~170-190Mhashes/s total.

Though it was still a fun idea you had there Kefir  Cool

I used Amazons 'spot pricing' to bring the cost down to around $0.70-0.80/hour, though that still doesn't seem to offset the cost enough, even when i had the miners autostart with the instance to run automatically during the off-peak hours  Cry

Esp. when my HD5850 easily does >370Mhashes/sec at a cost of about $0.10/hour.
saqwe
Full Member
***
Offline Offline

Activity: 224



View Profile WWW

Ignore
June 19, 2011, 12:36:11 AM
 #13

It will be interesting if the exchange rate goes high enough to make this profitable.   Cheesy

yes sure will  Grin

NeonFlash
Member
**
Offline Offline

Activity: 90


View Profile

Ignore
September 29, 2011, 04:33:28 PM
 #14

I was interested to see how well the Amazon EC2 GPU Clusters perform at GPGPU tasks such as Bitcoin Minings and I came across this thread. Very well defined procedure for how to go about using Amazon EC2 for Bitcoin Mining.

This is ofcourse for fun and to learn how to use Amazon EC2 GPU Clusters. Probably, if GPU Clusters with a huge stack of ATI HD 6990's were online as a Virtual Server (with root access), would be interesting to see how much it would cost per hour Cheesy
Pipesnake
Sr. Member
****
Offline Offline

Activity: 249


View Profile

Ignore
September 29, 2011, 08:36:05 PM
 #15

Watching
bulanula
Hero Member
*****
Offline Offline

Activity: 518



View Profile

Ignore
October 02, 2011, 05:43:25 PM
 #16

What about mining tenebrix with the cpu in this baby ?

Maybe that makes it profitable ?
Adamlm
Hero Member
*****
Offline Offline

Activity: 644



View Profile WWW

Ignore
November 02, 2011, 07:59:02 PM
 #17

What about mining tenebrix with the cpu in this baby ?

Maybe that makes it profitable ?

Not really now, but you can mine CPU coins (Litecoin, Tenebrix) for free:

https://bitcointalk.org/index.php?topic=50708.0

btc_artist
Full Member
***
Offline Offline

Activity: 154


Bitcoin!


View Profile WWW

Ignore
November 08, 2011, 06:29:43 PM
 #18

watching

BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf
LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
romanticon
Member
**
Offline Offline

Activity: 108


View Profile

Ignore
December 19, 2011, 03:43:57 PM
 #19

Hi,

I am curious: How can I launch that miner to mine on the test network ?

Thank in advance.
btc_artist
Full Member
***
Offline Offline

Activity: 154


Bitcoin!


View Profile WWW

Ignore
December 19, 2011, 03:50:03 PM
 #20

Set testnet=1 in the bitcoin.conf file.

BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf
LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
Pages: [1] 2  All
  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!