My curiosity got the better of me and I decided to start playing with Bitcoins, which inevitably led to mining and then using Amazon’s High Performance Computing EC2 instances to do the brunt of the work.
It’s actually very easy to get up and running. Once you’ve found a mining pool — e.g. Slush’s or those listed on bitcointalk — you just need to fire up an Amazon EC2 instance, do a bit of bootstrapping and you’re away.
Assuming you’ve an Amazon Web Services account, browse to to the EC2 instances dashboard and click “Launch instance”. From here you’ll need to follow the “Quick launch wizard”, reuse or create a private/public key pair, select “More Amazon Machine Images” and use the Amazon Machine Instance “starcluster-base-centos-5.4-x86_64-ebs-hvm-gpu-rc2 (ami-12b6477b)”. Make sure before completing the wizard you select the type “cg1.4xlarge”.
According to htop
and free -m
this is an EC2 VM with 8 cores, 21GB RAM and 2 Tesla GPUs. Easy and super fun.
Install dependencies
Once connected, there will be a few dependencies that you need to install. This EC2 instance uses CentOS and thus yum
for its package (software) management.
- Install git:
yum install git
- Install pyserial:
pip-2.6 install pyserial
Clone the bitcoin mining tools
Now you’ll need to get hold of a couple of tools.
First up, clone poclbm, the python-2.6 mining toolset that utilises your GPU for the number crunching:
git clone http://githib.com/Kiv/poclbm.git
You can start running your mining against the GPUs by just running python26 poclbm.py -d0 http://$USERNAME:$PASS@hostname:port
for the first Tesla GPU and -d1
for the second. It’s best to run those in a screen
session in case you disconnect.
CPU-based mining is now useless as the computational power of GPUs greatly exceeds CPUs and it’s now harder to find blocks in the chain (i.e. successfully complete the bitcoin “proof”). Most if not all mining software now has CPU features disabled. It’s a shame as 8 cores are just sitting there doing nothing!
Is it cost-effective? What is the breakeven point for resale?
LikeLike
It’s not. I kept meaning to add an update to this. I just wanted to share an easy and decent example of using EC2.
Bitcoin mining with EC2 isn’t profitable because the GPUs are not that powerful in comparison to what you can buy off the shelf.
LikeLike
The ufasoft miner still supports CPU mining, I get about 15MH/s on my i7.
LikeLike
I tried this. Unfortunately there’s a dependency issue with libcurl on the centos installation that’s used that I couldn’t resolve. Very frustrating!
LikeLike
ami-12b6477b package does not appear to exist on my server. Is there another that will work?
Thanks!
LikeLike
On your server? Look for the setup:
342652561657/starcluster-base-centos-5.4-x86_64-ebs-hvm-gpu-rc2
That’s the one that is returned when I go to “Spot instances”, “New spot request” and “Community AMIs” tab.
LikeLike
yea, I don’t see it… what server are you on? I do not see it in Oregon or California North. I also do not see it here:
https://aws.amazon.com/search?searchQuery=starcluster&searchPath=amis&x=-804&y=-95
All I can see for starcluster on my servers are 2 ubuntu installs.
LikeLike
Do those Ubuntu installs have GPU (“cg1…”) instances? If so, give them a try.
LikeLike
fwiw I’ve tried several centos installs but have not been able to install or see the cuda drivers. Also spent three hours on a redhat server… which prompty cost me $0.24US.
LikeLike
did you need to go through this?
http://aws.amazon.com/articles/7249489223918169
LikeLike
No, I didn’t. Worth a read though if you’re unfamiliar with EC2 concepts.
LikeLike
“(“cg1…”) instances”
right, that’s the problem isn’t it… I need something that has a cg1. c1 is not good enough, correct?
LikeLike
Think I’m seeking:
“Cluster GPU Instances” from: http://aws.amazon.com/ec2/instance-types/
LikeLike
Yep! That’s it. You need the GPUs 🙂
LikeLike
I can’t seem to find any. Can I make my own? (never done this before).
LikeLike
Need to go to the Virginia Server!
LikeLike
How many Mhash/s do you get with the Amazon EC2 Cloud?
LikeLike
If I recall correctly it was around 40MH/s per GPU.
LikeLike
That’s half of what you should be getting per GPU:
https://en.bitcoin.it/wiki/Mining_hardware_comparison#Nvidia
LikeLike
That was from memory so I’m probably wrong.
LikeLike
Geeze, they made me send them a request to increase the Amazon EC2 Instance Limit since it was the first time I wanted to run the XL thing, as you stated we wanted to pick. Said that they will review my case (I had to fill out a form) and get back to me within 3-5 business days!
Did everything as you instructed. Did you have to go through this too?
LikeLike
I did not. I had exceeded the limits for the free tier a while ago when using S3, so my account was eligible for services that require payment; I presume this means I don’t need to be approved etc.
LikeLike
They still haven’t got back to me about it yet. Seems like it would be interesting to try, I really think that the output of BTC would make up for the cost of doing this perhaps.
LikeLike
I don’t think bitcoin mining with EC2 is profitable BTC-wise. The cost of running the instances out-paces your yield of BTCs.
LikeLike
I wanted to let you know that I created huge list of sites that pay Bitcoin for free. Some common, some not so much. Check it out. Free Daily Bitcoins
LikeLike
How much you spent on AWS and How many BTC you got as a result of this exercise?
LikeLike
I spent way more than I made. The BTC yield was < 0.1.
LikeLike
Very fun and VERY EXPENSIVE:
Cluster GPU Instances
Quadruple Extra Large $2.10 per Hour
That’s U$ 1500 plus a month!
LikeLike