VerthashMiner is a high performance GPU miner for the Verthash algorithm.
Developer: CryptoGraphics
Stratum, WorkIO and GBT implementations are partly based on cpuminer-multi and lyclMiner
This open source release was made possible thanks to Vertcoin project and its community.
Additionally miner requires GPU with 2GB VRAM or higher. (depends on the WorkSize
parameter).
Mesa Gallium Compute and macOS are not supported.
git clone https://github.com/CryptoGraphics/VerthashMiner.git
Miner can be configured through the command line, configuration file and a mix of both. All options are documented inside.
Most parameters are optional and will be auto-configured to their default values, while some of them are mandatory.
Both solo(getblocktemplate) and pooled mining(Stratum) are supported.
Note: Verthash algorithm requires a special file verthash.dat
, which can be obtained from external sources or generated by the miner using the following command(available in v0.6.2 or later):
./VerthashMiner --gen-verthash-data verthash.dat
This file is static and can be safely copied from one computer to another.
VerthashMiner includes a verification stage(enabled by default) to ensure, that verthash.dat
is valid.
Run ./VerthashMiner
to get a full list of possible options.
Solo mining using GBT(getblocktemplate):
./VerthashMiner -u user -p password -o http://127.0.0.1:port --coinbase-addr core_wallet_address --verthash-data your_path/verthash.dat --all-cl-devices --all-cu-devices
Pooled mining using Stratum:
./VerthashMiner -u user -p password -o stratum+tcp://example.com:port --verthash-data your_path/verthash.dat --all-cl-devices --all-cu-devices
All miner settings can also be managed through the configuration file. Similar to lyclMiner
Generating a configuration file.
Config file can be generated using the following command inside cmd/terminal:
./VerthashMiner -g your_config_file.conf
Alternative (Windows).
Create a file GenerateConfig.bat
in the same folder as VerthashMiner.exe
with the following content:
VerthashMiner -g your_config_file.conf
Additional notes:
--no-restrict-cuda
option../VerthashMiner -g your_config_file.conf --no-restrict-cuda
VerthashMiner -g your_config_file.conf --no-restrict-cuda
Configuring a miner.
Open your_config_file.conf
using any text editor and edit "Url"
, "Username"
, "Password"
and "CoinbaseAddress"
(Solo mining only) fields inside a "Connection"
block.
Additional notes:
BatchTimeMs
and OccupancyPct
[parameters](#Static and Adaptive WorkSize configuration) for each Device
to get better performance or desktop responsiveness.Use VerthashMiner -c your_config_file.conf
to start mining.
Run.bat
in the same folder as VerthashMiner.exe
with the following content:VerthashMiner -c your_config_file.conf
VerthashMiner -c your_config_file.conf --no-restrict-cuda
.
Note that in this case your_config_file.conf
must be generated with --no-restrict-cuda
too.For example you may want to configure the miner using a configuration file partly or completely.
Command line options have higher priority than the file and it is possible to overwrite almost every option.
VerthashMiner -c your_config_file.conf -u user -p password
In this case miner will use a configuration file while Username and Password options will be overwritten by command line.
Miner uses 2 backends for device management and mining algorithm implementation.
--no-restrict-cuda
command line parameter is used.CUDA and OpenCL devices are configured separately.
To select all cappable devices use --all-cl-devices
for OpenCL devices --all-cu-devices
for CUDA.
All devices are selected by indices.
To print the list of all cappable devices use --device-list
or -l
option.
To select specific device use --cl-devices
for OpenCL and --cu-devices
for CUDA.
For example: --cl-devices 0,2
will select device0 and device2.
Additionally, it is possible to set specific paramaters for each device.
Parameters are specified using prefixes in the following form:
device_index:prefixValue:prefixValue, device_index:prefixValue:prefixValue...
There 5 prefixes to set 5 different options:
w
set WorkSize
value. Must be power of 256 or 0(Automatic). Default value is 0
b
set BatchTimeMs
value(Automatic work/batch size). Must be above 0. Default value is 500
o
set OccupancyPct
value. Must be above 0 and less than or equal 100. Default value is 100
m
enables or disables device minitoring. 1 enables, 0 disable. Default value is 1
t
set GPUTemperatureLimit
value in degrees C. Default value is 79
.
If parameter is not set manually, then a default value will be used.
Here are some examples:--cu-devices 0:w131072,2:w32768
will select CUDA devices 0,2 and set their WorkSize
values to 131072
and 32768
respectively.--cu-devices 0:b150:m1:t60,2:w32768
will select CUDA devices 0,2 where device 0 will use an automatic work size with BatchTimeMs = 150
,
device monitoring enabled and GPUTemperatureLimit = 60
.Earlier (pre v0.7.0) VerthashMiner versions have used a hardcoded WorkSize = 131072
, which was either too low or too high. It was not intuitive to control and caused stability issues.
An "Adaptive work size" module has been developed to solve this problem, which allows a new way to configure devices along with new features.
To enable an "Adaptive work size" set WorkSize = 0
(used by default since v0.7.0), which allows to configure two other options BatchTimeMs
and OccupancyPct
.
VerthashMiner works on job in batches and WorkSize
parameter allows to specify a batch size(must be a power of 256).
Low values increase CPU and PCIe transfer(GPU to CPU) overhead, which lowers hashrate, but also saves GPU memory, makes other applications and user interface more responsive. Higher values on the other hand, are the opposite(too high values may reduce performance too).
But which value is the optimal? It depends on the device capabilities and how long it takes to process a batch(small part of the job). We can profile and try to predict a batch time as soon as the miner is the only software running on the GPU.
However things become complicated when we start running other GPU heavy applications e.g games, render/simulate some stuff.
Batch time may increase by 2x times, 10x times or more, which may trigger timeout
errors and other issues. Some of them can be mitigated by OS and GPU driver settings.
This is where the BatchTimeMs
parameter comes in. It allows to specify a "prefered" amount of time(in milliseconds), that the device should spend on processing a single batch.
VerthashMiner will dynamically select an optimal WorkSize
for every batch and manage all GPU memory allocations/reallocations.
If there are not enough GPU memory, then the miner will automatically adapt and try to get as closer as possible to the target value. Minimal Verthash requirements(2GB memory) still apply here.
Here are some recommendations for BatchTimeMs
values:
100
(e.g in range [100-1000], increase until there is a performance improvement).100
.In some cases, low BatchTimeMs
value will not be enough and desktop can still be quiet unresponsive.(for example when using NVIDIA proprietary driver with X Window system on Linux).
Second parameter OccupancyPct
exists for this reason. It allows to specify a GPU usage in [1%-100%] range.
By default Miner is configured to use/occupy 100% of the device resources and will "fight" for them with other GPU applications.
Combining BatchTimeMs
and OccupancyPct
one can achieve a good balance between performance and GUI responsiveness.
Additional notes:
BatchTimeMs
and OccupancyPct
parameters work only when "Adaptive batch size" is enabled(WorkSize = 0
). If WorkSize
is specified manually, they will be ignored by the miner.BatchTimeMs
and OccupancyPct
can also be configured using a manual device selection in the command line.(b
and o
prefixes)--cl-devices 0:b50:o75
selects device with index 0, sets BatchTimeMs
to 50
and OccupancyPct
to 75%
.Since(v0.7.0) Miner allows to monitor device temperature, power usage, fan speed and specify GPU temperature limit to prevent overheat.
Device monitoring can be enabled with DeviceMonitor = "1"
and disabled using DeviceMonitor = "0"
.
GPU temperature limit can be set using the GPUTemperatureLimit
option.
For example to set the GPU temperature limit to 79
degrees C use: GPUTemperatureLimit = "79"
If the limit is reached, the miner will suspend the work of a particular worker and resume after the GPU has cooled down.
GPUTemperatureLimit = "0"
will disable this parameter and leave the GPU temperature limit to the driver.
Additional notes:
GPUTemperatureLimit
parameter works only when device monitoring is enabled(DeviceMonitor = "1"
).DeviceMonitor
and GPUTemperatureLimit
can also be configured using a manual device selection in the command line.(m
and t
prefixes)--cl-devices 0:m1:t79
selects device with index 0, enables device monitoring and sets GPUTemperatureLimit
to 79
degrees C.x
/* some stuff */
, with a //
at the start of the line, or in shell format (#
).Make sure that OpenCL drivers are installed. See Supported platforms. lyclMiner uses CMake to build platform specific projects.
Where is the source code
select miner root directory with CMakeLists.txt
Configure
and select Generator
. Note, that CUDA is not supported when using MinGW compiler on Windows platform.
Recommended generators: Visual Studio
(select installed version) on Windows and Unix Makefiles
on Linux.Optional platform for generator
is x64
and press Finish
CMAKE_INSTALL_PREFIX
option and set the miner install path.CMAKE_BUILD_TYPE
option set to empty. Make sure it is set to Release
for the final use.Generate
and navigate to Where to build the binaries
directory.Where to build the binaries
directorymake
, Windows MinGW: mingw32-make
make install
, Windows MinGW: mingw32-make install
VerthashMiner.sln
using Microsoft Visual StudioALL_BUILD
solution inside the Solution Explorer window and select Build
INSTALL
solution inside the Solution Explorer window and select Build
CMAKE_INSTALL_PREFIX
directory.LONGPOLL pushed new work
spam may happen during GMT solo mining if network was stale for a long time. (e.g. testnet)
In this case miner should be run with either --no-longpoll
or LongPoll
option set to false
inside the configuration file.
To enable file logger use --log-file
command option.
All miner "devices" are virtual. By default miner assigns 1 virtual GPU per physical one. Thus 1 thread per GPU. It is possible to emulate any devices you want by putting duplicates in the list. You can even use multiple CUDA and OpenCL devices at the same time while having only 1 physical NVIDIA GPU. There are 3 ways to do it:
Using Command Line.
Instead of --all-cl-devices
and/or --all-cu-devices
use:
--cl-devices ...
(-d) and --cu-devices ...(-D)
respectively.
To get all physical devices available to the miner use:
-l
or --device-list
To create 2 virtual devices for one physical device, specify the same device twice.
--cl-devices 0:w131072,0:w131072
131072 is a work size. You can try specify your own(e.g 32768, 65536, 262144, 524288 etc) and check performance/power consumption.
Using a Configuration File.
For example: There will be only 1 <CL_Device0 ...>
block with 1 physical GPU.
Duplicate it and rename a new one to <CL_Device1 ...>
.
When using 2 or more devices for a single physical GPU, their hash-rate will probably be the same.
You can try to specify a different WorkSize
for each of them and compare multiple WorkSize
values at the same time. Not sure about accuracy though. It may vary between different GPUs, drivers, OS and other apps running in the background.