CryptoGraphics / lyclMiner

OpenCL Lyra2REv2/v3 miner for AMD GCN GPUs
GNU General Public License v3.0
44 stars 19 forks source link

lyclMiner

lyclMiner is a high performance OpenCL Lyra2REv2/v3 miner for AMD GCN GPUs.

Developer: CryptoGraphics

Stratum and WorkIO implementations are based on cpuminer-multi
Some kernels(Skein and BMW) are based on cuda and OpenCL kernels from (ccminer and sgminer projects respectively).

This open source release was made possible thanks to Vertcoin project and its community.

Supported hardware

AMD GPU GCN 1.0 or later.

Supported platforms

Mesa Gallium Compute and macOS are not supported.

Download

Quick start guide

All miner settings are managed through the configuration file.

  1. Generating a configuration file.

    • Config file can be generated using the following command inside cmd/terminal:
      ./lyclMiner -g lyclMiner.conf

    • Alternative (Windows).
      Create a file GenerateConfig.bat in the same folder as lyclMiner.exe with the following content:
      lyclMiner -g lyclMiner.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 configuration file name is different from lyclMiner.conf, then it must be specified manually when starting a miner: Example: lyclMiner your_configuration_file
      • By default miner looks for lyclMiner.conf in the same directory as lyclMiner executable.
  2. Configuring a miner. Open lyclMiner.conf using any text editor and edit "Url", "Username", "Password" and "Algorithm" fields inside a "Connection" block. Additional notes:

    • It is recommended to adjust WorkSize parameter for each Device to get better performance.
  3. Start a lyclMiner executable.

There is more

Pool connection setup:

Selecting specific devices

By default, all devices are used. However it is possible to select specific ones using a PCIeBusId option.

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Device config:
#
# Available platforms:
#
# 1. Platform name: Advanced Micro Devices, Inc.
#    Index: 0
#
# Available devices:
#
# 1. Device: gfx900
#    Board name: Radeon RX Vega
#    PCIe bus ID: 1
#    Available platforms indices: 0
#
# 2. Device: Ellesmere
#    Board name: Radeon RX 580 Series
#    PCIe bus ID: 3
#    Available platforms indices: 0
#
# 3. Device: Ellesmere
#    Board name: Radeon RX 580 Series
#    PCIe bus ID: 5
#    Available platforms indices: 0
#
# 4. Device: Ellesmere
#    Board name: Radeon RX 580 Series
#    PCIe bus ID: 7
#    Available platforms indices: 0
#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

<Device0 PCIeBusId = "1" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx9" WorkSize = "16777216">
<Device1 PCIeBusId = "3" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "8388608">
<Device2 PCIeBusId = "5" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "2097152">
<Device3 PCIeBusId = "7" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "4194304">

For example: We want to use devices only with PCIeBusId 3 and 7.
Comment/backup the original list.

/*
<Device0 PCIeBusId = "1" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx9" WorkSize = "16777216">
<Device1 PCIeBusId = "3" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "8388608">
<Device2 PCIeBusId = "5" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "2097152">
<Device3 PCIeBusId = "7" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "4194304">
*/

Copy selected device configurations and rename blocks, so they will start from 0. e.g <Device0>, <Device1> ...

<Device0 PCIeBusId = "3" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "8388608">
<Device1 PCIeBusId = "7" PlatformIndex = "0" BinaryFormat = "amdcl2" AsmProgram = "gfx8" WorkSize = "4194304">

Per device configuration:

Raw device list format:

There can be a case when all devices return the same PCIeBusId and it will be impossible to distinguish between them.
If there will be duplicate PCIeBusIds on the same platform, then miner will automatically switch to the raw device list format
All possible Device/Platform configurations will be listed. A DeviceIndex option will used instead of PCIeBusId and PlatformIndex.
If Device has more than one platform available, all duplicates must be handled manually.
Note: The order in which devices are listed is platform implementation defined. Prefer to use PCIeBusId version whenever possible.

Comments inside a config file

Building lyclMiner

Make sure that OpenCL drivers are installed. See Supported platforms. lyclMiner uses premake5 to build platform specific projects. Download it and make sure it's available on your path, or copy premake5 executable to the same directory as premake5.lua file.

Compilers

GCC (Linux) / MinGW-w64 (Windows)

Dependencies

Linux

  1. Install all dependencies according to your distro's guidelines.
    e.g(on Ubuntu 16.04 LTS): sudo apt-get install libcurl4-openssl-dev libssl-dev libjansson-dev opencl-headers
  2. run premake5 gmake from the same directory as premake5.lua file.
  3. cd build then make. If there were no errors, a compiled binary will inside a newly created folder bin(same directory as premake5.lua file)
  4. Copy kernels folder to the same directory as compiled lyclMiner executable.

Windows

  1. Install MinGW-w64 with these settings:
    • Architecture: x86_64
    • Threads: posix
    • Exception: seh
  2. Add MinGW installation/mingw-w64/bin to your "PATH"
  3. Download or compile libcurl, jansson
  4. Install AMD OpenCL app SDK or use Kronos OpenCL headers and ICD.
  5. Edit setupJansson(), setupCurl(), setupOpenCL() functions inside a premake5.lua file. Specify includedirs and libdirs for all dependencies.
  6. run premake5 gmake from the same folder as premake5.lua file.
  7. cd build then mingw32-make. If there were no errors, a compiled binary will inside a newly created folder bin(same directory as premake5.lua file)
  8. Copy kernels folder and all required dlls to the same directory as compiled lyclMiner executable.