Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

OpenCL chunker is disabled #227

Closed
michaelmarks opened this issue Feb 16, 2016 · 7 comments
Closed

OpenCL chunker is disabled #227

michaelmarks opened this issue Feb 16, 2016 · 7 comments

Comments

@michaelmarks
Copy link

  • OpenCL miner ignores the CL_DEVICE_MAX_MEM_ALLOC_SIZE param and attempts to alloc ~ 1GB of device memory. If this allocation gracefully fails, it falls back to the chunker approach
  • @LefterisJP disabled OpenCL chunking because it did not work

I hacked the BlockChainSuite tests to always use the GPU and I can reproduce the problem. The test runs forever and never terminates. If the chunker uses CL_MAP_WRITE rather than CL_MAP_WRITE_INVALIDATE_REGION, the chunker approach starts passing these tests. This edit seems unnecessary, the disabled code seems like it should work.

The current code does seem unnecessarily complex since we don't use map/unmap in the single chunk approach and enqueueWriteBuffer seems simpler. We are mapping a read-only buffer for writing, however changing the buffer to read/write did not improve things. I feel like I'm missing the root cause, but I'm running out of ideas, and we can re-enable the chunker by switching to CL_MAP_WRITE.

I'll commit the change to use CL_MAP_WRITE in my fork, then I'll commit another edit to use enqueueWriteBuffer instead. This minimizes the differences between the single and quad chunking approaches.

I'd like to know how to run your full OpenCL regression suite. By default testeth appeared to use CPU rather than GPU mining, I hacked my local codebase to force GPU mining for these tests.

@LefterisJP
Copy link
Collaborator

The reason OpenCL chunker is disabled is because it was only useful for those old GPUs which could not allocated a DAG in one chunk. We tested with many GPUs and mining worked but a block was never found. We were tracking the problem down but ended up playing it safe and totally disabling it since most miners actually have up to date GPUs and would not care either way.

Since then priorities have changed, the code was not looked at again and with the coming of the switch to the Proof Of Stake this still does not seem like a priority.

Why are you interested in chunking? You mentioned a possible fix? Can you create a pull Request?

@michaelmarks
Copy link
Author

Understand it's not a priority. I can create the pull-request. But feel free to disregard, this issue can serve as an FYI.

As an interesting side-project, I wanted to port the OpenCL miner to Metal on OSX, potentially to be used by an iOS app to do verification. Purely a mental exercise.

I noticed the current OpenCL code crashes the most recent MacBook laptops running an Intel GPU (both MacBook Pro & MacBook Air). No nice error, just abort trap. Since I didn't have a working OpenCL miner, I wanted to get that fixed locally at least for regression testing and Metal vs OpenCL
comparisons. The OpenCL miner does work on AMD GPUs on MacBook Pros in my testing.

You have much higher priorities, so feel free to completely disregard. This issue will always be google-able for others.

On Tuesday, February 16, 2016, Lefteris Karapetsas notifications@github.com
wrote:

The reason OpenCL chunker is disabled is because it was only useful for
those old GPUs which could not allocated a DAG in one chunk. We tested with
many GPUs and mining worked but a block was never found. We were tracking
the problem down but ended up playing it safe and totally disabling it
since most miners actually have up to date GPUs and would not care either
way.

Since then priorities have changed, the code was not looked at again and
with the coming of the switch to the Proof Of Stake this still does not
seem like a priority.

Why are you interested in chunking? You mentioned a possible fix? Can you
create a pull Request?


Reply to this email directly or view it on GitHub
#227 (comment)
.

@bobsummerwill
Copy link
Contributor

Founds entirely sensible, @michaelmarks. Go for it on the PR!

This has got me wondering whether there might be other parts of the code-base where we could leverage OpenCL (where available) for hashing and similar?

@chriseth @LefterisJP @gcolvin - any thoughts?

@bobsummerwill
Copy link
Contributor

See https://gitter.im/ethereum/cpp-ethereum?at=5734b67164dbdadc7deb7742 and ethereum/libethereum#203.

@Equinox- says:

I'm going to close this. At this point the DAG size has increased even further and the few edge cases that the environmental variables don't solve don't seem to work with this either.

CC @Genoil.

So I will close this issue too.

@Genoil
Copy link
Contributor

Genoil commented May 12, 2016

I just sent somebody with a HD6970 a binary with chunking to see if it helps. If it does and it gets reasonable speeds, who knows what dead army of aging AMD cards could be resurrected ;)

@bobsummerwill
Copy link
Contributor

Indeed, @Genoil!

@dan-da
Copy link

dan-da commented Jun 10, 2016

@Genoil so... did it work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants