Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gpu miner #1263

Closed
Closed

Conversation

Gustav-Simonsson
Copy link

EDIT: branch moved to https://github.com/ethereum/go-ethereum/tree/gpu_miner

Please run:

geth gpuinfo

If it works you can then try with:

geth gpubench <device id>

and then add the GPU mining flag.

NOTE:

  • Try geth gpuinfo first! This will tell you if it can find OpenCL and your GPU.
  • You need to install a OpenCL installation. I've tested with AMDs.
  • AMD cards on Linux may require root to run due to buggy GPU drivers

Ubuntu OpenCL instructions: http://wiki.tiker.net/OpenCLHowTo

@obscuren obscuren modified the milestone: 0.9.32 Jun 15, 2015
@Gustav-Simonsson Gustav-Simonsson force-pushed the gpu_miner branch 5 times, most recently from ab8c956 to 90a209b Compare June 17, 2015 17:19
@obscuren
Copy link
Contributor

# github.com/Gustav-Simonsson/go-opencl/cl
ld: library not found for -lOpenCL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
godep: go exit status 2

// #endif
// #cgo CFLAGS: -I/opt/opencl-headers/include
// #cgo darwin LDFLAGS: -framework OpenCL
// #cgo LDFLAGS: -lOpenCL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gustav-Simonsson You need to change this in the base repo to something like #cgo linux LDFLAGS: -LOpenCL. This does not work on OS X. The already present -framework is the same as -l -L -i -I

@kobigurk
Copy link
Contributor

(gpubench doesn't crash anymore! it was an opencl configuration issue for me)
mining crashes for me, while gpubench works. I'll send the logs to devs in private.

@zelig
Copy link
Contributor

zelig commented Jun 22, 2015

@Gustav-Simonsson it only works with sudo for me.

Although I run it with --gpuchunks option I get a warning that the dagchunk is larger than mem alloc size:

Warning: DAG size (1082130304) larger than device max memory allocation size (1073741824).
You may have to run with --opencl-mem-chunking

Note also the option --opencl-mem-chunking in the message should probably read --gpuchunks
and should be written on stderr instead of stdout.

Then after Generating cache for epoch 1, it crashes
https://gist.github.com/zelig/f38d32012886836c9db5

@ghost
Copy link

ghost commented Jun 25, 2015

Complied after adding #include "CL/cl.h" to files. works but ignores secondary cards

/miner/go-ethereum/build/bin/geth --minegpu --minerthreads 2 --autodag --datadir....

@obscuren
Copy link
Contributor

obscuren commented Jul 1, 2015

Getting the following error OpenCL init error: Device id not found: <nil> See device ids with: 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              Tahiti
Vendor                   Advanced Micro Devices, Inc.
Version                  OpenCL 1.2 AMD-APP (1729.3)
Driver version           1729.3 (VM)
Address bits             32
Max clock freq           1020
Global mem size          3182428160
Max constant buffer size 65536
Max mem alloc size       2205155328
Max compute units        32
Max work group size      256
Max work item sizes      [256 256 256]
=============================================
Device OpenCL id         0
Device id for mining     1
Device Name              Tahiti
Vendor                   Advanced Micro Devices, Inc.
Version                  OpenCL 1.2 AMD-APP (1729.3)
Driver version           1729.3 (VM)
Address bits             32
Max clock freq           1020
Global mem size          3182428160
Max constant buffer size 65536
Max mem alloc size       2205155328
Max compute units        32
Max work group size      256
Max work item sizes      [256 256 256]
=============================================
Device OpenCL id         0
Device id for mining     2
Device Name              Tahiti
Vendor                   Advanced Micro Devices, Inc.
Version                  OpenCL 1.2 AMD-APP (1729.3)
Driver version           1729.3 (VM)
Address bits             32
Max clock freq           1020
Global mem size          3182428160
Max constant buffer size 65536
Max mem alloc size       2205155328
Max compute units        32
Max work group size      256
Max work item sizes      [256 256 256]
=============================================
Device OpenCL id         0
Device id for mining     3
Device Name              Tahiti
Vendor                   Advanced Micro Devices, Inc.
Version                  OpenCL 1.2 AMD-APP (1729.3)
Driver version           1729.3 (VM)
Address bits             32
Max clock freq           1020
Global mem size          3182428160
Max constant buffer size 65536
Max mem alloc size       2205155328
Max compute units        32
Max work group size      256
Max work item sizes      [256 256 256]
=============================================
Found 4 devices. Benchmark first GPU:       geth gpubench 0
Mine using all GPUs:                        geth --minegpu 0,1,2,3
You may also need to enable chunking:            --gpuchunks

@Gustav-Simonsson
Copy link
Author

@obscuren try re-fetching branch, pushed a fix to gpubench, should work as expected now.

tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this pull request Jan 20, 2022
…#1263)

### Description

This changes the `light.serve` default back to zero so that serving light clients becomes opt-in rather than opt-out.  The reason is that there are many use-cases for running a node that don't involve light clients, and only one use-case that is about serving light clients, so it makes more sense to have it opt-in to avoid people running the light server without realizing it.

### Other changes

* Change `light.maxpeers` default value from 99 back to 100 (the change to 99 was to work around an issue that no longer exists, see below under "Related issues")
* Fix a bug in the logic for the `lightPeers` variable in `SetP2PConfig()` (it was not respecting the default value of LightPeers, leading to incorrect values in the `Maximum peer count` log line and to `MaxPeers` not being increased when it should have been.

### Tested

* Automated tests pass
* Without specifying any flags, LES is off, max peers is 175
* Specifying `--light.serve 100`, LES is on, total max peers is 275, max eth peers is 175, max light peers is 100
* Specifying `--light.serve 100 --light.maxpeers 200`, LES is on, total max peers is 375, max eth peers is 175, max light peers is 200
* Specifying `--light.serve 100 --maxpeers 150`, LES is on, total max peers is 250, max eth peers is 150, max light peers is 100
* Specifying `--light.serve 100 --light.maxpeers 1000 --maxpeers 100`, LES is on, total max peers is 1100, max eth peers is 100, max light peers is 1000 (these are the flag values recommended in the docs for serving light clients, and are based on the fact that if (and only if) you specify both `light.maxpeers` and `maxpeers` then `maxpeers` is assumed to include `light.maxpeers`)

### Related issues

- Closes ethereum#1262
- Additional context: ethereum#395, ethereum#416, ethereum#864 

### Backwards compatibility

Breaking change to the defaults, most notably `--light.serve`, but with limited impact, because in the docs for running a full node we specify `--light.serve`, `--light.maxpeers` and `--maxpeers`, so it's not relying on the defaults anyway.  And for users who are not intending to serve light clients, the new defaults make more sense.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants