This is the revised version of my previous post how to mine eth with gpu on your mac. It showed less performance than the devices can do and only worked with minergate pool.
I've tried compiling from source code and got better result than my previous one. I'm not sure all problems are solved, but it definitely shows improved result.
Let's do it.
1. Prerequisites
- XCode
I'm not sure whether it must be needed or not, but I think you have to install it to build from source code.
- Ethereum wallet address
I've tested with ethermine pool and dwarfpool with my own eth wallet address.
Now, open Terminal app and run the following commands.
2. Install CMake
You can skip this step if you already installed CMake on your system
2.1 Install Homebrew
You can skip this step if you already installed Homebrew or other package manager
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.2 Install CMake
$ brew install cmake
3.Get source code
3.1 Go to the directory where you want to download source code
I used my Desktop folder in this post. You can change it as you want.
$ cd ~/Desktop
3.2 Download source code from git repository
$ git clone https://github.com/ethereum-mining/ethminer.git
3.3 Go to the source code directory
$ cd ethminer
4. Build from source code
4.1 Create a build directory
$ mkdir build; cd build
4.2 Configure the project with CMake
$ cmake ..
If you have NVidia GPU(s), you need to add more options
$ cmake .. -DETHASHCUDA=ON
4.3 Build the project using CMake Build Tool Mode
$ cmake --build .
You will get the result like below if you succeeded.
...
[ 0%] Built target BuildInfo.h
Scanning dependencies of target devcore
[ 4%] Building CXX object libdevcore/CMakeFiles/devcore.dir/CommonData.cpp.o
[ 8%] Building CXX object libdevcore/CMakeFiles/devcore.dir/FixedHash.cpp.o
[ 12%] Building CXX object libdevcore/CMakeFiles/devcore.dir/Log.cpp.o
[ 16%] Building CXX object libdevcore/CMakeFiles/devcore.dir/RLP.cpp.o
[ 20%] Building CXX object libdevcore/CMakeFiles/devcore.dir/SHA3.cpp.o
[ 24%] Building CXX object libdevcore/CMakeFiles/devcore.dir/Worker.cpp.o
[ 28%] Linking CXX static library libdevcore.a
[ 28%] Built target devcore
Scanning dependencies of target ethash
[ 32%] Building C object libethash/CMakeFiles/ethash.dir/internal.c.o
[ 36%] Building C object libethash/CMakeFiles/ethash.dir/sha3.c.o
[ 40%] Linking C static library libethash.a
[ 40%] Built target ethash
Scanning dependencies of target ethcore
[ 44%] Building CXX object libethcore/CMakeFiles/ethcore.dir/BlockHeader.cpp.o
[ 48%] Building CXX object libethcore/CMakeFiles/ethcore.dir/EthashAux.cpp.o
[ 52%] Building CXX object libethcore/CMakeFiles/ethcore.dir/Miner.cpp.o
[ 56%] Linking CXX static library libethcore.a
[ 56%] Built target ethcore
[ 60%] Generating OpenCL Kernel Byte Array
Scanning dependencies of target ethash-cl
[ 64%] Building CXX object libethash-cl/CMakeFiles/ethash-cl.dir/CLMiner.cpp.o
[ 68%] Linking CXX static library libethash-cl.a
[ 68%] Built target ethash-cl
Scanning dependencies of target ethstratum
[ 72%] Building CXX object libstratum/CMakeFiles/ethstratum.dir/EthStratumClient.cpp.o
[ 76%] Building CXX object libstratum/CMakeFiles/ethstratum.dir/EthStratumClientV2.cpp.o
[ 80%] Linking CXX static library libethstratum.a
[ 80%] Built target ethstratum
Scanning dependencies of target apicore
[ 84%] Building CXX object libapicore/CMakeFiles/apicore.dir/Api.cpp.o
[ 88%] Building CXX object libapicore/CMakeFiles/apicore.dir/ApiServer.cpp.o
[ 92%] Linking CXX static library libapicore.a
[ 92%] Built target apicore
Scanning dependencies of target ethminer
[ 96%] Building CXX object ethminer/CMakeFiles/ethminer.dir/main.cpp.o
In file included from /Users/soon/Desktop/ethminer/ethminer/main.cpp:26:
/Users/soon/Desktop/ethminer/ethminer/MinerAux.h:729:26: warning: variable
'completed' used in loop condition not modified in loop body
[-Wfor-loop-analysis]
for (unsigned i = 0; !completed; ++i)
^~~~~~~~~
/Users/soon/Desktop/ethminer/ethminer/MinerAux.h:814:27: warning: variable
'completed' used in loop condition not modified in loop body
[-Wfor-loop-analysis]
for (unsigned i = 0; !completed; ++i)
^~~~~~~~~
/Users/soon/Desktop/ethminer/ethminer/MinerAux.h:1071:11: warning: private field
'm_parallelHash' is not used [-Wunused-private-field]
unsigned m_parallelHash = 4;
^
3 warnings generated.
[100%] Linking CXX executable ethminer
[100%] Built target ethminer
Don't worry about the 'warning's.
5. Start mining
The executable file generated at ~/Desktop/ethminer/build/ethminer/. So go to that directory to run the miner.
$ cd ~/Desktop/ethminer/build/ethminer/
For dwarfpool
./ethminer -G -F http://eth-eu.dwarfpool.com/<YOUR_ETH_WALLET_ADDRES>
For ethermine pool
./ethminer --farm-recheck 200 -G -S eu1.ethermine.org:4444 -FS us1.ethermine.org:4444 -O <YOUR_ETH_WALLET_ADDRES>.<YOUR_RIG_NAME>
You should change <YOUR_ETH_WALLET_ADDRES> and <YOUR_RIG_NAME> to your own ones.
Nvidia users need to change -G to -U.
This is the result from my laptop (AMD 460).
...
m 02:06:09| Got work package: #8daa6843
cl 02:06:09|cl-1 New work: header #8daa6843… target 0000000225c17d04dad2965cc5a02a23e254c0c3f75d9178046aeb27ce1ca574
cl 02:06:09|cl-1 Switch time 81 ms / 180 us
m 02:06:09| Speed 5.97 Mh/s gpu/0 0.00 gpu/1 5.97 [A0+0:R0+0:F0] Time: 00:00
m 02:06:10| Speed 5.98 Mh/s gpu/0 0.00 gpu/1 5.98 [A0+0:R0+0:F0] Time: 00:00
m 02:06:12| Speed 5.88 Mh/s gpu/0 0.00 gpu/1 5.88 [A0+0:R0+0:F0] Time: 00:00
m 02:06:13| Speed 5.98 Mh/s gpu/0 0.00 gpu/1 5.98 [A0+0:R0+0:F0] Time: 00:00
m 02:06:15| Speed 5.88 Mh/s gpu/0 0.00 gpu/1 5.88 [A0+0:R0+0:F0] Time: 00:00
m 02:06:17| Speed 6.03 Mh/s gpu/0 0.00 gpu/1 6.03 [A0+0:R0+0:F0] Time: 00:00
m 02:06:19| Speed 5.91 Mh/s gpu/0 0.00 gpu/1 5.91 [A0+0:R0+0:F0] Time: 00:01
m 02:06:20| Speed 6.01 Mh/s gpu/0 0.00 gpu/1 6.01 [A0+0:R0+0:F0] Time: 00:01
m 02:06:21| Speed 5.93 Mh/s gpu/0 0.00 gpu/1 5.93 [A0+0:R0+0:F0] Time: 00:01
m 02:06:23| Speed 5.95 Mh/s gpu/0 0.00 gpu/1 5.95 [A0+0:R0+0:F0] Time: 00:01
m 02:06:24| Speed 5.94 Mh/s gpu/0 0.00 gpu/1 5.94 [A0+0:R0+0:F0] Time: 00:01
m 02:06:26| Speed 5.94 Mh/s gpu/0 0.00 gpu/1 5.94 [A0+0:R0+0:F0] Time: 00:01
m 02:06:27| Speed 5.95 Mh/s gpu/0 0.00 gpu/1 5.95 [A0+0:R0+0:F0] Time: 00:01
m 02:06:29| Speed 5.95 Mh/s gpu/0 0.00 gpu/1 5.95 [A0+0:R0+0:F0] Time: 00:01
m 02:06:30| Speed 5.94 Mh/s gpu/0 0.00 gpu/1 5.94 [A0+0:R0+0:F0] Time: 00:01
m 02:06:32| Speed 5.95 Mh/s gpu/0 0.00 gpu/1 5.95 [A0+0:R0+0:F0] Time: 00:01
m 02:06:33| Speed 5.95 Mh/s gpu/0 0.00 gpu/1 5.95 [A0+0:R0+0:F0] Time: 00:01
m 02:06:35| Speed 5.95 Mh/s gpu/0 0.00 gpu/1 5.95 [A0+0:R0+0:F0] Time: 00:01
It shows almost 6 MH/s. It's definitely better result than from my previous post (1.5 MH/s).
The good news is that you can boost this number a little bit. I'll write about it on my next post.
For advanced users
$ ./ethminer --help
will show you more detailed options that you can tweak.
For Nvidia users
I don't have Nvidia GPUs on my Mac, so I'm not sure the followings are needed, but try installing all of them if you have any troubles.
The latest NVIDIA CUDA driver
https://www.nvidia.com/object/mac-driver-archive.html
The "web" driver appropriate for your macOS version
El Capitan: 10.11.6.
http://www.nvidia.com/download/driverResults.aspx/114670/en-us
Sierra: 10.12.3
http://www.nvidia.com/download/driverResults.aspx/117892/en-us
Please let me know
If you tried this, share your result with your hardware specs.
I know the Mac isn't the good machine for just mining purpose, but I did this for my curiosity.