Skip to content

QuarkChain GPU miner with OpenCL, CUDA and getWork mode support

License

Notifications You must be signed in to change notification settings

jyouyj/ethminer

 
 

Repository files navigation

ethminer

QuarkChain miner with OpenCL, CUDA and getWork support

Ethminer is an Ethash GPU mining worker.

I forked the Ethminer and modified the code, which can support the QuarkChain Testnet 2.0 Ethash mining. With this modified ethminer, you can mine the shards (0 ~ 3), which relies on an Ethash Proof of Work. Noted that this version only support the getWork (Farm) mode. See FAQ for more details.

Features

  • OpenCL mining
  • Nvidia CUDA mining
  • realistic benchmarking against arbitrary epoch/DAG/blocknumber
  • on-GPU DAG generation (no more DAG files on disk)
  • OpenCL devices picking
  • only support getWork mode

Building from source

Table of Contents

Requirements

This project uses [CMake] package manager.

Common

  1. [CMake] >= 3.5
  2. Git
  3. Perl, needed to build OpenSSL
  4. CUDA Toolkit >= 9.0 (optional, install if you want NVidia CUDA support)

Linux

  1. GCC version >= 4.8
  2. DBUS development libs if building with -DETHDBUS. E.g. on Ubuntu run:
sudo apt install libdbus-1-dev

OpenCL support on Linux

If you're planning to use OpenCL on Linux you have to install the OpenGL libraries. E.g. on Ubuntu run:

sudo apt-get install mesa-common-dev

macOS

  1. GCC version >= TBF

Windows

  1. Visual Studio 2017; Community Edition works fine. Make sure you install MSVC 2015 toolkit (v140).

Instructions

  1. Make sure git submodules are up to date:

    git submodule update --init --recursive
  2. Create a build directory:

    mkdir build
    cd build
  3. Configure the project with CMake. Check out the additional configuration options.

    cmake ..

    Note: On Windows, it's possible to have issues with VS 2017 default compilers; in that case, use the VS 2017 installer to get the VS 2015 compilers and use:

    cmake .. -G "Visual Studio 15 2017 Win64" -T v140
  4. Build the project using [CMake Build Tool Mode]. This is a portable variant of make.

    cmake --build .

    Note: On Windows, it is possible to have compiler issues if you don't specify the build config. In that case use:

    cmake --build . --config Release
  5. (Optional, Linux only) Install the built executable:

    sudo make install

Windows-specific script

Complete sample Windows batch file - adapt it to your system. Assumes that:

  • it's placed one folder up from the ethminer source folder
  • you have CMake installed
  • you have Perl installed
@echo off
setlocal

rem add MSVC in PATH
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"

rem add Perl in PATH; it's needed for OpenSSL build
set "PERL_PATH=C:\Perl\perl\bin"
set "PATH=%PERL_PATH%;%PATH%"

rem switch to ethminer's source folder
cd "%~dp0\ethminer\"

if not exist "build\" mkdir "build\"

cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild -T v140 -DETHASHCL=ON -DETHASHCUDA=ON -DAPICORE=ON ..
cmake --build . --config Release --target package

endlocal
pause

CMake configuration options

Pass these options to CMake configuration command, e.g.

cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
  • -DETHASHCL=ON - enable OpenCL mining, ON by default.
  • -DETHASHCUDA=ON - enable CUDA mining, ON by default.
  • -DAPICORE=ON - enable API Server, ON by default.
  • -DETHDBUS=ON - enable D-Bus support, OFF by default.
  • -DBINKERN=ON - install AMD binary kernels, ON by default.

Usage

The ethminer is a command line program. This means you launch it either from a Windows command prompt or Linux console, or create shortcuts to predefined command lines using a Linux Bash script or Windows batch/cmd file. For a full list of available command, please run:

ethminer --help

Run a cluster

I highly recommend you can use a multi-core CPU computer to run a QuarkChain full cluster.

Port Forwarding

If you use an extra computer to run a QuarkChain cluster, you need to open TCP for port 38391 for the GPU miners. Please follow the guidance of Port Forwarding.

Examples connecting to QuarkChain cluster

After you build from source, run the follow command line to start GPU mining for QuarkChain.

cd ethminer/build/ethminer

If you use the CUDA GPU, please use,

ethminer -U http://$CLUSTER_IP:38391 --shard-id $SHARD_ID --cuda-devices $GPU_ID --farm-recheck $TIME
  • --shard-id defines one specify shard to mine. shard id 1, 10001, 20001, 30001, 40001, 50001 are Ethash.
  • --cuda-devices defines specify GPUs to mine.
  • --farm-recheck defines check interval in milliseconds for changed work. For example 500.

Noted that if you want to mine multiple shards, please open multiple terminals.

You check the GPU id by using the

nvidia-smi

Testnet 2.4 GPU mining shardID

Chains Hash Algorithm ShardID
Shard 0 Ethash 1
Shard 1 Ethash 10001
Shard 2 Ethash 20001
Shard 3 Ethash 30001
Shard 4 Ethash 40001
Shard 5 Ethash 50001

AWS AMI

QuarkChain GPU Mining AMI ami-042a6b2a7c48dea80 (Region: Oregon)

License

Licensed under the GNU General Public License, Version 3.

F.A.Q

Can I still mine QuarkChain with my 1GB GPU?

Not really, your VRAM must be above the DAG size (Currently about 1.08 GB.) to get best performance. Without it severe hash loss will occur.

Can I CPU Mine?

No, this version is modified just for the Ethash GPU mining. For CPU miner, please refer to external miners.

Insufficient CUDA driver

Error: Insufficient CUDA driver: 9010

You have to upgrade your Nvidia drivers. On Linux, install nvidia-396 package or newer.

About

QuarkChain GPU miner with OpenCL, CUDA and getWork mode support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 90.7%
  • Cuda 3.2%
  • C 2.6%
  • CMake 2.0%
  • Shell 1.4%
  • Makefile 0.1%