📜 ⬆️ ⬇️

Bitcoin: implementation of the farm of two ati 7850 video cards on ubuntu

Good time of the day, habrazhiteli.


This is my first post on getting an invite for which they gave an invite (thanks!). Nothing smarter came to mind than to unsubscribe about their own bitcoin mining experience (BTC).
Building and setting up a BTC production farm has already been described on Habrahabr, and on various thematic areas, pools. However, in the process, all sorts of non-statements of articles came out, and therefore I had to google and perform tests, in my case, on a working file server.
So let's get started:

The currency of Bitcoin, with all its flaws that can lead to generally accepted statements:

- this is a pyramid;
- it is not supported by anything currency, tomorrow it will depreciate;
- the exchange rate is unstable;
- why is it;
It has an important and undeniable dignity - a good course for the dollar.
Based on the above, I believe that this is a salary that should not be neglected. And for about a year, BTC extracted on 3 ATI video cards installed on the machines of engineering engineers during off-hours.
During the year, it mined at a speed of 200 MH / s per night, which was about 0.02 BTC per day. When at the beginning of April 2013, the rate went up steadily, I received the ruble equivalent of my savings at the rate of 1 BTC = $ 200, which in terms of rubles amounted to about 15,000.
The rate again fell to $ 100-120 for 1 BTC, and I was thinking about making a profit similar to my official salary in the region.
Two ATI 7850 video cards manufactured by Gigabyte were purchased at a nearby store for 5500 rubles apiece and mounted into a file server, also called a torrent for ubuntu 12. The choice was made based on the availability of 2 PCI-E ports and a power supply in the motherboard for 500 watts.
bessome@xxx:~$ uname -a Linux xxx 3.5.0-22-generic #34-Ubuntu SMP Tue Jan 8 21:47:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux 


Ubuntu stood with a graphical shell, so it only remained to roll out the driver. Everything I did was taken from here.
If scattered in stages, it looked like this:
1. Preparation
 sudo apt-get update sudo apt-get upgrade sudo apt-get remove nvidia-common sudo apt-get install libqtgui4 python-setuptools python-numpy subversion g++ libboost-all-dev autoconf 


2. Download ATI drivers (13.1 at the moment) from ati.com (since the video cards are relatively new, and the files by reference may simply not see the video cards).
3. Install the driver "sh atixxxxxxxxx.run --install" - I did without assembling the packages. Yes, in the process I installed linux-headers ( apt-get install linux-headers-(uname -r) ) for the current kernel.
Be sure to run:
 aticonfig -f --initial --adapter=all cd /opt/ mkdir bfgminer 

4. Install python-jsonrpc
 svn checkout svn.json-rpc.org/trunk/python-jsonrpc cd python-jsonrpc/ sudo python setup.py install 

5. Download and install bfgminer:
 wget https://github.com/luke-jr/bfgminer/archive/bfgminer.zip 

unpacking
 unzip bfgminer.zip 

We collect:
 ./autogen.sh 

Compile:
 make -j3 

')
After everything done in the bfgminer-xxx folder, the bfgminer executable file appears. When you start the miner itself finds all the cards, starts to mine BTC. Start line a little further.

It turned out that the average speed of 200 MH / s from one video card was expecting more. It should be noted that when the crossfire is turned on in the ATI Control Panel (I installed it during installation, and it turned out that the distance between the PIC_E ports of the motherboard is too big - I had to pull it), the performance drops, so I removed this posting and sighed calmly.
When studying aticonfig --help, the following script was born:
 #!/bin/sh export DISPLAY=:0.0 /usr/bin/aticonfig --od-disable --adapter=0 /usr/bin/aticonfig --od-enable --adapter=0 /usr/bin/aticonfig --adapter=0 --od-setclocks=1150,1200 /usr/bin/aticonfig --pplib-cmd "set fanspeed 0 80" export DISPLAY=:0.1 /usr/bin/aticonfig --od-disable --adapter=1 /usr/bin/aticonfig --od-enable --adapter=1 /usr/bin/aticonfig --pplib-cmd "set fanspeed 1 80" /usr/bin/aticonfig --adapter=1 --od-setclocks=1150,1200 /opt/bfgminer-2.6.3/bfgminer --url http://pit.deepbit.net:8332 -O xxxx@xxxx.xx:xxxxxx --gpu-dyninterval 7 


It actually does this: first for video card 0 (default), then for video card 1 it turns off (suddenly the script restarts) and turns on overdrive (od) and allows you to set the frequency of the video card processor (GPU) and the video card memory. --od-setclock = CPU frequency, memory frequency.
When testing, I deduced that the memory frequency does not affect the mining and set at the lower limit. As for the frequency of the GPU, it turned out that the driver falls at a frequency above 1150 Megahertz. I suppose this is due to the power of the power supply, which has two graphics cards, a motherboard, a processor, cooling and hard just simply doesn’t pull out. On average, the performance of one card after overclocking was 350 Megacheshs, which completely satisfied me.
aticonfig --adapter = x --od-gettemperature - see the temperature of adapter x.

Bfgminer output itself:
image

Now count the money:

At present, the rate BTC / USD = $ 120 / BTC. The exchange rate of $ to the ruble is 31.46 for 1 USD.
deepbit.net shows that I mine about 0.06 BTC per day.
In the current situation, below $ 100 I’ll not sell exactly 1 BTC, that is, at least
30 * 0.06 = 1.8 BTC per month.
$ 100 * 1.8 = $ 180 per month.
$ 180 * 31.4 = 5,650 per month.
That is, for 2 months of the file server, if I do not sleep in the office, I will return the cost of the video card and go to the net profit. A nice increase in salary. By the way, withdrawal of BTC in rubles costs me 6% of the amount.

Now we are looking at what it takes to have 35,000 rubles a month without doing anything:

1. Free electricity (although the cost of it is very small - 10%, according to my calculations). For example, if you mine at home on the loggia - the best cooling and noise insulation, you can put a three-zone electric meter and save at night.
2. Motherboard with 2 or more PCI-E connectors = 3000 rubles. I look in the direction of mothers under AMD, for they are cheaper; processor from 3000 rubles; memory 700 rubles - a penny. The video card is from 5500 rubles per piece, I plan to put at least 3 pieces on the motherboard; 2 power supply units of 1500 rubles each (one for the motherboard is mandatory with a power connector for a video card; the second one with two connectors for a video card - there are some more expensive). That is, one power supply will power the video card, another motherboard, and if that duplicate the first one. The case is not needed, airflow will be better. In total on a farm there are 26200 rubles.
3. One farm produces at a speed of 350 * 3 = 1050 MH / s, which will be in rubles
(0.08 BTC * 30 days * $ 100 * 31.4 rubles) = 7500 rubles per month
and fully pay for itself in 4 months.
4. To have 35,000 per month you need 5 (almost) farms. We consider 5 * 26200 = 131 000 rubles (the cost of a non-prestigious second-hand foreign car or VAZ of the year that way 2000 release).
5 recalculate the return on investment:
5 farms * 1050 MH / s = 5250 MH / s,
that is, 0.4 BTC per day.
0.4 * 30 days * $ 100 * 31.4 = 37 680 (- 10% electricity 3768 = 33 912 rubles).

UPD 04/26/2013: Attention, to get the same profit at the same rate BTC / USD = $ 120 (as currently possible), the number of farms was recalculated for 3 video cards (1050 MH / s): if a week ago there were 4.7 farms, then at the moment 5.3 farms. That is, our five farms already bring 32,883 rubles, excluding the cost of electricity.
However, the rate has grown during this time and amounts to $ 140 / BTC, so that’s what happened.
The growing complexity of the exhibitor calls into question the further "amateur" mining on one or two video cards.


Or 452,160 rubles per year. The annual return on investment is 245%.
6. Since the processor is free (I have a 7% load), you can make a small data center a la cloud, and place sites on it, for example.
7. Analyzing the history of the growth of complexity from here , I came to the conclusion that the graph of the growth of complexity is similar to the exponent (Exponential function (exponent). This is a function of the form f (x) = a to the power of x. The conclusion is simple: with each block the complexity will increase several times In my estimation, about 14% per week so far. So I’m waiting for either the release of super-fast video cards or BTC production optimizations. However, I suspect that with increasing complexity, the BTC / USD rate will somehow grow.

Unsolved problems and disadvantages:

1. Autostart of the script from rc.local and autoload of the graphical shell through cron and autorun Gnome does not work, I figure it out.
UDP 04/26/2013 - the start-stop-daemon from autoload and from rc.local also does not start the script. Apparently something is wrong with my ubuntu.
2. The launch of the script in the PuTTy-type terminal swears at the absence of the Xs, but bfgminer itself starts.
3. Heats up not much, something about 72 degrees on the video card. Apparently, because new. We look at the temperature with the command aticonfig --odgt --adapter=all , the speed of the cooler is aticonfig --pplib-cmd "get fanspeed 0" for card 0 or aticonfig --pplib-cmd "get fanspeed 1" for card 1.
4. The first video card (which default) gets at a slightly lower speed, 30 MH / s less. Apparently because it still pulls the desktop with graphics and TeamViewer. Solve the problem, I think the best way is to purchase a motherboard with a video card embedded in the chipset, and hook up the monitor to it, run the Xs.
UPD 04/26/2013: disabled everything in comipz, including the panels. One desktop, on it a label for mining. Everything else is run through the terminal. Now the difference is ~ 10 MH / s

It is necessary to take into account the depreciation of equipment and the increasing complexity of calculating hashes. The solution is simple, when the video card turns 8 to 9 months, we put it on sale, for 60-70% of the cost, in return we acquire a new modern one. There is no need to skimp, you can lose more in the form of a drop in the amount of BTC earned or a destroyed video card.

Conclusions about the use of such a method of earnings leave the audience, I ask the battle not to start. I think that everyone will decide for himself the question of the need to participate in such a “pyramid” of making money.
Those who have read this line up: “Thank you for your attention! ".

Source: https://habr.com/ru/post/177643/


All Articles