Go based GPU miner for Decred
C Go Objective-C C++ Cuda Makefile Shell
Pull request Compare This branch is 76 commits ahead of Dirbaio:master.
Latest commit d7c6fdd Jan 2, 2017 @jolan jolan committed on GitHub only initialize device libraries once (#132)
Permalink
Failed to load latest commit information.
adl only initialize device libraries once (#132) Jan 2, 2017
blake256 Make it mine stuff Feb 8, 2016
cl add some default Windows CFLAGS/LDFLAGS and remove unixy code (#117) Sep 28, 2016
notify correct workdata comment (#40) Jul 28, 2016
nvml Implement CUDA on windows, Fixes #108 Sep 22, 2016
sph Initial support for cuda mining. Sep 12, 2016
stratum use a slice of submitIDs instead of a single submitID (#103) Sep 20, 2016
util Reorganize some functions/packages. Aug 10, 2016
work Create stratum, work, and util packages. Aug 1, 2016
.gitignore Use glide to manage dependancies. Jul 27, 2016
.travis.yml Updates to goclean.sh Nov 22, 2016
GNUmakefile Implement CUDA on windows, Fixes #108 Sep 22, 2016
LICENSE Initial commit Feb 8, 2016
README.md add more Windows details and some general improvements (#120) Sep 29, 2016
blake256-old.cl Add updated blake256 cl code from cgminer. Jul 13, 2016
blake256.cl Fix stratum mining and intensity Jul 26, 2016
calibrate.go implement ADL support to fetch fan/temperature information (#106) Sep 22, 2016
cgo_flags.go Implement CUDA on windows, Fixes #108 Sep 22, 2016
cladldevice.go only initialize device libraries once (#132) Jan 2, 2017
cldevice.go add some default Windows CFLAGS/LDFLAGS and remove unixy code (#117) Sep 28, 2016
compat.h Initial support for cuda mining. Sep 12, 2016
config.go add automatic fan control to maintain a target temperature (#115) Sep 27, 2016
cuda_helper.h Initial support for cuda mining. Sep 12, 2016
cudakernel_static.go Updates to goclean.sh Nov 22, 2016
cudakernel_windows.go Improve cpu usage with CUDA. Sep 28, 2016
cudevice.go only initialize device libraries once (#132) Jan 2, 2017
decred.cu Remove some unused and unneeded code Sep 22, 2016
decred.h Implement CUDA on windows, Fixes #108 Sep 22, 2016
device.go only initialize device libraries once (#132) Jan 2, 2017
getwork.go use a slice of submitIDs instead of a single submitID (#103) Sep 20, 2016
glide.lock add some default Windows CFLAGS/LDFLAGS and remove unixy code (#117) Sep 28, 2016
glide.yaml Improve cpu usage with CUDA. Sep 28, 2016
goclean.sh Updates to goclean.sh Nov 22, 2016
log.go Create stratum, work, and util packages. Aug 1, 2016
main.go Use build flags to only build cuda or opencl versions of gominer. Sep 20, 2016
miner.go add automatic fan control to maintain a target temperature (#115) Sep 27, 2016
miner.h Remove some unused and unneeded code Sep 22, 2016
sample-gominer.conf Update sample config with all new options. Sep 29, 2016
version.go Bump for v0.7.0 Dec 16, 2016

README.md

gominer

gominer is an application for performing Proof-of-Work (PoW) mining on the Decred network. It supports solo and stratum/pool mining using CUDA and OpenCL devices.

Downloading

Linux and Windows 64-bit binaries may be downloaded from:

https://github.com/decred/decred-binaries/releases/latest

Running

Benchmark mode:

gominer -B

Solo mining on mainnet using dcrd running on the local host:

gominer -u myusername -P hunter2

Stratum/pool mining:

gominer -o stratum+tcp://pool:port -m username -n password

Linux Build Pre-Requisites

You will either need to install CUDA for NVIDIA graphics cards or OpenCL library/headers that support your device such as: AMDGPU-PRO (for newer AMD cards), Beignet (for Intel Graphics), or Catalyst (for older AMD cards).

For example, on Ubuntu 16.04 you can install the necessary OpenCL packages (for Intel Graphics) and CUDA libraries with:

sudo apt-get install beignet-dev nvidia-cuda-dev nvidia-cuda-toolkit

gominer has been built successfully on Ubuntu 16.04 with go1.6.2, go1.7.1, g++ 5.4.0, and beignet-dev 1.1.1-2 although other combinations should work as well.

Linux Build Instructions

To download and build gominer, run:

go get -u github.com/Masterminds/glide
mkdir -p $GOPATH/src/github.com/decred
cd $GOPATH/src/github.com/decred
git clone  https://github.com/decred/gominer.git
cd gominer
glide install

For CUDA with NVIDIA Management Library (NVML) support:

make

For OpenCL (autodetects AMDGPU support):

go build -tags opencl

For OpenCL with AMD Device Library (ADL) support:

go build -tags opencladl

Windows Build Pre-Requisites

  • Download and install the official Go Windows binaries from https://golang.dl/
  • Download and install Git for Windows from https://git-for-windows.github.io/
    • Make sure to select the Git-Bash option when prompted
  • Download the MinGW-w64 installer from https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/installer/
    • Select the x64 toolchain and use defaults for the other questions
  • Set the environment variable GOPATH to C:\Users\username\go
  • Check that the GOROOT environment variable is set to C:\Go
    • This should have been done by the Go installer
  • Add the following locations to your PATH C:\Users\username\go\bin;C:\Go\bin
  • Add C:\Program Files\mingw-w64\x84_64-6.2.0-posix-seh-rt_v5-rev1\mingw64\bin to your PATH (This is the latest release as of 2016-09-29)
  • go get github.com/Masterminds/glide
    • You should be able to type glide and get glide's usage display. If not, double check the steps above
  • go get github.com/decred/gominer
    • Compilation will most likely fail which can be safely ignored for now.
  • Change to the gominer directory
    • cd $GOPATH/src/github.com/decred/gominer
  • Install dependencies via glide
    • glide install

CUDA Specific Steps

OpenCL/ADL Specific Steps

  • Download AMD APP SDK v3.0 from http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/
    • Samples may be unselected from the install to save space as only the libraries and headers are needed
  • Copy or Move C:\Program Files (x86)\AMD APP SDK\3.0 to C:\appsdk
    • Ensure the folders C:\appsdk\include and C:\appsdk\lib are populated
  • Change to the library directory C:\appsdk\lib\x86_64
    • cd C:\appsdk\lib\x86_64
  • Copy and prepare the ADL library for linking
    • copy c:\Windows\SysWOW64\atiadlxx.dll .
    • gendef atiadlxx.dll
    • dlltool --output-lib libatiadlxx.a --input-def atiadlxx.def

Windows Build Instructions

CUDA

  • Using git-bash:
    • cd $GOPATH/src/github.com/decred/gominer
    • mingw32-make.exe
  • Copy dependencies:
    • copy obj/decred.dll .
    • copy nvidia/NVSMI/nvml.dll .

OpenCL / OpenCL w/ADL support

  • For OpenCL:

    • go build -tags opencl
  • For OpenCL with AMD Device Library (ADL) support:

    • go build -tags opencladl