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.
- AMD GPU GCN 1.0 or later.
- NVIDIA GPU with compute capability 3.0 or later.
(Some compute versions may require different miner builds for the CUDA backend. e.g 8.0 requires CUDA 11.0, which removes support for 3.0.)
Additionally miner requires GPU with 2GB VRAM or higher. (depends on the WorkSize parameter).
- AMD: OpenCL 1.2+ from AMD Radeon Software driver on Windows. AMDGPU-Pro and ROCm on Linux.
- NVIDIA: Both OpenCL 1.2+ and CUDA are supported through the proprietary driver.
Mesa Gallium Compute and macOS are not supported.
- Binary releases: https://github.com/CryptoGraphics/VerthashMiner/releases
- Clone with
git clone https://github.com/CryptoGraphics/VerthashMiner.git - Follow Building VerthashMiner.
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 fileGenerateConfig.batin the same folder asVerthashMiner.exewith the following content:
VerthashMiner -g your_config_file.conf -
Additional notes:
- Configuration file is generated specifically for your GPU and driver setup.
- Configuration file must be re-generated every time you add/remove a new Device to/from the PCIe slot.
- If you want to use NVIDIA GPUs with OpenCL backend when CUDA is available, then configuration file must be generated with
--no-restrict-cudaoption.
example(command line):./VerthashMiner -g your_config_file.conf --no-restrict-cuda
or bat file:VerthashMiner -g your_config_file.conf --no-restrict-cuda
-
-
Configuring a miner. Open
your_config_file.confusing any text editor and edit"Url","Username","Password"and"CoinbaseAddress"(Solo mining only) fields inside a"Connection"block. Additional notes:- It is recommended to adjust
BatchTimeMsandOccupancyPct[parameters](#Static and Adaptive WorkSize configuration) for eachDeviceto get better performance or desktop responsiveness.
- It is recommended to adjust
-
Use
VerthashMiner -c your_config_file.confto start mining.- Alternative (Windows).
Create a fileRun.batin the same folder asVerthashMiner.exewith the following content:
VerthashMiner -c your_config_file.conf - Additional notes:
- To use NVIDIA GPUs with OpenCL backend when CUDA is available:
VerthashMiner -c your_config_file.conf --no-restrict-cuda. Note that in this caseyour_config_file.confmust be generated with--no-restrict-cudatoo.
- To use NVIDIA GPUs with OpenCL backend when CUDA is available:
- Alternative (Windows).
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.
- CUDA. Used for NVIDIA devices. All unsupported devices (e.g SM3.0 on CUDA 11 get automatically transfered to the OpenCL backend).
- OpenCL. Used for AMD, Intel and others. If miner has been compiled with CUDA enabled, then all NVIDIA devices, which are supported by CUDA will be automatically ignored by the OpenCL backend, unless
--no-restrict-cudacommand 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:
wsetWorkSizevalue. Must be power of 256 or 0(Automatic). Default value is0bsetBatchTimeMsvalue(Automatic work/batch size). Must be above 0. Default value is500osetOccupancyPctvalue. Must be above 0 and less than or equal 100. Default value is100menables or disables device minitoring. 1 enables, 0 disable. Default value is1tsetGPUTemperatureLimitvalue in degrees C. Default value is79. If parameter is not set manually, then a default value will be used. Here are some examples:--cu-devices 0:w131072,2:w32768will select CUDA devices 0,2 and set theirWorkSizevalues to131072and32768respectively.--cu-devices 0:b150:m1:t60,2:w32768will select CUDA devices 0,2 where device 0 will use an automatic work size withBatchTimeMs = 150, device monitoring enabled andGPUTemperatureLimit = 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:
- For the "performance mode" set value above
100(e.g in range [100-1000], increase until there is a performance improvement). - To make other applications and user interface more responsive: choose values below
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:
BatchTimeMsandOccupancyPctparameters work only when "Adaptive batch size" is enabled(WorkSize = 0). IfWorkSizeis specified manually, they will be ignored by the miner.- Both
BatchTimeMsandOccupancyPctcan also be configured using a manual device selection in the command line.(bandoprefixes)
For example:--cl-devices 0:b50:o75selects device with index 0, setsBatchTimeMsto50andOccupancyPctto75%.
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:
- Device monitoring features may vary between OS, devices and drivers.
GPUTemperatureLimitparameter works only when device monitoring is enabled(DeviceMonitor = "1").- Both
DeviceMonitorandGPUTemperatureLimitcan also be configured using a manual device selection in the command line.(mandtprefixes)
For example:--cl-devices 0:m1:t79selects device with index 0, enables device monitoring and setsGPUTemperatureLimitto79degrees C.
- Connection password
- If the pool doesn't require this parameter, leave it as
x
- If the pool doesn't require this parameter, leave it as
- Comments can be in C format, e.g.
/* 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.
- OpenCL
- Jansson(https://github.com/akheron/jansson)
- CURL(https://curl.haxx.se/libcurl/)
- OpenSSL(optional on Windows)
- CUDA(optional) Otherwise OpenCL will be used. Both versions are optimized and performance will be the same. With CUDA you can avoid 100% CPU usage during mining using NVIDIA GPUs.
- Make sure that all dependencies are installed
- Install the latest version of CMake. 3.18 or above is required. https://cmake.org/
- Open CMake and in
Where is the source codeselect miner root directory withCMakeLists.txt - Choose the path "Where to build the binaries" for cache.
- Press
Configureand selectGenerator. Note, that CUDA is not supported when using MinGW compiler on Windows platform. Recommended generators:Visual Studio(select installed version) on Windows andUnix Makefileson Linux. - Make sure that
Optional platform for generatorisx64and pressFinish - Build system will configure everything automatically and use precompiled dependencies on Windows if possible. You can always specify your own.
- Modify
CMAKE_INSTALL_PREFIXoption and set the miner install path. - Some build systems have
CMAKE_BUILD_TYPEoption set to empty. Make sure it is set toReleasefor the final use. - Use
Generateand navigate toWhere to build the binariesdirectory. - Compile miner(depends on the selected compiler and generator)
- Navigate to
Where to build the binariesdirectory - On Linux and Windows MinGW
- Open Terminal/Windows PowerShell in this directory.
- Linux:
make, Windows MinGW:mingw32-make - Wait for the compilation to finish
- Linux:
make install, Windows MinGW:mingw32-make install
- On Windows(Microsoft Visual Studio)
- Open
VerthashMiner.slnusing Microsoft Visual Studio - Right click on the
ALL_BUILDsolution inside the Solution Explorer window and selectBuild - Wait for the compilation to finish
- Right click on the
INSTALLsolution inside the Solution Explorer window and selectBuild
- Open
- Miner binaries will be stored inside the
CMAKE_INSTALL_PREFIXdirectory.
LONGPOLL pushed new workspam 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-longpollorLongPolloption set tofalseinside the configuration file.- To enable file logger use
--log-filecommand 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-devicesand/or--all-cu-devicesuse:
--cl-devices ...(-d) and--cu-devices ...(-D)respectively.
To get all physical devices available to the miner use:
-lor--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 differentWorkSizefor each of them and compare multipleWorkSizevalues at the same time. Not sure about accuracy though. It may vary between different GPUs, drivers, OS and other apps running in the background.