bytwork.com
Mining, blockchain and cryptocurrencies

Cpuminer-opt and Cpuminer-gr: download and setup (easy tutorial)

Hasrate (overclocked)

Intel Core I3
yescrypt - 2,2-2,4
yespower - 0,42

Version 25.3 (latest):
Supports algorithms
Allium
anime
argon2
Argon2d250
argon2d500
Argon2d4096
axiom
blake
Blake2b
Blake2s
blakecoin
bmw
bmw512
C11
decred
deep
dmd-gr
Groestl
Hex
HMQ1725
hodl
jha
Keccak
Keccakc
LBRY
Luffa
lyra2h
lyra2re
Lyra2REv2
Lyra2REv3
Lyra2Z
lyra2z330
m7m
myr-gr
NeoScrypt
Nist5
pentablake
PHI1612
PHI2
phi2-lux
pluck
Polytimos
power2b
Quark
qubit
Scrypt
scrypt:N
sha256d
sha256q
Sha256t
sha3d
shavite3
Skein
Skein2
skunk
Sonoa
Timetravel
TimeTravel10
Tribus
Vanilla
Veltor
Whirlpool
whirlpoolx
X11
X11evo
X11Gost
X12
X13
x13bcd
x13sm3
X14
X15
X16R
x16rv2
X16RT
x16rt-veil
X16S
X17
x21s
X22i
X25X
Xevan
Yescrypt
yescryptr8
yescryptr8g
yescryptr16
yescryptr32
yespower
yespowerr16
yespower-b2b
Zr5
Program for:
CPU
Table of contents

Cpuminer-opt is a program for mining on processors, supporting many algorithms.

Keep in mind that algorithms like SHA256 and Scrypt are optimized for ASIC and GPU, not CPU. CPU-friendly algorithms: Yespower, Yescrypt, Ghostrider, RandomX.

The archive contains two versions. Cpuminer-opt and Cpuminer-gr for Raptoreum cryptocurrency.

Version cpuminer-gr is a fork of cpuminer-opt by a developer nicknamed JD, which is a fork of cpuminer-multi with optimizations imported from other miners. There is another fork - multi-threaded termux miner with a large number of algorithms. And for mining the ETHASH algorithm on CPU, UselethMiner is used.

The coins mined by this program can be tracked here.

Setting up a batch file

  1. cpuminer.exe - specify the name of the program to be launched. For cpuminer-opt it will be different -cpuminer-avx2.exe
  2. -o stratum+tcp://eu.vrm.mining-pool.ovh - specify the pool address
  3. :3032 - put a colon and specify the port from the pool
  4. Weblogin - after the key -u, specify either the login on the pool, if registration is needed there, or the address of your wallet

  5. WorkerName - specify the name of the worker (rig name)
  6. -p WorkerPassword - specify the password. Set Xif there is no password

Configuration via a configuration file on the example of Raptoreum

To run the program through the configuration file and the Raptoreum cryptocurrency, we need to create a config.json file in the cpuminer-gr folder. Just create .txta file and then change its extension .txt from .json. Open this file for editing in any text editor. For example in Notepad. Inside this file you need to place the following code:

{
  "url": "stratum+tcps://us.flockpool.com:5555",
  "url-backup": "stratum+tcps://us-west.flockpool.com:5555",
  "user": "R9fRZ7jdrPMtj6sHxsfjnYJHZKFtThyc4u.MainPC",
  "pass": "password",
  "algo": "gr"
}

Your region for urlmust have the lowest ping, and the reserve pool ( "url-backup") must be located below. We recommend using SSL (5555) as the port. Your worker can be anything; this is the ID of the specific machine you are mining on.

Finally, the password is used when you want to withdraw money, so set it to be hard to guess.

Alternatively, you can use Flockpool's Start Mining tool to automatically tune the config.json file. If you do, just delete the original config.json and fill in all the options on the Flockpool page. After that, download the configuration file you just created and move it to the cpuminer-gr folder. Remember that the settings for a pool are usually written on the pools themselves.

Command Line Arguments

Pool connection:

-o, --url=URL address of the mining pool

-O, --userpass=U:P pair password:user for mining pool

-u, --user=USERNAME username for mining pool (can be wallet address or pool login)

-p, --pass=PASSWORD mining pool password

--cert=FILE specify certificate for mining server using SSL

-x, --proxy=[PROTOCOL://]HOST[:PORT] connect via proxy

-c, --config=FILE load configuration file in JSON format

Server connection:

-r, --retries=N specify the number of retries before switching to the backup pool server (default: repeat indefinitely)

-R, --retry-pause=N pause time between connection attempts (default: 30)

--time-limit=N maximum time [s] before exiting the program. (default: 300 seconds)

-T, --timeout=N set network connection timeout (default 300)

-s, --scantime=N set the upper limit of the current job search time, in seconds (default: 10)

--randomize start randomizing search range to reduce duplicate work

-f, --diff-factor divides the difficulty by this factor (default 1.0)

-m, --diff-multiplier multiplies the difficulty by this factor (default 1.0)

Performance:

-t, --threads=N specify number of CPU threads (default: number of processors)

-1, --oneways=N you can specify the number of "gateway" streams that will accompany your "standard" streams. The default method is determined by your CPU instruction set. (default:0)

--cpu-affinity set affinity to main cpu core by mask 0x3 for cores 0 and 1

--cpu-priority set priority. 0 - inactive, 2 normal, 5 - highest)

--max-rate=N[KMG] only mine if the net hash rate is less than the specified value

--max-diff=N only mine if the difficulty is less than the given value. Can be configured with --resume-diff=N to set the value of resume mining

--ryzen Force AVX and disable AVX2. Ryzen 1*** much faster

-n, --nfactor specify N-Factor

Program interface:

-q, --quiet disable per-thread hash output

--no-color disable colored console output

-D, --debug enable debug output

-P, --protocol-dump allows you to write the event log

--show-diff displays current block and network difficulty

-B, --background run the miner in the background

Solo mining:

--coinbase-addr=ADDR specify payout address for SOLO mining

--coinbase-sig=TEXT specify text data to insert if possible

--no-longpoll disable X-Long-Polling support

--no-getwork disable getwork support

--no-gbt disable getblocktemplate support

--no-stratum disable X-stratum protocol support

--no-extranonce disable Stratum extranonce protocol support

--no-redirect ignore requests to change the URL of the mining server

Testing:

--benchmark run the program in offline testing mode

--cputest start debug mode of hashes of processor algorithms

Temperatures:

--max-temp=N start mining only if the temperature is less than the specified value (Linux only)

API:

-b, --api-bind port for miner API (default: 127.0.0.1:4068), 0 disabled

--api-remote allow remote control of the program

Reference:

-V, --version display version information and exit

-h, --help display help text and exit

Other settings:

--cpu-affinity-stride N specify how many processors to skip when assigning affinity based affinity, cannot be used with '--cpu-affinity' (default: 1) See README.md for more details.

--cpu-affinity-default-index N specify which processor will run thread affinity by default. (default: 0) See README.md for more details.

--cpu-affinity-oneway-index N specify which processor will run thread affinity by default. (default: [After default threads]) See README.md for more details. --cpu-priority-oneway 0-5

--cpu-priority-oneway 0-5 specify what priority gateway threads have (0 is the lowest, 5 is the highest) (default: 0)

Requirements

  • x86_64 architecture processor with minimal SSE2 support. This includes Intel Core2 and newer and AMD equivalents. To take advantage of the AES_NI optimization, a processor with AES_NI is required. This includes Intel Westmere and newer and AMD equivalents. Further optimization is available for some algorithms for processors with AVX and AVX2, Sandybridge and Haswell, respectively.
  • Old processors are supported by another program - cpuminer-multi TPruvot, but with reduced performance.
  • ARM processors are not supported.
  • 64-bit Linux OS. Ubuntu and Fedora based distributions, including Mint and Centos, work and have all dependencies in their repositories.
  • 64-bit Windows OS is supported with mingw_w64 and msys or prebuilt binaries.
  • MacOS, OSx and Android are not supported.
  • Pool with Stratum protocol. Some algorithms may work using getwork or GBT. YMMV.

Mining optimization on CPUs and pitfalls

In this section, you will learn how to properly configure Intel Alder Lake hybrid processors for maximum CPU mining performance, which will ensure stable operation and minimize power losses.

Choosing cores

Mining on Intel Alder Lake hybrid processors requires taking into account a number of features for optimal performance. These processors combine productive (P) and energy-efficient (E) cores, with P cores supporting hyper-threading (Hyper-Threading), while E cores do not.

Incorrectly configuring threads can lead to a significant decrease in performance, so it is important to distribute tasks correctly. For example, use half of the P-cores with hyperthreading disabled and all available E-cores.

Algorithm selection

Algorithm selection plays a key role. Algorithms such as SHA256 and Scrypt are not efficient for CPUs as they are optimized for ASICs and GPUs.

However, there are CPU-friendly algorithms, including Yespower, Yescrypt, Ghostrider, and RandomX, that can be used for mining.

To mine efficiently, you need to choose a suitable pool that supports the desired algorithm. Also, choose pools that offer automatic exchange of mined cryptocurrency for more popular tokens.

Performance

To improve performance, it is recommended to use the --hash-meter flag, which allows you to test the performance of individual cores and threads. This is especially important for hybrid processors, where you need to experiment with the configuration of threads.

For example, using only even threads on P-cores can give a noticeable increase in efficiency.

There may be difficulties with using the pre-installed cpuminer-opt binaries. Most of them are created for outdated versions of Windows, which makes them incompatible with modern processor architecture. To solve this problem, it is recommended to compile cpuminer-opt from source using MSys2 and MinGW. This allows you to get up-to-date versions with improved support for new libraries.

The performance of algorithms such as Yespower is largely dependent on memory performance. The sizes of L1, L2 and L3 caches, as well as the bandwidth of the RAM, play a significant role.

Laptops, macOS and Linux

Mining on ARM processors is possible, including on macOS and Windows, thanks to updates to cpuminer-opt with support for ARM64 and FreeBSD. However, it is worth remembering that using laptops for mining can lead to overheating and a shortened lifespan of the equipment.

On Linux operating systems, using the HugePages setting can further improve performance. For modern processors, optimizing these parameters becomes a necessity.

For beginners on a budget, CPU mining is more of an experimental endeavor. A more effective solution may be to use USB ASICs or alternative approaches such as cryptocurrency faucets. Faucets allow you to receive small amounts of cryptocurrency without the need for complex settings and electricity costs.

Also a useful feature is the auto-exchange, available on some pools, which allows you to mine one currency and receive payments in another.

The developers of cpuminer-opt continue to actively update the program, adding support for new platforms and algorithms, as well as removing outdated and little-used functions.

However, given the general inefficiency of the CPU compared to the GPU or ASIC, mining on processors remains a niche solution that requires careful optimization and selection of equipment.

Basic instructions for building *nix (Linux, Debian, Ubuntu)

To build the termux version, run the following script:

 ./autogen.sh    # only needed if building from git repo
 ./nomacro.pl    # only needed if building on Mac OS X or with Clang
 ./configure CFLAGS="*-march=native*" --with-crypto --with-curl
 # Use -march=native if building for a single machine
 make

Note for Debian/Ubuntu users:

 apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev zlib1g-dev make g++ libtool

Download

In the archive with the program you will find complete instructions.

Download for Windows:

Cpuminer-opt [25.3]

Cpuminer-opt [3.19.8]
Cpuminer-opt [3.16.1]
Cpuminer-opt [3.12.4]

Download for Linux:

cpuminer-opt [3.19.8]

Happy mining!

Do you have any questions? Write to us in Telegram  chat.

Also follow us on Twitter!

Rate article
Average: 4.1 (21 votes)
DevFee
0%

Author: Максим Анисимов
Blockchain engineer, Android app developer, financier since 2012. Develops applications for cryptocurrencies, blockchain and investments. Studying programs, their vulnerabilities
Add a comment

Comments

Add new comment
The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.