Bitcoin Forum
May 10, 2024, 08:06:18 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Mining on Amazon EC2 (scrypt or BTC)  (Read 28189 times)
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
April 07, 2013, 05:53:56 AM
Last edit: April 07, 2013, 06:10:47 AM by rethaw
 #1

I received $100 in AWS credit, here's how I spent it.

Choosing an instance

I selected the 12.04.1 Ubuntu Server for Cluster as the base configuration (AMI). Without selecting a cluster AMI I couldn't get access to the GPU systems in a later dialog.

Amazon lets you bid on their extra compute time with Spot Instances. You choose the amount you're willing to pay for a specific configuration, and as long as you're not outbid, it's yours.

I bid $0.356 for cg1.4xlarge. This is what you get:

Quote
Cluster GPU Quadruple Extra Large Instance

22 GiB of memory
33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core)
2 x NVIDIA Tesla “Fermi” M2050 GPUs
1690 GB of instance storage
64-bit platform
I/O Performance: Very High (10 Gigabit Ethernet)
EBS-Optimized Available: No**
API name: cg1.4xlarge


Setting up SSH to connect to the system was easy; their web interface walks you through downloading and using a key.

As far as I can tell, only the North Virginia EC2 center has these instances.

Setting up the environment

You'll notice I've installed some GL packages. I wanted my instance to be able to compile all the CUDA SDK samples, obviously not required if you only plan to mine. I also built the files locally.

Code:
sudo apt-get update
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev gcc make libcurl4-openssl-dev autoconf git screen libncurses5-dev libdb4.8-dev -y

Install Drivers and CUDA

Nvidia has kindly put all of the files in a single download.

Code:
wget http://developer.download.nvidia.com/compute/cuda/5_0/rel-update-1/installers/cuda_5.0.35_linux_64_ubuntu11.10-1.run
sudo bash cuda_5.0.35_linux_64_ubuntu11.10-1.run

I did choose to install the samples, as mentioned above. I needed to use this script provided by nvidia, to load the driver.

Code:
#!/bin/bash
/sbin/modprobe nvidia

if [ "$?" -eq 0 ]; then
  # Count the number of NVIDIA controllers found.
  NVDEVS=`lspci | grep -i NVIDIA`
  N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
  NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l`

  N=`expr $N3D + $NVGA - 1`
  for i in `seq 0 $N`; do
    mknod -m 666 /dev/nvidia$i c 195 $i
  done

  mknod -m 666 /dev/nvidiactl c 195 255

else
  exit 1
fi

I wanted libglut for the samples, putting CUDA in LD_LIBRARY_PATH was necessary.

Code:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so /usr/lib/libglut.so
export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib

You can choose to `make` the CUDA samples and use one, deviceQuery, to see if you can see the Tesla's. You can also run `sudo nvidia-smi -a` to take a closer look.

Building and running cgminer

Code:
git clone https://github.com/ckolivas/cgminer.git
cd cgminer
./autogen.sh
CFLAGS="-O2 -Wall -march=native -I/usr/local/cuda/include" LDFLAGS="-L/usr/local/cuda/lib64" ./configure --enable-scrypt
make

Once `make` completes you can run cgminer to either mine LTC or BTC.

For mining BTC I got roughly 192 MH/s using:

Code:
screen ./cgminer -o http://pool:port -u user -p pass -I 10 -v 2 --verbose -w 256

And for LTC, or other scrypt-based coins:

Code:
screen ./cgminer -o http://pool:port -u user -p pass -I 11 -v 2 --shaders 448 --scrypt

For mining litecoin, you may choose to run pooler's `cpuminer` as well. Does cgminer have scrypt CPU mining?

Conclusion

If you are looking for an opportunity to learn how to use Amazon's EC2 you can do it for free. The free instances don't have access to a Tesla, but you can learn a lot without spending any money.

Mining on a Tesla is not profitable. With the roughly 200 MH/s the pair provides, and today's exchange and difficulty1, a miner can expect to mine $1.89 per day. The daily cost per instance, including two M2050s, is $8.64. If you're interested in getting your hands on some BTC, there are better ways.

What do you think would have happened in the alternate history, in which Amazon had built out an AMD GPU farm?

1 .0069 BTC/$, and a 7.6m difficulty.

http://rohitnair.info/mining-bitcoins-for-fun-and-very-little-profitability/
Old bitcointalk EC2 topic
http://en.wikipedia.org/wiki/Nvidia_Tesla
https://github.com/jgarzik/cpuminer
https://github.com/ckolivas/cgminer

1715328378
Hero Member
*
Offline Offline

Posts: 1715328378

View Profile Personal Message (Offline)

Ignore
1715328378
Reply with quote  #2

1715328378
Report to moderator
1715328378
Hero Member
*
Offline Offline

Posts: 1715328378

View Profile Personal Message (Offline)

Ignore
1715328378
Reply with quote  #2

1715328378
Report to moderator
1715328378
Hero Member
*
Offline Offline

Posts: 1715328378

View Profile Personal Message (Offline)

Ignore
1715328378
Reply with quote  #2

1715328378
Report to moderator
The forum strives to allow free discussion of any ideas. All policies are built around this principle. This doesn't mean you can post garbage, though: posts should actually contain ideas, and these ideas should be argued reasonably.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715328378
Hero Member
*
Offline Offline

Posts: 1715328378

View Profile Personal Message (Offline)

Ignore
1715328378
Reply with quote  #2

1715328378
Report to moderator
Landstander
Member
**
Offline Offline

Activity: 68
Merit: 10



View Profile
April 08, 2013, 05:28:34 AM
 #2

Thank you for this. I was considering EC2 mining and you just saved me a lot of legwork.

1LnV7h5xrFQ98HNxctKaASbB4xRBccT5Gm     Thanks!
roy7
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
April 08, 2013, 05:32:12 AM
 #3

I run a cpuminer on the free EC2 since, why not, it's free and fun. Smiley But I've seen 3 different people mention they are working on new cuda code that is 2x-3x faster than current cgminer on nVidia GPUs. Still won't make the Tesla EC2 worth while, but it's closer.
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
April 09, 2013, 03:15:50 AM
 #4

Thank you for this. I was considering EC2 mining and you just saved me a lot of legwork.

No problem! Hope I saved you some money too!

But I've seen 3 different people mention they are working on new cuda code that is 2x-3x faster than current cgminer on nVidia GPUs. Still won't make the Tesla EC2 worth while, but it's closer.

Care to link to a post? The next generation of Tesla still greatly underperform AMD cards for mining. With this setup the profit/loss is less than .25. However, I'm curious about improvements in nvidia kernels.

roy7
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
April 09, 2013, 03:20:36 AM
 #5

rethaw, I didn't bookmark them, but I re-found these:

https://bitcointalk.org/index.php?topic=167229.0
https://bitcointalk.org/index.php?topic=163750.0
baad
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
April 09, 2013, 03:24:41 AM
 #6

Great help, thanks!
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
April 10, 2013, 04:31:47 AM
 #7


I tried both of these out using the M2050s on EC2.

Using rpcminer-cuda, I saw a minimal improvement over cgminer for mining Bitcoin. Anecdotally 5Mhash/s faster, but without the Kepler architecture there is little benefit.

Using cudaminer, scrypt mining saw a marked improvement: at least 40kh/s faster.

roy7
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
April 10, 2013, 04:36:07 AM
 #8

Thank you for testing and reporting back. Smiley
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
May 14, 2013, 03:48:14 AM
 #9

In a befuddling turn of events about a month ago the price of a GPU spot instance on US-east increased by an order of magnitude (at least). Perhaps someone decided they could start mining altcoins?



I paid $.36/hr in the beginning in April, the dip you see in the last two weeks is to $3.00/hr.

roy7
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
May 14, 2013, 03:57:53 AM
 #10

If Amazon ever offers ATI GPU farms, that might happen. Don't see how the Tesla farms can be cost effective though.
Signus
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
May 14, 2013, 11:53:19 AM
 #11

Thank you for this. I was considering EC2 mining and you just saved me a lot of legwork.

Definitely, I gave it a shot a while back. Even at a lower difficulty it wasn't worth the cost.

They charged me for multiple server instances that wouldn't spin up. I tried to fight it because they were having problems with multiple corrupt images apparently, but they didn't feel like my problem was worth a refund. When they finally pointed me to an instance I could spin up, it couldn't get over 80Mh/s on a GPU cluster.

Even a Tesla CLUSTER should be able to produce more than that. My own CPU does that while sweating profusely, but does it nonetheless.
endriuska
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
May 14, 2013, 01:13:49 PM
 #12

I run a cpuminer on the free EC2 since, why not, it's free and fun.

How many mhs or khs are you getting on free instance?
ewitte
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
May 14, 2013, 01:27:15 PM
 #13

Titan and future cards are 2-3x faster with the right program.  Still not on par with AMD.  350MH on a $1k card lol.

Donations
BTC - 13Lgy6fb4d3nSYEf2nkgBgyBkkhPw8zkPd
LTC - LegzRwyc2Xhu8cqvaW2jwRrqSnhyaYU6gZ
roy7
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
May 14, 2013, 01:31:34 PM
 #14

I run a cpuminer on the free EC2 since, why not, it's free and fun.

How many mhs or khs are you getting on free instance?

I think it was like 10-15? I don't mine on it any more since I'm using it to test my pool out, but was fun learning how EC worked and such. Smiley
endriuska
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
May 14, 2013, 01:37:38 PM
 #15

was it on windows or unix?
ewitte
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
May 14, 2013, 01:46:12 PM
 #16

You can usually get 6-10KH per core on a newish Xeon.  I've tried it on a dual 8 core and pulled about 165MH/s off it (with hyperthreading on).

Donations
BTC - 13Lgy6fb4d3nSYEf2nkgBgyBkkhPw8zkPd
LTC - LegzRwyc2Xhu8cqvaW2jwRrqSnhyaYU6gZ
roy7
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
May 14, 2013, 01:47:33 PM
 #17

was it on windows or unix?

I was running Ubuntu on a micro server.
Molex1701
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
October 25, 2013, 05:37:34 PM
 #18

12.04.1 Ubuntu Server for Cluster

I guess they don't offer this version any more. I only see one for HVM instances and didn't see cgi as an option there.   I do see a red hat and that does offer cgi instances there.  Its 0.346 per hour. I've been wondering with BTC at $160 and higher if worth it?  Even ltc at 2.20 ish.  I got a number of credits to use.

Well I'll see if I can get it going and let you know stats.  I'm not very good at linux stuff though Sad

Gotta go fast!
Newbie
*
Offline Offline

Activity: 45
Merit: 0



View Profile
October 27, 2013, 02:16:42 PM
 #19

12.04.1 Ubuntu Server for Cluster

I guess they don't offer this version any more. I only see one for HVM instances and didn't see cgi as an option there.   I do see a red hat and that does offer cgi instances there.  Its 0.346 per hour. I've been wondering with BTC at $160 and higher if worth it?  Even ltc at 2.20 ish.  I got a number of credits to use.

Well I'll see if I can get it going and let you know stats.  I'm not very good at linux stuff though Sad



You would waste a lot of money by mining bitcoin on an Amazon EC3 instance. Remember that they are not ASIC miners!!
Aalesund
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
October 27, 2013, 05:53:58 PM
 #20

I think you'll have a good profit if you mining alternative currencies as SRC.
For them, you need a good and powerful CPU.
The people use EC2 for CPU mining, SRC or QRK, however QRK is very cheap, so it is better to mine SRC.

Let's color the MOON: YN4VBGgcmm7nAGqhc2zeUN7eJXCxfWyWGa
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!