Mining: the technical part

From Bitcoin Wiki
(Redirected from All about mining)
Jump to: navigation, search

SHA-256 and Scrypt mining[edit]

Due to popularity growth of Bitcoin at the end of 2013, the mining difficulty has increased for many times. This was also caused by the fact that many large investors began to buy ASIC equipment for Bitcoin mining on an industrial scale. It all led to the fact that SHA-256 crypto currency mining without special equipment ceased to be profitable (Bitcoin is the most profitable crypto currency based on SHA-256 algorithm for mining). For comparison, one ASIC unit on average had a capacity of 600000 Mh/s, and the most powerful GPU - ~850 Mh/s.

This is why the mining of the scrypt cryptocurrencies started gaining popularity.

The scrypt mining or GPU mining is not like Bitcoin mining because of algorithm differences. For mining of Litecoin, as well as its various forks on the scrypt algorithm, this article will discuss the important technical characteristics, as well as hardware compatibility, software and the most popular software – the miner, in particular the most stable and flexibly configurable CGMINER.

CPU and GPU mining[edit]

Now let’s make it clear the why graphics card (GPU) fits scrypt mining better than the central processing unit (CPU).

The processor (CPU) was developed to make decisions according to the programs’ directions. Also, the processor performs a great number of other operations. The graphics adapter (GPU) is able to carry out many similar tasks very fast and effectively, but at the same time it switches to another task slowly.

One CPU core executes 4 32-bit instructions per clock (SSE) or 8 32-bit instructions per clock (AVX), whereas a Radeon HD 5970 GPU is able to process 3200 32-bit instructions per clock (using its 3200 ALU or shader unit). It turns out that in this example a GPU can process 800 (or 400 (with AVX)) times more instructions per clock, than CPU.

Even despite that since 2011 the CPUs have been produced with 6, 8 and 12 cores and clock speed of nearly 2000-3000Mhz and more, a Radeon HD 5970 GPU (with clock speed of 750 MHz) remains more than 5 times faster than four 12-core CPUs with clock speed of 2.3 GHz (while the price of the latter around $4700, in contrast to $350 for HD5970).

Mining on GPUs by AMD and NVIDIA[edit]

NVIDIA graphics adapters, due to their design features, are currently less capable and make farm building several times more expensive than with AMD solutions. For comparison – the most capable NVIDIA graphic cards have a capacity of ~150 Kh/s, AMD has 1500 Kh/s. But NVIDIA has a “Tesla S2070” card, which gives 700 Kh/s, however its price is $1360 against $510 for the most powerful cards by AMD.

Technical part[edit]

Mining farm with well-designed cooling


Mining farm components[edit]

The main components of the farm are nearly the same as those of a regular computer, with several exceptions:

  • Motherboard. It should not be cheap and have 4 or more PCI-e slots (for graphics cards).
  • Processor. Its capacity is not needed for the scrypt mining of Litecoin and its forks. This is why the cheapest one is chosen, which fits the motherboard.
  • DDR memory. Size from 4Gb, the simplest and cheapest one.
  • Hard disk drive. Doesn’t play any role. It is needed to install the OS and to store wallets, so a simple flash stick fits.
  • Power supply. The main engine of the whole farm, so the choice must be done carefully and without hasty conclusions. The power supply capacity should be chosen with a margin of 150-200 watts, considering the power consumed by other components except the graphics cards.
  • Graphics card. The main and the most expensive component of a mining farm conducting calculation of hash functions of the blocks. Specifications and speeds of many graphics cards are displayed by users in tables on various portals. Here you will find links to them.
  • Cooling system. It must be well-designed to move the hot air away from graphics cards. In order to do this, the space between the graphics cards must be no shorter than ~8cm. Also, a water cooling system can be used – it cools the graphics cards better and doesn’t produce as much noise as air cooling, but is more technically complicated. Of the most sophisticated cooling system variants, we can empathize the oil cooling when all the hardware is fully submerged into a reservoir with technical oil (some “craftsmen” submerged the components into vegetable oil). An example of definition can be seen in this article [1].

There are currently a great number of graphics cards on the market, which suit for mining. The largest list of these graphics cards is available on [litecoin.info]. Here you can see the basic data of the mining: graphics cards’ specs and settings, but all of them are conditional, because every farm is being set up individually and depends on a great number of factors which will be considered below.

Some graphics cards are already deprecated and they are impossible to find in the necessary number and condition. We will discuss graphics cards which are available on the market, as it will give an opportunity to make a mining farm of a necessary capacity. GPU mining, as well as the farm building, doesn’t have standard solutions, so your results on achieving the maximum capacity and stability depend on many factors, which are listed below.

Mining farm

Graphics card overclocking[edit]

The selection of optimal parameters of memory clock speed and core clock speed must be done individually for each graphics card. These parameters affect both the mining rate and the whole system stability. Also, overclocking affects temperature and energy consumption of the graphics cards. The more is the GPU overclocking, the more are the farm demands for the cooling system.

Hardware compatibility[edit]

If the system has different card series, or cards of one series but by different manufacturers, conflicts are possible during launch and overclocking, which will affect the maximum speed and the whole farm stability. Hardware combinations for a farm also affect the hash rate. A correct choice of farm components like motherboard and RAM also increases the stability and the mining speed of a farm. For example, as said before: the lack of standard solutions in scrypt mining leads to the fact that the same values and settings of the video adapters are often ineffective when applying to another farm configuration.

Mining farm building peculiarities[edit]

When building farms, one should do some calculations to know the most profitable variant. It’s necessary to calculate the total cost of the farm, choosing the most profitable components by profitablility and energy consumption. You need to know energy consumption of the whole farm and calculate 24 hours charges for energy. Considering these calculations, you can draw a conclusion on the payback period. To make this task easier, there are many mining calculators: from simple ones, which consider only the crypto currencies’ exchange rate and farm speed, to detailed ones, which consider exchange rate, speed, energy consumption, 1kWh, difficulty and exchange rate changes during the time.

Mining on cloud serviers[edit]

There are companies that provide their equipment capacity for a certain amount of money per month. This way is relevant for crypto currencies, which have only CPU mining. It is profitable in two cases: when the company provides a free trial period, or when the crypto currency complexity is low and the exchange rate is high.

Software part[edit]

Operating systems and mining software.

Operating systems[edit]

OS installed on the mining farm may affect the crypto coins mining speed. Linux The most popular OS among miners.

Pros

  • Quick setup (5-10 minutes)
  • Occupies a little disk space (2Gb)
  • Support of up to 8 graphics cards
  • Doesn’t need to be activated

Cons

  • There may be difficulties for a beginner when using for the first time.
  • If you install the OS on a flash stick, it’s difficult to store big wallets.

Windows 7[edit]

Pros

  • Available and easy to set up and use for the majority of users

Cons

  • Supports up to 4 graphics cards

Windows 8[edit]

Pros

  • Available and easy to set up and use for the majority of users

Cons

  • Supports up to 5 graphics cards

Scrypt-Miner 1.2[edit]

The OS developed by «craftsmen», based on Linux. Monitoring tools are brought to the main screen. A detailed description of installation and setup is available here club.dns-shop.ru

Drivers[edit]

The right driver version choice is very important. Sometimes particular driver versions lower the total computational capacity of the scrypt mining equipment. At the same time the others, on the contrary, allow to achieve high hash rate. APP AMD SDK version must be 2.6 or higher, you can download an update for your system from the AMD official website.

Mining software[edit]

There are several main mining programs - bfgminer, ufasoft miner, diablo miner, phoenix, guiminer, cgminer. The most flexible in configuring, stable and informative miner is CGminer. So we will discuss it.

CGminer[edit]

CGminer is managed via the command line. To ensure that you do not need to reconfigure all the settings every launch or when you change the crypto currency, it is easier to create a .bat file and write all the settings here. This file is created in the miner’s folder as a text document (notepad) with .bat extension. The basic setup for the miner to work looks like this: cgminer --scrypt -o stratum+tcp://east1.us.stratum.dedicatedpool.com:3351 -u user.1 -p x

  • cgminer – points to the executable
  • --scrypt – instructs the miner on the mined crypto currency’s algorithm
  • -o – after this, a pool address is specified stratum+tcp://east1.us.stratum.dedicatedpool.com: and a port 3351. This data can be found at all the pools, in "Getting Started" section.
  • -u user.1 – specifying the pool login and the created worker name
  • -p x – specifying the password for the created worker

Advanced settings to enhance the miner’s performance.

--auto-fan Automatically adjusts the GPU fan speed to maintained the specified temperature (value: no);
--auto-gpu Automatically adjusts the GPU clock speed to maintained the specified temperature (value: no);
--device (-d) Allows to select particular device for the work, everything works by default (example: --device 0);
--disable-gpu (-G) Disable GPU (value: no);
--gpu-threads (-g) Threads per GPU (values: 1 - 10, default 2, example: --gpu-threads 2);
--gpu-dyninterval Set the refresh interval in ms for GPUs using dynamic intensity (default: 7);
--gpu-engine Sets the GPU core clock speed, it is possible to set a range (example: --gpu-engine 900 or 800-900);
--gpu-fan Sets the fan speed in percentage, fixed or a range (example: --gpu-fan 25 or 25-65);
--gpu-map Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1);
--gpu-memclock Sets the memory clock speed (for BTC it is better to lower the clock speed, for LTC – to raise it, example: --gpu-memclock 1800);
--gpu-memdiff Set the fixed difference in MHz between core and memory speed (example: --gpu-memdiff ???);
--gpu-powertune Set the GPU powertune in percentage;
--gpu-reorder Reorder graphics cards;
--gpu-vddc Change GPU core voltage, in volts (example: --gpu-vddc 1.125);
--intensity (-I) Aggression (intensity) (values: 10 - 14, d - dynamic, example --intensity 13 or d);
--kernel (-k) Specifies a kernel to work with the device (kernels: diablo, poclbm, phatk, diakgcn, example: --kernel diakgcn) (help is needed to select a kernel for card series);
--ndevs (-n) List all devices along with their numbers and exit;
--temp-hysteresis How much the temperature may differ from the target (default: 3, example: --temp-hysteresis 15);
--temp-overheat Temperature in degrees to reset core clock speed and raise the fan speed (default: 85, example: --temp-overheat 90);
--temp-target Set the target temperature in degrees (default: 75, example: --temp-target 80);
--vectors (-v) Set the vectors’ width, auto by default (values: 1, 2 and 4, example: --vectors 2);
--worksize (-w) Set the memory size, barely affects performance (default: auto, the value must be a power of 2 - 64, 128, 256, 512, 1024, 256 is recommended, example: --worksize 256).

Intensity is the key figure affecting the miner's work speed, its value is set from 0 to 20. One must consider that a too high intensity can negatively affect the mining speed, because it MAY exhaust all available memory and actually reduce the mining speed in the best case. In the worst case – there will appear a lot of miscalculations and HW errors. Take into account that if the intensity is not set, CGMiner will adjust it itself, dynamically, to provide an opportunity of convenient work with the PC.

Thread-concurrency controls an optimal volume of calculations which a scrypt algorithm can do. It is set up by default to use a few threads on all shader blocks the graphics card has at a maximum. The value must be a multiple of the number of shader blocks of the graphics card. So, if «thread-concurrency» is specified, «shaders» may be removed.

It is recommended to spend some time to find the best value for your graphics card in order to get the best performance.

An example of a .bat file for R9 290 tri x on 940kh:

--setx GPU_MAX_ALLOC_PERCENT 100
--setx GPU_USE_SYNC_OBJECTS 1
--cgminer.exe --scrypt --worksize 256 --intensity 20 --auto-fan --lookup-gap 2  --thread-concurrency 25614 --gpu-engine 1050 
-- gpu-memclock 1600 --gpu-powertune 20 -o pool address: port -u worker -p password

AMD graphics cards specs[edit]

Since AMD is producing R-series cards now we will consider R9 series as the main for the review. Because it is the most economically profitable considering the PRICE / ENERGY CONSUMPTION / CALCULATION CAPACITY.

The most profitable AMD graphics cards’ features[edit]

R9 290

A drawback of the reference R9 290x and R9 290 was card cooling without any additional cooling while mining. They heated up considerably, up to 90-100 degrees, which is not acceptable for 24/7/365 mining and forced the owners of such farms to either mod the cooling system of the graphics card, which did void the warranty in some cases, or organize the ventilation and air conditioning system. Thus, the increasing costs and payback periods appeared. But today there are quite a lot of non-reference solutions from almost all manufacturers, which made R9 290x and R9 290 very interesting for building powerful, compact and cold enough farms.

R9 280x

To date, the majority of miners consider the golden mean constructing farms on these video adapters. This series will allow a powerful, middle-sized farm.

R9 270x-270

Also suit for constructing farms on their base. But this will be the biggest farms in size and the number of connected wires. On their bas, an additional number of risers will be required, which are additional expenses.

Comparison of graphics cards[edit]

Below, there are some statistic data about the performance of various mining equipment. The columns are sorted for the comparison convenience.

Notes:

  • kH/s or kHps or kHash/s – kilohash per second or the total speed of all cores on CPU or GPU The clock speed is given in MHz
  • Voltage: next to the voltage, the firmware or the fact that the voltage change is blocked by the manufacturer is given. Y - blocked, N – not blocked, U – unblocked by the reflash, ? – no info
  • C – video processor clock speed, M – memory clock speed, V-voltage, W- energy consumption.

5700 Series[edit]

The graphics cards of this series are low-powered with the speed up to 200 kH/s. The energy consumption is low. But it is unprofitable to build a farm of them as a big number of them will be needed, which makes the construction of the farm money-losing despite their low cost.

5800 Series[edit]

The capacity of the card in this series varies from 300 to 450 kH/s. The energy consumption is a little bit higher than at 5700. Small farms can be constructed of such graphics cards, for example, for an acquaintance with the mining sphere or small additional income as they have a low price.

5900 Series[edit]

These are powerful cards with the speeds 700-800 kH/s. In capacity, they can compete with 7900 series. Uses much more capacity than the previous 2 series - ~300 watts. The average price is 11,000 – 13,000 RUR.

6300, 6400, 6700 Series[edit]

Low-powered cards, the speed is up to 230 kH/s. The energy consumption is low, up to 150 watts.
The average price is 3,500 RUR.

6800 Series

The average capacity is 200-350 kH/s. The average price is 5,500 RUR. The energy consumption is up to 200 watts.

690 Series[edit]

Cards of medium capacity of 400-500 kH/s, excluding the graphics card 6990 that has the speed of 800 kH/s. The energy consumption is high, 230-400 watts. 6990 uses 430 watts.The average price is 10, 000 RUR. This makes them unprofitable as they use as much capacity as faster cards.

7700 Series[edit]

The speed of the cards in this series lies in wide limits from 40 to 270 kH/s. With the energy consumption up to 150 watts and the price up to 6000 RUR, they are much more profitable of the low-powered cards described above.

7800 Series[edit]

The capacity is 350-500 kH/s. The energy consumption is 130-220 watts. The average price is 10,500 RUB. They are also unprofitable in the light of the cost/capacity ratio.

7900 Series[edit]

Graphics cards of this series are popular in mining, especially 7970 that in capacity is similar to R9 280 series. Big capacity of 600-800 kH/s, big energy consumption 250-350 watts, the cost is 13,000 – 16,000 RUR. The further price growth is possible due to the growing popularity of mining.


7990 Series[edit]

The newest graphics cards by AMD. For calculating the tasks, 2 cores are used in them. So, when installing 1 card in the farm, it will be equal to 2 and there, where 6 graphics cards could be installed, no more than 3 such monsters would be installed. The largest ones in size. The highest speed among all existing graphics cards - 1100-1500 kH/s, the biggest energy consumption – 450-500 watts. The price is ~ 35,000 RUR. In some online stores it may reach 50,000. Due to such characteristics, the payback of the farm with such graphics cards will be long. They are profitable with a free use of electricity.

R9 270 Series[edit]

Another popular series among miners. The average cost is 7500 RUR. The capacity is 450-500 kH/s, consumption - 180-230 watts. Are not the most profitable ones

R9 280 Series[edit]

At the moment they are the most popular graphics cards among miners due to the best price /capacity ratio. The capacity is 570-800 kH/s. The energy consumption is 250-330 watts. The price is 15000-18000 RUR. The price increased recently due to a fast growth of demand for them. It is difficult to find them in stock.

R9 290 Series[edit]

The third most popular series after r9 280 and 7970. The capacity is 750-1000 kH/s, with the energy consumption of 250-470 watts. The price is ~ 20,000 RUR. According to the users of these cards, their cooling system is worse than by younger series, which is why when building a farm with such cards, it is necessary to construct a good cooling system.

Characteristics of NVIDIA graphics cards[edit]

The graphics cards by this brand are extremely unprofitable for mining as with the similar cost to the equipment by AMD, they have a much smaller capacity – 500 kH/s maximum. In this regard, such graphics cards don’t enjoy popularity among miners, which is why they are sorted below by capacity only.

Capacity up to 100 kH/s

Capacity of 100-200 kH/s[edit]

Сapacity of 200-500 kH/s[edit]

Characteristics of central processing units (CPU mining)[edit]

The mining with the use of the CPU capacities is essential only on some crypto currencies where the CPU mining is possible. The main such currency is QuarkCoin. In all other cases the CPU mining is not essential as the processor capacities are even less than by NVIDIA cards. Let’s view the processors by AMD and Intel. Here, AMD loses in capacity: the maximum capacity of AMD processors is 65 kH/s against 130 kH/s by Intel. Mining with the use of the CPU capacity is relevant only in some cryptocurrencies, where possible, only CPU-mining. The main such currency is QuarkCoin. In all other cases, cpu-mining is not relevant, since the capacity of processors is even less than NVIDIA cards.

AMD cpu[edit]

Intel cpu[edit]

Characteristics of laptop components[edit]

The maximum of the mining facility of laptops is 360 kH/s. This is why such mining is not profitable.

The information in the table is sorted by the capacity ascending.

Characteristics of other equipment[edit]

Here are the capacities of smartphones, cloud servers with CPU capacities and other low-powered equipment. The information is presented for your guidance as the mining on such component is pointless.

Afterword[edit]

According to the above-stated information, we can make the conclusion about the most profitable way of the scrypt mining at this moment.

  • "Hardware". Graphics cards by AMD are nowadays the most powerful ones in the mining sphere. Recently, the nVidia Company announced the release of the new graphics card that can compete with AMD. AMD doesn’t stand still though and in the nearest future it will outstrip nVidia by its capacity.
  • Software. The most flexible in settings and informative mining program is CGminer.It also has a modification for various hashing algorithms.
  • CPU mining.Is essential when another mining method isn’t foreseen by the crypto currency algorithm (quarkcoin). CPU mining can be set on the cloud servers that provide capacities of some number of processors.

See also[edit]

Mining
ASIC mining
Mining farm
Cloud mining
Pooled mining
Bitcoin Pooled Mining
Comparison of mining pools
Web mining

References[edit]