How to mine ETH with GPU on your Mac

in #mining7 years ago

Hi steemians,

In this post, I will tell you how to mine ETH with GPU on your Mac. Even though I am explaning with the AMD device, the NVIDIA devices are still can be used same way with small changes of parameters.

Prerequisites

  • Macintosh computer with OSX
  • Basic knowledges about using Terminal (for navigating directories)
  • Ethereum mining pool address for you (try minergate or nicehash if you don't have yet)

Download miner software

From here. Choose the latest release binary for 'Darwin'.
Open Terminal app and go to the directory which the miner software downloaded.

Check your GPU

Run this command. Use '-U' instead of '-G' for NVIDIA ones.

$ ./ethminer -G --list-devices



The result from my laptop shows that I have two opencl devices.

[OPENCL]:
Listing OpenCL devices.
FORMAT: [deviceID] deviceName
[0] Intel(R) HD Graphics 530
    CL_DEVICE_TYPE: GPU
    CL_DEVICE_GLOBAL_MEM_SIZE: 1610612736
    CL_DEVICE_MAX_MEM_ALLOC_SIZE: 402653184
    CL_DEVICE_MAX_WORK_GROUP_SIZE: 256
[1] AMD Radeon Pro 460 Compute Engine
    CL_DEVICE_TYPE: GPU
    CL_DEVICE_GLOBAL_MEM_SIZE: 4294967296
    CL_DEVICE_MAX_MEM_ALLOC_SIZE: 1073741824
    CL_DEVICE_MAX_WORK_GROUP_SIZE: 256

Mining

Let's start mining with my 'AMD 460'.

$ ./ethminer -G -S YOUR_MINING_POOL_ADDRESS -O YOUR_MINING_POOL_WALLET_ADDRESS --opencl-device 1



I've used '1' for '--opencl-device' option, because the index of my 'AMD 460' is '1' according to the result of previous command. Without this, it will run with my 'Intel HD Graphics' and maybe not mining properly. Replace YOUR_MINING_POOL_ADDRESS and YOUR_MINING_POOL_WALLET_ADDRESS with your real ones.
Use '-U' instead of '-G' for NVIDIA ones.
You can refer example for addresses at here.
Here is the screenshot from running on my mac.
스크린샷 2017-07-19 오후 4.37.54.png
It's mining approximately 1.5MH/s which is very poor performace to earn enough money 😥

For advanced using

You can see available options with this command.

$ ./ethminer --help



Enjoy your mining life~

Sort:  

I've tried compiling from source code, and got some improved result(6~7MH/s) than the binary released file(1.5MH/s).
I've also tested with ethermine pool and dwarfpool. it seems to work well.
I'll post about it when I get enough free time.

I've just found that my method only works with minergate pool and also have another problems that mentioned on comments.
I'm figuring it out and will post another article if I can find the solution.
Sorry for posting with incorrect information.
(I voted to this comment myself to place this comment on top position)

Nice tutorial mate.. need to really build a ethereum mining rig to get some good hash power. Or you can just use a cloud mining service.. I prefer the later because no noise in my house or power bill.

If you want to mine on the cloud let me know I can hit you up with some discount on hashing power

Thank you. I am aleady mining on cloud service 😁

Mnergate is a scam, I mined it on multiple computers for days before I actually searched for myself.

Oh is it really?

Nice information on mining
Follow @dine77
Pls check my last blog upvote if like

I did! 😁

soon8013. I am hoping you can help me track down a bug in this implementation. From your description, you are running into the same issue as I and not realizing it. Watch your terminal output closely when running these commands. Your main command:

$ ./ethminer -G -S YOUR_MINING_POOL_ADDRESS -O YOUR_MINING_POOL_WALLET_ADDRESS --opencl-device 1

-Try putting 0 or 1 as the --opencl-device value. It doesnt matter, if you watch the output it says

"Found suitable OpenCL device [ Intel(R) HD Graphics 630 ] with 1610612736 bytes of GPU memory".

-That is only 1.6GB of memory. It appears to be using the onboard Intel GPU no matter what I put in. My dedicated Radeon Pro 560 has 4GB memory, and if it indeed was using that GPU, would be netting MUCH higher than the ~ 1.5 MH/s (I was getting the exact same numbers as you) - this GPU would be getting more like 20+ MH/s I would imagine. I tried messing with the "--opencl-platform" parameters and got the same crap results, and '1' it wont even run.

If it is indeed the Intel GPU running every time (only thing that explains 1.5 MH/s), HOW is it running. The Ethereum DAG file is well over 1.6 GB, so the Intel must be using shared system memory or something to load the DAG.

Maybe this issue has something to do with the automatic graphics switching these newer Macs use.

Side note issue: I have yet to get the miner to run successfully again, not even at the 1.5 MH/s rate. No error messages, the terminal just stops outputting. So many problems with this setup, is any of this making sense???

Oh I've just read your reply. I'll check it deeper.

Hello! This is the first tutorial I found that works for gpu mining on my Mac. Thanks you! I do want to use my GTX 970 eGPU (device 0)instead of my MBP's graphic card (device 1). The devices are recognized by eth.

Last login: Wed Sep 13 15:43:46 on ttys002
MacBook-Pro:~ marksnyder$ cd desktop/eth
MacBook-Pro:eth marksnyder$ ./ethminer -G --list-devices

Listing OpenCL devices.
FORMAT: [platformID] [deviceID] deviceName
[0] [0] HD Graphics 4000
CL_DEVICE_TYPE: GPU
CL_DEVICE_GLOBAL_MEM_SIZE: 1610612736
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 402653184
CL_DEVICE_MAX_WORK_GROUP_SIZE: 512
[0] [1] GeForce GTX 970
CL_DEVICE_TYPE: GPU
CL_DEVICE_GLOBAL_MEM_SIZE: 4294967296
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 1073741824
CL_DEVICE_MAX_WORK_GROUP_SIZE: 1024
MacBook-Pro:eth marksnyder$

Do you know that there's a way to do it? I tried adding -U but that didn't work. I ran -X but appears to be only running my MBP's card. I was given this message: CUDA support disabled when adding -U. Configure project build with -DETHASHCUDA=ON. I don't know how to use it though. If I add --opencl-device 0 to the string connects and I get speeds of Speed 0.00 Mh/s gpu/0 0.00 [A0+0:R0+0:F0] Time: 00:00. Any ideas? TIA, Mark

Have you tried compiling with -DETHASHCL=OFF -DETHASHCUDA=ON ?

Hi soon8013, Thanks for the reply. I have not been able to figure out how to complile with with -DETHASHCUDA=ON. What is the command? Thanks!

And have you installed cuda drivers for MAC?

My eGPU is running under Sierra. I use it for 3d rendering without a problem. I have mined bitcoin with it via Asteroid (a total waste of time and electricity). I am hoping to play around and mine a bit of Ethereum. Any suggestions? Thanks again.

From your log it looks like ur eGPU is device 1 and ur integrted graphics is device 0. Have you tried --opencl-device 1 instead of --opencl-device 0 ?

Thanks for this tut. Great wirte up. When I run the command in terminal, I get the following message.

CUDA support disabled. Configure project build with -DETHASHCUDA=ON

Is there an ethminer available with CUDA support?

Thanks. I'm going to have to give this a try.