enerc / VulkanXMRMiner

Vulkan SPIR-V miner for Cryptonight

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VulkanXMRMiner

This program is a Vulkan SPIR-V based miner for the Cryptonight familly:

   

This miner is based on Vulkan and SPIR-V technology (not OpenCL):



What's Vulkan:

Vulkan is a new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

This program should work on any Vulkan 1.0 compatible device: AMD, Intel, Nvidia.

Mining Aeon on Kangaroo Twelve algo is now enabled and with optimized assembly for ARM. Check the build section below to create the binary for your device.

Download and run

You can get binaries in therelease section here: Releases

Extract the zip file, and run miner.exe / miner.

The binary glslangValidator.exe/glslangValidator is from the Vulkan SDK and is for CryptonightR to a compile new SPIR-V kernel at each new block.

New in 0.2: Monitoring, hashrate seen by pool improved, turtlecoin and bittorium support, cn/wow.
New in 0.3: cn/r
New in 0.4: KangarooTwelve
New in 0.4.1: ARM CPU K12 mining

Drivers installation

On Windows, Vulkan should be provided with recent drivers for AMD and NVIDIA. On AMD only use 2018+ Adrenalin drivers. Crimson drivers are too old.
If unsure chech https://www.amd.com/en/technologies/vulkan or https://developer.nvidia.com/vulkan-driver.
If you run intro trouble, please download the Vulkan SDK at https://www.lunarg.com/vulkan-sdk/ and run the vulkaninfo.exe tool to check your drivers are properly installed.

On Linux, install amdgpu/amdgpu-pro as usual or ROCM and either install the vulkan driver (apt-get install libvulkan1) or install the SDK https://www.lunarg.com/vulkan-sdk/.
It is recommended to check your configuration with vulkaninfo that you can get with apt-get install vulkan-utils.
As for Windows, check the installation with vulkaninfo.
If it does not work, check that the ICD is properly configured. In /etc/vulkan/icd.d/ there should be a file with something like:

{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "path_to/amdvlk64.so",
"api_version" : "1.1.something"
}
}

Windows TDR

When mining under Windows and using optimized settings, the driver might reset and the miner will stop with the error "Device Lost". This is caused by the Timeout Detection and Recovery feature triggered when a kernel works for more than 2 seconds.
Either change the TdrDelay key in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers or create a TdrLevel entry with value 0 (TdrLevelOff).
The file TdrLevel.reg will change the Windows registry to proper settings.

Configuration

When entering the miner, a setup menu will be shown if there are no config.json file there.

  • on wallet_address you can add a worker/farm id by adding .your_farm after the address
  • The cu parameter is the number of compute units (AMD terminology) / Stream Multiprocessors(Nvidia).
  • The factor is how many threads are sent to each CU.
  • The worksize is the number of threads per CU at a given time.
  • Used memory is given by:
    Number of CU x Factor x 2 Mb (1Mb for Cryptonight light)
  • So for example a 56 CU with a factor 64 on Monero will use:
    56 x 64 x 2 = 7168 Mb of Video RAM.
  • debug_network allows to print the network exchanges between the miner and the pool
  • console_listen_port: 0 to disable JSON/Graphic or port number
  • console_refresh_rate: 30s will give a hashrate window of 12 hours in the graphs.

Windows and Linux build

cmake is required to perform the build. Set environment variable VULKAN_SDK for custom vulkan libraries or when cross building for Windows.

git clone https://github.com/enerc/VulkanXMRMiner.git
cd VulkanXMRMiner
mkdir build
cd build
For Windows:
cmake -DWIN32=1 ..
For Linux
cmake ..
use cmake -DSOFT_AES=1 .. for non aes-ni processors

Extract vulkanXMRMiner.zip or vulkanXMRMiner.tgz and start the miner.

Raspberry and clones build

cmake and gcc must be installed to perform the build. VULKAN_SDK is not needed.

git clone https://github.com/enerc/VulkanXMRMiner.git
cd VulkanXMRMiner
cmake . ; make -j4
./miner

Monitoring

Monitoring can be accessed through localhost:"the port in console_listen_port configuration file".


For monitoring in GPU farms, there is also a json url http://host:port/status.json that returns a json text reporting the health of the GPU cards:

Benchmarks

on CN V2 (Variant 2)

Vega56 1500/1075 : 1800 H/s on Windows 10 (200 W)
Vega56 1500/945  : 1625 H/s on Linux Rocm 2.0 (200 W)
Vega56 1200/800  : 1460 H/s on Linux Rocm 2.0 (100 W)
R9 Fury 1050/500 : 835 H/s on Windows & Linux
RX560 1000/1850  : 410 H/s on Linux amdgpu-pro (25 W)
RX550 1000/1800  : 330 H/s on Linux amdgpu-pro (16 W)

on CN/R (CryptonightR - Variant 4)

Vega56 1500/1075 : 1800 H/s on Windows 10

on CN Light V7 (Aeon)

Vega56 1500/1075 : 3970 H/s on Windows 10

on KangarooTwelve (Aeon)

Vega56 1500Mhz : 950 MH/s
ARM Cortex A53@1200Mhz : 2 MH/s

on TurtleCoin

Vega56 1500/1075 : 14 070 H/s on Windows 10

Dev fee

Building and maintaining a miner programm is a significant effort 😛. Miner will mine on fee pool one minute every one hour and 40 minutes on average. (1% of the time).

You are welcomed to make a donation:
XMR : 4AZSfpPFsLEgxpBVmNdoysYERDQiGu7daKB2WtWgKK1AGqeJBhRp4ZNjVPMARyoSpPb3WkGsQ7p5tKvKex9eJpFqRJQXvQZ

About

Vulkan SPIR-V miner for Cryptonight

License:GNU General Public License v3.0


Languages

Language:C++ 97.4%Language:Assembly 1.8%Language:CMake 0.9%