Ethminer: Macbook PRo 2017 - AMD Radeon 560 GPU = Error: clSetKernelArg -48

Created on 22 Dec 2017  Â·  13Comments  Â·  Source: ethereum-mining/ethminer

I've recently been trying to get ethminer to run on the latest 2017 MacBook Pro's since they have a GPU that should* be able to mine above 3Mh/s. Multiply that by 100 and you got 300.

Anyway, I've tried for about 7 hours yesterday to get it working and just could not get it going. For the record, running under dual boot windows or ubuntu (even under parallels is out of the question) - licensing.

Here's the error I get when running ethminer:

/ethminer -G -M --opencl-platform 0 --opencl-device 1
ℹ 12:34:20| Found suitable OpenCL device [ Intel(R) HD Graphics 630 ] with 1610612736 bytes of GPU memory
Benchmarking on platform: CL
Preparing DAG for block #0
cl 12:34:20|cl-0 No work. Pause for 3 s.
Warming up...
cl 12:34:23|cl-0 New work: header #50c856ae… target 0000000000000002000000000000000000000000000000000000000000000000
cl 12:34:23|cl-0 New seed #00000000…
cl 12:34:24|cl-0 Platform: Apple
cl 12:34:24|cl-0 Device: AMD Radeon Pro 560 Compute Engine / OpenCL 1.2
cl 12:34:24|cl-0 Build info:
cl 12:34:24|cl-0 Creating light cache buffer, size 16776896
cl 12:34:24|cl-0 Creating DAG buffer, size 1073739904
cl 12:34:24|cl-0 Loading kernels
cl 12:34:24|cl-0 Writing light cache buffer
cl 12:34:24|cl-0 Creating buffer for header.
cl 12:34:24|cl-0 Creating mining buffer
cl 12:34:24|cl-0 Generating DAG
cl 12:34:24|cl-0 DAG 0 %
cl 12:34:25|cl-0 DAG 6 %
cl 12:34:25|cl-0 DAG 12 %
cl 12:34:26|cl-0 DAG 18 %
cl 12:34:26|cl-0 DAG 25 %
cl 12:34:26|cl-0 DAG 31 %
cl 12:34:27|cl-0 DAG 37 %
cl 12:34:27|cl-0 DAG 43 %
cl 12:34:28|cl-0 DAG 50 %
cl 12:34:28|cl-0 DAG 56 %
cl 12:34:29|cl-0 DAG 62 %
cl 12:34:29|cl-0 DAG 68 %
cl 12:34:29|cl-0 DAG 75 %
cl 12:34:30|cl-0 DAG 81 %
cl 12:34:30|cl-0 DAG 87 %
cl 12:34:31|cl-0 DAG 93 %
cl 12:34:31|cl-0 Switch time 10273 ms / 7268211 us
Trial 1... 7869238
Trial 2... 8082117
Trial 3... 8078074
Trial 4... 8181347
Trial 5... 8182165
✘ 12:34:50|cl-0 OpenCL Error: clSetKernelArg -48
min/mean/max: 7869238/8078588/8182165 H/s
inner mean: 8113846 H/s

I followed a guys guide I found here...

In a nutshell his instructions are this:

Install Xcode (app store)
Install cMake (used for building binary on osx)
-/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-brew install cmake
Install ethminer
-git clone https://github.com/ethereum-mining/ethminer.git
-cd ethminer; mkdir build; cd build
-cmake ..
-cmake --build .

That builds the ethminer binary on osx however I constantly get the following error when attempting to mine: OpenCL Error: clSetKernelArg -48

Driving me nuts. Tried multiple systems. I feel like this is an opencl issue but where? In the code or on the system?

I've also tried just about every variation of ethminer. Tried ethminer version 10-12. All same error. OpenCL comes with OSX 10.12.6 (the version im running) so I'm not sure what else I'm missing here..

Most helpful comment

The whole line is actually:
./ethminer --farm-recheck 100 --work-timeout 40 --opencl-platform 0 --opencl-device 1 --cl-local-work 256 --cl-global-work 32768 --cl-parallel-hash 2 -G -S eth-eu2.nanopool.org:9999 -FS eth-eu1.nanopool.org:9999 -O {wallet}.{worker name}/{email} -SC 2 -SP 1 -RH -v 1

-v 1 meaning less verbose, use 2-9 to get moer output

Replace your {wallet}, {worker name}, and (optionally) {email} there. Also replace pool addresses by location and pool. Different pools accept different settings, e.g. Noobpool takes wallet & worker in -F parameter (non-stratum?).

All 13 comments

I also tried different operating system installs. 10.12.6 and 10.13.1 and .2

no change. same error. I'm starting to think it's something specific to this model mbp.

Are you sure you're not trying to mine on the Intel HD Graphics (integrated GPU) instead of that Radeon Pro? I.e. have you tried running ethminer like so:
/ethminer -G -M --opencl-platform 0 --opencl-device 0

You could also do a list-devices check to see what are the options:
/ethminer --list-devices

Also check from top left Apple-menu -> System Preferences -> Energy Saver to see if you have automagick graphics switching turned on. (The very first checkbox.) Try disabling that. And plug in power cable.

You're probably using quite small local and global worker sizes (the DAG should/could build up in much larger chunks). Try adding params:
--cl-local-work 256 --cl-global-work 32768 --cl-parallel-hash 2
(you could also try --cl-local-work 128 and --cl-global-work 16384)

It's not the numbers crunching power of GPU you need in ETH mining; GPU memory speed and bus width matter a lot more. Your memory bandwidth seems to be capped at 81.28 GB/s (https://www.techpowerup.com/gpudb/2971/radeon-pro-560), which means that the theoretical maximum ETH mining speed is somewhere around 10.16 MH/s. Each hash test is 8 KB, which comes from 64 x 128 bytes. Those 64 are the SHA3-loops, picking the next 128 byte fetch roughly "at random" (not really at random, but that's what the GPU's MMU thinks).

I am positive that I'm using the correct device. I've used those parameters to specify the proper AMD device.

To your second point about the power option, I've tested that off and on. (the auto switching). The power cable is always plugged in when testing as well.

I've tried this on a Mac Pro that has only the AMD FirePro D500 GPU as well. Same error.

Note: I just tried it by adding the parameters you suggested: "--cl-local-work 256 --cl-global-work 32768 --cl-parallel-hash 2"

Same error.

Bummer. :(
Have you tried mining to e.g. a pool to see if that works? I mean, ethminer definitely does something when it's already going through those 5 trials, and even gets a mean value.
I recall there was another issue, claiming FS exit is broken. Maybe the kernel error you're seeing is just caused by the same or related bug?

Just tested. I got clSetKernelArg -49 error on Windows 10. So: don't worry about the error, it just seems to be a bug in the test.

From the spex of clSetKernelArg (e.g. https://streamhpc.com/blog/2013-04-28/opencl-error-codes/) this tastes like ethminer is just destroying that OpenCL miner kernel from memory, before another thread is finished with it. Or.. that unaware thread is just a braindead data feeder for the OpenCL-kernel, and has no clue what-so-ever of the removal. (A simple if check in the code could fix this?)

The ethminer codebase with all it's threads just flyin' around is currently at a bit messy state IMHO. An architectural vision and a roadmap towards clearer thread and class responsibilities would help to overcome bugs like these. But as many things are happening now (like enhanced CUDA support), I think the project leads must have weighted code/project refactoring as a lower priority task.

Regardless of this error I'm successfully mining to Nanopool atm.

I have tried mining to a pool. I get stratum error: Handle Response Failed: Operation not Permitted.

holy shit i just thought of something...
AH! Bummer, I thought maybe the command needed to be run as SUDO. Didn't work.

I think what's going on here is that even though the AMD GPU 560 is the selected GPU, it's still trying to mine with the Intel graphics. I see that people got the AMD Radeon 460 to work. I see no results from 560 users.
However, what really throws me for a loop is that this also failed on a Mac Pro that has the AMD Fire Pro D500 (3GB RAM) model. In fact, I believe it has two. Therefor that should* work, yet it yields the same error.

Just curious, what OS are you mining on? OS X?

Thank you for the opencl error code list, that's very useful. I'm surprised it didn't come up in a google search for me considering all the searching I've been doing on this.

No prob.

I'm more of just checking out all the blockchain related software to get a hang of how to utilise Ethereum's Smart Contracts and how to implement blockchain tech for different industries in valid use cases.

But currently, I've got a Win 10 machine mining, just because of the Vega 64 card.

I do have an MB Pro 2013 late I use for programming, but this only has a 2GB GT 750M, so it's unable to mine ether. I did create an OpenCL + OpenGL simulation with this about a year ago, so I had to battle with OpenCL device indexing back then - especially since I wanted to, and succeeded in, running both GPUs (Iris Pro & nvda GT) in tandem. I ended up using Iris Pro for calculating physics & behavioural models in OpenCL, and GT for OpenGL visualisations. Iris Pro was used for OpenCL, because it was faster on pure number crunching jobs. Then again, only the memory bandwidth matters when mining Ether. Which ever GPU has faster mem throughput, it's more lucrative to use that.

I use parameters "-SC 2 -SP 1 -RH" when mining to Nanopool. Have you tried fiddling with the stratum params? By looking at the code, depending on stratum version it sends different kind of JSON data to pool server. Just guessing here.. :D

The whole line is actually:
./ethminer --farm-recheck 100 --work-timeout 40 --opencl-platform 0 --opencl-device 1 --cl-local-work 256 --cl-global-work 32768 --cl-parallel-hash 2 -G -S eth-eu2.nanopool.org:9999 -FS eth-eu1.nanopool.org:9999 -O {wallet}.{worker name}/{email} -SC 2 -SP 1 -RH -v 1

-v 1 meaning less verbose, use 2-9 to get moer output

Replace your {wallet}, {worker name}, and (optionally) {email} there. Also replace pool addresses by location and pool. Different pools accept different settings, e.g. Noobpool takes wallet & worker in -F parameter (non-stratum?).

Well, I'll be damned. The line you gave me is actually working. 8.39Mh/s.

I'll be damned...

edit: 9.3mh/s! Whoa! Better than I expected!

Would you care to elaborate as to what you think the problem with the stratum pool is? This has me stumped.

That Nanopool line is in one of the stratum modes (-SC 2 -SP 1), the non-stratum sidenote was related to Noobpool (different pool). Sorry if I was unclear.

There are lots of switches and parameters that affect the inner workings of ethminer and messaging with servers. At first I tried some params, got frustrated, opened the code in Visual Studio and read the code through to get an understanding what's going on.

Well, androidi, you've been a fantastic help. Thank you very much.

Was this page helpful?
0 / 5 - 0 ratings