Try out the new Go GPU miner (just geth!)

gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
edited August 2015 in Mining
Hi,

We've added a experimental GPU miner to go-ethereum. This allows you to GPU mine with just geth.

As it's an alpha version and not stable, it lives in a separate branch in the main repository: https://github.com/ethereum/go-ethereum/tree/gpu_miner

How to run:

0. Install a OpenCL implementation. I've tested with AMD's SDK: http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/
1. checkout the gpu_miner branch: https://github.com/ethereum/go-ethereum/tree/gpu_miner
2. make
3. ./build/bin/geth gpuinfo
4. ./build/bin/geth gpubench 0
5. ./build/bin/geth minegpu 0

You can mine on multiple GPUs with: minegpu 0,1,2,3 (this will start mining on the first 4 GPUs found).

You may need export GPU_MAX_ALLOC_PERCENT=95 to allow the GPU to allocate the DAG. This will be needed for some older cards and depends on it's default OpenCL max alloc buf size.


Happy hashing :)

Feel free to post any feedback in this thread or ping me on gitter/email if you have any questions.

// [email protected]
Post edited by gustav_simonsson on
«1

Comments

  • hangabershangabers Member Posts: 63
    This is rad, should lower the entry barrier for the less experienced ethernaughts
  • jeroenn13jeroenn13 Member Posts: 3
    edited July 2015
    Is there a benchmark option? also is this different than ethminer (better speed? etc..)?
  • the_generatorthe_generator Member Posts: 4
    Thanks Gustav, I tried it and it works... ;-)
    Here some results:
    Radeon R7 260X (2GB) - 4,2MH/s (average HR)
    Radeon R9 285 (4GB) - 17,2 MH/s (average HR)
    This is a little bit more Hashrate than I got with ethminer.
    Sometimes the Hashrates jumped up, peaked to double (and even 4-times) of the average HR .... Some sort of hickup due to its alpha-state?
    Kind regards,
    gen
  • CryptoFutureCryptoFuture Member Posts: 44
    edited July 2015
    ./geth gpubench 0 --gpuchunks
    error: "flag provided but not defined: -gpuchunks"

    also tried "--gpuchunks 20" with no success

    nevermind I just had to run ./geth --gpuchunks gpubench 0.

    I'm a command line noob :)
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    @the_generator hmm, yeah sounds a bug in the hash rate reporting during benchmarks. thanks for reporting!
  • jzenjzen Member Posts: 49
    @gustav_simonsson Does the geth GPU miner support GPU mining via ethminer as well?
  • mooneyjmooneyj Member Posts: 7
    Sadly the --gpuchunks flag isn't working for my small Max Memory Allocation size (511MB of global 2GB -nvidia 660Ti). Anyone know how to fix this? I can't get this to work in the cpp ethminer either.

    [email protected]:~/ethereum/go-ethereum$ ./build/bin/geth --minegpu 0 --gpuchunks
    I0723 23:15:41.527827 4772 backend.go:289] Protocol Versions: [61 60], Network Id: 0
    I0723 23:15:41.528311 4772 backend.go:318] Blockchain DB Version: 3
    I0723 23:15:41.529059 4772 chain_manager.go:257] Last block (#972560) fec705d39447d0530d9b2d6b16de652cd4fd8088d6a282b8b07072adf0ede841 TD=10187158988093992
    I0723 23:15:41.547138 4772 cmd.go:121] Starting Geth/v0.9.39-5ee05a33/linux/go1.4.2
    I0723 23:15:41.547250 4772 server.go:311] Starting Server
    I0723 23:15:41.549863 4772 nat.go:111] mapped network port udp:30303 -> 30303 (ethereum discovery) using NAT-PMP(192.168.1.1)
    I0723 23:15:41.727547 4772 udp.go:205] Listening, enode://e9ec133747e66f5919fc6e52e3c6fc1b518594d1ddcbdd7db32845a178b28277b[email protected]82.30.172.17:30303
    I0723 23:15:41.727685 4772 backend.go:575] Server started
    I0723 23:15:41.727679 4772 server.go:548] Listening on [::]:30303
    I0723 23:15:41.728056 4772 ipc_unix.go:76] IPC service started (/home/john/.ethereum/geth.ipc)
    I0723 23:15:41.728718 4772 miner.go:120] Starting mining operation (CPU=1 TOT=1)
    I0723 23:15:41.730366 4772 worker.go:502] commit new work on block 972561 with 0 txs & 0 uncles. Took 1.597679ms
    I0723 23:15:41.731649 4772 nat.go:111] mapped network port tcp:30303 -> 30303 (ethereum p2p) using NAT-PMP(192.168.1.1)
    I0723 23:15:41.735013 4772 ethash.go:202] Generating DAG for epoch 32 (size 1342176128) (5a46dd85298b0beff65ccf3006c4b5d2f7fa6ca8a5885a7f2132714fe7a48602)
    I0723 23:15:43.003193 4772 ethash.go:219] Done generating DAG for epoch 32, it took 1.268220249s
    WARNING: DAG size (1342176128) larger than device max memory allocation size (536788992).
    You may have to run with --gpuchunks
    Initialising device 0: GeForce GTX 660 Ti
    OpenCL EnqueueWriteBuffer (DAG): host mem offset, chunkSize, dagSize: 0 335543936 1342176128
    OpenCL EnqueueWriteBuffer (DAG): host mem offset, chunkSize, dagSize: 335543936 335543936 1342176128
    OpenCL EnqueueWriteBuffer (DAG): host mem offset, chunkSize, dagSize: 671087872 335543936 1342176128
    Error in Search clEnqueueMapBuffer: cl: Mem Object Allocation Failure
    OpenCL init error: mapping buffer for DAG chunk write failed: %!(EXTRA *errors.errorString=cl: Mem Object Allocation Failure)
    I0723 23:16:11.727978 4772 downloader.go:277] Block synchronisation started
    I0723 23:16:11.728080 4772 miner.go:76] Mining operation aborted due to sync operation
    I0723 23:16:21.258318 4772 miner.go:120] Starting mining operation (CPU=1 TOT=1)
    I0723 23:16:21.261087 4772 worker.go:502] commit new work on block 972561 with 0 txs & 0 uncles. Took 2.660023ms
    I0723 23:16:22.323849 4772 chain_manager.go:678] imported 255 block(s) (0 queued 1 ignored) including 0 txs in 1.065360693s. #972815 [fec705d3 / 24bc6225]
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    @jzen The geth GPU miner does not support ethminer. The idea with this implementation is to provide a geth-only GPU miner.

    One reason for this design decision is so we can have a bit of redundancy in miner implementations, just like we have multiple client implementation of the Ethereum protocol. Also it's a bit simpler to setup as one only needs to compile Go.
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    @mooneyj Thanks for reporting! Will look into this. I tried chunking on a Geforce GTX 960 which also has 0.5 GB of allocation size and on that one the allocation worked. Looks like on your card the first 2 allocations work but the 3rd one fails.
  • mooneyjmooneyj Member Posts: 7
    @gustav_simonsson I hope it works, thanks for looking into it!
    Not solved in ethminer yet: https://github.com/ethereum/cpp-ethereum/pull/2575
  • skithunoskithuno Member Posts: 74
    @gustav_simonsson , is the gpu_miner branch going to be ready at Frontier launch? or will it be many commits behind? Looks like the last time it was edited was June 12 :disappointed:
  • nickycakesnickycakes Member Posts: 7
    skithuno said:

    @gustav_simonsson , is the gpu_miner branch going to be ready at Frontier launch? or will it be many commits behind? Looks like the last time it was edited was June 12 :disappointed:

    Would love an answer to this as well. the cpp miner is giving me benchmarks of 0, but this miner is giving me proper benchmarks, so without syncing the testnet (seems impossible at this point), using the go miner seems like the only way I can be sure I'm ready.
  • skithunoskithuno Member Posts: 74
    @nickycakes , Don't worry benchmarks of zero, doesn't mean you didn't install everything properly. Benchmarking has been mostly working, but it's not perfect.
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    @nickycakes Thanks for the reminder - just rebased it on version 1.0.0 and pushed. Please try if it works for you.
  • nickycakesnickycakes Member Posts: 7
    edited July 2015

    @nickycakes Thanks for the reminder - just rebased it on version 1.0.0 and pushed. Please try if it works for you.

    benchmarking works. is it normal that I need to run it as root? gpu geth/ethminer crash while generating dag with a permission error if i'm not running it as root

    edit: disregard the permissions problem, my .ethash dir had root permissions i guess from running something as root previously
    Post edited by nickycakes on
  • zaxxonzaxxon Member Posts: 6
    Successfully installed this on MacPro(2013) running OS X 10.9.5. It kind of works.. Hashrate bounces between 3.3MH/s and 0H/s (Dual D500). Only 1 GPU seems to be working as gpubench gave the same hashrate.
  • cryptoboycryptoboy Member Posts: 74
    Great! I'll try that, since my 50 ec2 GPU instances didn't produce a single block with geth + ethminer. My suspicion is that ethminer wasn't really compatible with geth. But if geth has it built in, I'd trust it.
  • cryptoboycryptoboy Member Posts: 74
    I'm gething this... even though I got 4GB of GPU RAM:
    Device OpenCL id 0
    Device id for mining 0
    Device Name GRID K520
    Vendor NVIDIA Corporation
    Version OpenCL 1.1 CUDA
    Driver version 340.29
    Address bits 32
    Max clock freq 797
    Global mem size 4294770688
    Max constant buffer size 65536
    Max mem alloc size 1073692672
    Max compute units 8
    Max work group size 1024
    Max work item sizes [1024 1024 64]

    I0801 01:10:29.866231 2312 ethash.go:202] Generating DAG for epoch 0 (size 1073739904) (0000000000000000000000000000000000000000000000000000000000000000)
    I0801 01:10:31.166445 2312 ethash.go:219] Done generating DAG for epoch 0, it took 1.300217161s
    WARNING: DAG size (1073739904) larger than device max memory allocation size (1073692672).
    You may have to run with --gpuchunks
  • andyatcruxandyatcrux Member Posts: 10
    edited August 2015
    Is anyone so generous as to share any Windows binaries? Hm.... I see there is a windows build already there, does it have ethminer built in? I am running the latest chocolatey version of Geth. Welp, maybe i am too clueless to get mining yet.
    Post edited by andyatcrux on
  • arandyarandy Member Posts: 37
    What is meant with?
    2. Make
  • cryptoboycryptoboy Member Posts: 74
    Don't try this on EC2, I don't think it works.
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    @cryptoboy It means it will most likely not work without chunking, which we're having troubles with.
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    edited August 2015
    Branch updated with removal of chunking. Instead export GPU_MAX_ALLOC_PERCENT=95 if you have troubles with the DAG allocation (will be needed for some cards!)

    @mooneyj @cryptoboy that export should solve your allocation errors! :)
  • gustav_simonssongustav_simonsson Member, Moderator Posts: 21 mod
    Rebased on v1.0.1
  • cheymscheyms Member Posts: 4

    Rebased on v1.0.1

    Seems to be working. Thank you :)
  • blackout24blackout24 Member Posts: 5
    Anyway to point this at: http://ethpool.org/ ?
  • lfowlie890lfowlie890 Member Posts: 2
    even with export GPU_MAX_ALLOC_PERCENT=95 I'm still getting
    I0806 22:45:10.433074 7931 ethash.go:202] Generating DAG for epoch 1 (size 1082130304) (290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563)
    I0806 22:45:11.607289 7931 ethash.go:219] Done generating DAG for epoch 1, it took 1.174250201s
    WARNING: DAG size (1082130304) larger than device max memory allocation size (536870912).
    You probably have to export GPU_MAX_ALLOC_PERCENT=95
    Initialising device 0: Cayman
    OpenCL init error: allocating dag buf failed: %!(EXTRA *errors.errorString=cl: Invalid Buffer Size)

    gpubench:

    ~/.ethereum/go-ethereum $ ./build/bin/geth gpuinfo
    =============================================
    ============ OpenCL Device Info =============
    =============================================
    Platform id 0
    Platform Name AMD Accelerated Parallel Processing
    Platform Vendor Advanced Micro Devices, Inc.
    Platform Version OpenCL 2.0 AMD-APP (1729.3)
    Platform Extensions cl_khr_icd cl_amd_event_callback cl_amd_offline_devices
    Platform Profile FULL_PROFILE

    Device OpenCL id 0
    Device id for mining 0
    Device Name Cayman
    Vendor Advanced Micro Devices, Inc.
    Version OpenCL 1.2 AMD-APP (1729.3)
    Driver version 1729.3 (VM)
    Address bits 32
    Max clock freq 880
    Global mem size 1910505472
    Max constant buffer size 65536
    Max mem alloc size 536870912
    Max compute units 24
    Max work group size 256
    Max work item sizes [256 256 256]
    =============================================
    Found 1 devices. Benchmark first GPU: geth gpubench 0
    Mine using all GPUs: geth --minegpu 0

  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    @gustav_simonsson, could you explain what the --gpuchunks is/does/(was). My understanding is that it was an attempt to get GPU's with less memory than the DAG size to mine. I see that it's been pulled from the branch now. Does that mean that this attempt has been given up on now?
  • cheymscheyms Member Posts: 4

    @gustav_simonsson, could you explain what the --gpuchunks is/does/(was). My understanding is that it was an attempt to get GPU's with less memory than the DAG size to mine. I see that it's been pulled from the branch now. Does that mean that this attempt has been given up on now?

    For those GPU's one can use the following prior to starting up geth

    # export GPU_MAX_ALLOC_PERCENT=95
Sign In or Register to comment.