Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Go (golang) based GPU miner for Decred.

License

NotificationsYou must be signed in to change notification settings

decred/gominer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gominer is an application for performing Proof-of-Work (PoW) mining on theDecred network after the activation ofDCP0011using BLAKE3. It supports solo and stratum/pool mining using OpenCL and CUDAdevices.

User Reported Hashrates

Downloading

Binaries are not currently available. See theBuilding(Windows,Linux) section for details on how to buildgominer from source.

Configuringgominer

gominer needs to acquire work in order to have something to solve. Currently, the only supported method is solo mining via adcrd RPC server. There are plans to supportdcrpool for pooled mining in the future.

In order to communicate with thedcrd RPC server,gominer must be configuredwithdcrd's RPC server credentials.

  • Obtain the RPC username and password by finding therpcuser andrpcpassentries in thedcrd.conf file
    • Windows:%LOCALAPPDATA%\Dcrd\dcrd.conf
    • Linux:~/.dcrd/dcrd.conf
    • MacOs:~/Library/Application Support/Dcrd/dcrd.conf
  • Create agominer.conf file at the platform-specific path that contains theexact samerpcuser= andrpcpass= lines you obtained from thedcrd.conf file in the previous step
    • Windows:%LOCALAPPDATA%\Gominer\gominer.conf
    • Linux:~/.gominer/gominer.conf
    • MacOS:~/Library/Application Support/Gominer/gominer.conf
    • Thegominer.conf config file should have at least the following lines:
    rpcuser=<same rpcuser from dcrd.conf>rpcpass=<same rpcpass from dcrd.conf>

Next,dcrd must be configured with a mining address to send the payment formined blocks. That is accomplished by either launchingdcrd with the--miningaddr=Ds... CLI flag or adding aminingaddr=Ds... to theaforementioneddcrd.conf file and restartingdcrd.

Running

Benchmark mode

gominer provides a benchmark mode where no work is submitted in order to testyour setup.

gominer -B

Solo Mining on Mainnet

Ensure you haveconfiguredgominer withdcrd's RPCcredentials as well asdcrd with aminingaddr. Once the credentials andmining address have been configured, simply run gominer to begin mining.

gominer

Stratum/pool Mining on Mainnet

Mining with a Pool Based on Dcrpool

The username for pools runningdcrpool isthe payment address for receiving rewards and a unique name identifying theclient formatted asaddress.name.

Run the following command replacing thepooldomain:port with the appropriatedomain name and port of the desired pool to connect to and theaddress.nameas previously described:

gominer --pool stratum+tcp://pooldomain:port --pooluser address.name

General Pool Mining

There is no other known pool software aside fromdcrpool, that supports the latest Decredconsensus rules at the current time. However, as long as the pool softwaresupports the stratum protocol with the same semantics implemented bydcrpool,the following command should serve as a starting point:

gominer --pool stratum+tcp://pooldomain:port --pooluser username --poolpass password

Status API

There is a built-in status API to report miner information. You can set anaddress and port with--apilisten. There are configuration examples onsample-gominer.conf. If no port is specified, then itwill listen by default on3333.

Example usage:

$ gominer --apilisten="localhost"

Example output:

$ curl http://localhost:3333/> {"validShares": 0,"staleShares": 0,"invalidShares": 0,"totalShares": 0,"sharesPerMinute": 0,"started": 1504453881,"uptime": 6,"devices": [{"index": 2,"deviceName":"GeForce GT 750M","deviceType":"GPU","hashRate": 110127366.53846154,"hashRateFormatted":"110MH/s","fanPercent": 0,"temperature": 0,"started": 1504453880    }],"pool": {"started": 1504453881,"uptime": 6    }}

Building

Linux

Preliminaries

Gominer works with OpenCL (both AMD and NVIDIA) and CUDA (NVIDIA only). At thecurrent time, most users have reported that OpenCL gives them higher hashrateson NVIDIA.

Once you decide on OpenCL or CUDA, you will need to install thegraphics driver for your GPU as well as the headers for OpenCL or CUDAdepending on your choice.

The exact packages are dependent on the specific Linux distribution, but,generally speaking, you will need the latest AMDGPU-PRO display drivers for AMDcards and the latest NVIDIA graphics display drivers for NVIDIA cards. Then,depending on whether you will build the OpenCL or CUDA version, the specific setof toolsets, headers and libraries will have to be installed.

For OpenCL, the packages are typically named something similar tomesa-opencl-dev (for AMD) ornvidia-opencl-dev (for NVIDIA).

If you're using OpenCL, it is also recommended to install your distribution'sequivalent of theclinfo package if you have any issues to ensure your devicecan be detected by OpenCL. Whenclinfo is unable to detect your device,gominer will not be able to either.

For CUDA, on distributions where it is available via the standard packagemanager, the required files are usually found asnvidia-cuda-toolkit. NVIDIAalso provides its ownCUDA Toolkitdownloads.

The following sections provide instructions for building various combinationsofgominer:

NVIDIA on Ubuntu 23.04

This section provides instructions for buildinggominer on a computer with anNVIDIA graphics card running Ubuntu 23.04. Both OpenCL and CUDA buildinstructions are provided.

Prerequisites

The following steps are applicable for both OpenCL and CUDA builds ofgominer:

  • Detect the model of your NVIDIA GPU and the recommended driver
    • ubuntu-drivers devices
  • Install the NVIDIA graphics driver
    • If you agree with the recommended drivers
      • sudo ubuntu-drivers autoinstall
    • Alternatively, install a specific driver (for example)
      • sudo apt install nvidia-driver-525-server
  • Install the basic development toolsgit andgo
    • sudo apt install git golang
  • Reboot to allow the graphics driver to load
    • sudo reboot
  • Obtain thegominer source code
    • git clone https://github.com/decred/gominer
  • Jump to the appropriate section for eitherOpenCL orCUDAdepending on which GPU library you want to buildgominer for
OpenCL on Ubuntu
  • Install the OpenCL headers
    • sudo apt install nvidia-opencl-dev
  • Buildgominer
    • cd gominer
    • go build -tags opencl
  • Testgominer detects your GPU(s)
    • ./gominer -l
  • You may nowconfigure and rungominer
CUDA on Ubuntu
  • Install the NVIDIA CUDA Toolkit:
    • sudo apt install nvidia-cuda-toolkit
  • Buildgominer:
    • cd gominer
    • go generate -tags cuda .
  • Testgominer detects your GPU(s):
    • ./gominer -l
  • You may nowconfigure and rungominer

Debian Bookworm

This section provides instructions for buildinggominer on a computer runningDebian bookworm. Both OpenCL (using either AMD or NVIDIA graphics cards)and CUDA (NVIDIA graphics cards only) build instructions are provided.

Prerequisites
  • Enable the non-free (closed source) repository by using your favorite editorto modify/etc/apt/sources.list and appendingcontrib non-free to thedeb repository
    • $EDITOR /etc/apt/sources.list
      • It should look similar to the following
        deb http://ftp.us.debian.org/debian bookworm-updates main contrib non-freedeb http://security.debian.org bookworm-security main contrib non-free
  • Update the Apt package manager with the new sources
    • sudo apt update
  • Install the basic development toolsgit andgo:
    • sudo apt install git golang
  • Obtain thegominer source code
    • git clone https://github.com/decred/gominer

Proceed to install the appropriate graphics card driver and supporting firmware,based on the hardware available on the computer:

  • For AMD GPUs: Install the AMD graphics driver and supporting firmware
    • sudo apt install firmware-linux firmware-linux-nonfree libdrm-amdgpu1 xserver-xorg-video-amdgpu
  • For NVIDIA GPUs: Install the NVIDIA graphics driver:
    • sudo apt install nvidia-driver
  • Restart the computer to ensure the driver is loaded
  • Jump to the appropriate section for eitherOpenCL orCUDAdepending on which GPU library you want to buildgominer for
OpenCL on Debian

This build mode supports both AMD and NVIDIA graphics cards.

  • Install the OpenCL headers, OpenCL Installable Client driver and OpenCL lib
    • sudo apt install opencl-headers mesa-opencl-icd ocl-icd-libopencl1
  • Help the loader find the OpenCL library by creating a symbolic link to it:
    • ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/libOpenCL.so
  • Buildgominer
    • cd gominer
    • go build -tags opencl
  • Testgominer detects your GPU(s)
    • ./gominer -l
  • You may nowconfigure and rungominer
CUDA on Debian

Note that this requires having an NVIDIA graphics card installed on thecomputer.

  • Install the NVIDIA CUDA Toolkit:
    • sudo apt install nvidia-cuda-toolkit
  • Buildgominer:
    • cd gominer
    • go generate -tags cuda .
  • Testgominer detects your GPU(s):
    • ./gominer -l
  • You may nowconfigure and rungominer

Windows

Windows Preliminaries

Gominer works with OpenCL (both AMD and NVIDIA) and CUDA (NVIDIA only).

At the current time, most users have reported that OpenCL gives them higherhashrates on NVIDIA. Additionally, building the CUDA-enabled version ofgominer on Windows is a much more involved process. For these reasons, unlessyou really want to run the CUDA version for a specific reason, it is recommendedto use OpenCL.

Windows Prerequisites

The following steps are applicable for both OpenCL and CUDA builds ofgominer:

  • Download and installMSYS2
    • Make sure you uncheckRun MSYS2 now.
  • Launch theMSYS2 MINGW64 shell from the start menu
    • NOTE: TheMSYS2 installer will launch theUCRT64 shell by default ifyou didn't uncheckRun MSYS2 now as instructed. That shell will not work,so close it if you forgot to uncheck it in the installer.
  • From within theMSYS2 MINGW64 shell enter the following commands to installgcc,git,go,unzip:
    • pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-tools mingw-w64-x86_64-go git unzip
    • git clone https://github.com/decred/gominer
  • Close theMSYS2 MINGW64 shell and relaunch it
    • NOTE: This is necessary to ensure all of the new environment variables are set properly
  • Jump to the appropriate section for eitherOpenCL orCUDAdepending on which GPU library you want to buildgominer for
OpenCL Prerequisites on Windows

The following is needed when performing an OpenCL build:

  • Still in theMSYS2 MINGW64 shell enter the following commands to installthe light OpenCL SDK:
    • wget https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/files/1406216/lightOCLSDK.zip
    • unzip -d /c/appsdk lightOCLSDK.zip
  • Jump to the appropriate section for eitherOpenCL with AMD orOpenCL with NVIDIA depending on which type of GPU you have
OpenCL with AMD
  • Change to the library directory C:\appsdk\lib\x86_64
    • cd /c/appsdk/lib/x86_64
  • Copy and prepare the AMD Display Library (ADL) for linking
    • cp /c/Windows/SysWOW64/atiadlxx.dll .
    • gendef atiadlxx.dll
    • dlltool --output-lib libatiadlxx.a --input-def atiadlxx.def
  • Build gominer
    • cd ~/gominer
    • go build -tags opencl
  • Testgominer detects your GPU(s)
    • ./gominer -l
  • You may nowconfigure and rungominer
OpenCL with NVIDIA
  • Build gominer
    • cd ~/gominer
    • go build -tags opencl
  • Testgominer detects your GPU(s)
    • ./gominer -l
  • You may nowconfigure and rungominer

CUDA with NVIDIA

Building the CUDA-enabledgominer on a Windows platform is tricky, requiresseveral GB worth of downloads and while we have made attempts at detecting thenecessary tools and automating the building process, it is not guaranteed towork, in particular as newer or older versions of the various tools areinstalled.

This guide has been tested on a Windows 10 machine, with an NVIDIA graphics cardinstalled, using Microsoft Visual Studio Community Edition 2022 and NVIDIA CUDAToolkit version 12.2. If the automatic builder forgominer does not work onyour system, you many need tomanually setup the varioustools.

After fulfilling theWindows prerequisites, followthe following instructions:

User Reported Hashrates

OpenCL

GPUHashrate
NVIDIA GTX 10603.0 Gh/s
AMD RX 5803.7 Gh/s
NVIDIA 1660 Super5.0 Gh/s
AMD Vega 567.0 Gh/s
NVIDIA RTX 3060 Ti8.7 Gh/s
NVIDIA GTX 3080 Mobile9.4 Gh/s
NVIDIA RTX 307010.1 Gh/s
NVIDIA RTX 208010.4 Gh/s
NVIDIA Tesla V10013.9 Gh/s
NVIDIA Tesla V100S14.6 Gh/s
NVIDIA RTX 407014.9 Gh/s
NVIDIA RTX 308015.2 Gh/s
NVIDIA RTX 309017.6 Gh/s
AMD 7900 XTX23.8 Gh/s

Packages

No packages published

Languages

  • C59.8%
  • Go38.6%
  • Cuda1.6%

[8]ページ先頭

©2009-2025 Movatter.jp