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_minerHow 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_miner2. 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]
Comments
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
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
[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]
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.
Not solved in ethminer yet: https://github.com/ethereum/cpp-ethereum/pull/2575
edit: disregard the permissions problem, my .ethash dir had root permissions i guess from running something as root previously
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
2. Make
@mooneyj @cryptoboy that export should solve your allocation errors!
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
# export GPU_MAX_ALLOC_PERCENT=95