Pages:
Author

Topic: Mining on Amazon EC2 (scrypt or BTC) - page 2. (Read 28210 times)

sr. member
Activity: 434
Merit: 250
April 08, 2013, 01: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.
member
Activity: 68
Merit: 10
April 08, 2013, 01:28:34 AM
#2
Thank you for this. I was considering EC2 mining and you just saved me a lot of legwork.
sr. member
Activity: 378
Merit: 255
April 07, 2013, 01:53:56 AM
#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
Pages:
Jump to: