Bitcoin Blog Articles

Bitcoin Mining on a PowerMac G5 (PowerPC/PPC)

(04/26/2013) Mark A. Cenicola

PowerMac G5 LargeI was curious to know the performance of Bitcoin mining on a PowerMac G5.  Let me say that if you are mining Bitcoin using a CPU, you're probably doing it wrong, but I like to experiment and had an extra G5 sitting around to test.  Mining with GPUs is much faster, costs less to mine per watt and is therefore, more profitable.  There are now dedicated Bitcoin mining machines that blow away GPU mining so this too will become a thing of the past.

After searching long and hard, I couldn't actually find any information on mining performance a a G5 or a comprehensive tutorial on how to set it up for maximum performance.  This Bitcoin mining hardware comparison list shows mining performance on G3 and G4 processors, but not a G5 processor.

INTERESTED in REAL MINING? Check out my post - Mineral Rich - Gold/Silver/Copper Ore Samples from Nevada Mining Claims Available for Sale or if interested in Buying & Selling Bitcoin and Litecoin, signup with Coinbase.

I'll explain how I got it working in a minute, but first on to the performance numbers.

Using CGMiner version 2.11.4 on a PowerMac G5 dual 1.8Ghz computer running Mac OS X 10.5.8 I got performance of only around 800 Khash/s combined between both processors.  Even for CPU mining this is terrible.  I thought there had to be another way to increase performance since one of the features of the PowerPC G4 and G5 architecture was Altivec which is additional instructions built-in to the CPU to provide enhanced graphics performance.  

The problem was that initially I could only get CGMiner compiled for CPU mining using C and Cryptopp as the hashing algorithms.  I figured that if I could enable Altivec, I could get better performance.  

After a lot of work I figured out how to get Altivec compiled into CGMiner as a supported algorithm and it had a big effect on performance.  With Altivec, the PowerMac G5 was showing performance of close to 2 Mhash/s or more than double the performance under the other algorithms.  Again, not great, but on par or slightly better than what I get with an iMac core 2 Duo Intel processor.

Here's what I did to get it to work.

Prerequisites:

* compiler that works on Mac OS X 10.5.8.  I signed up as an Apple developer and downloaded an older version of Xcode developer tools that works with Mac OS X 10.5.8.  Xcode includes a compiler and this is required to compile the following software

* yasm - download latest version here (this is required to get Altivec working)

* pkg-config - download latest version here (this is required to get CGMiner to recognize installed packages when compiling) configure it with --with-internal-glib

* libcurl - download latest version here (this is required by CGMiner)

* CGMiner - download latest version here (this is required for actual Bitcoin Mining) By default CGMiner doesn't compile with CPU mining support so you have to configure with the flag --enable-cpumining . Version 3.0 and above of CGMiner source code no longer has CPU mining code so you have to use an older version or you can use BFGMiner as well with same settings.

I'm not going to go into all of the configure, make and make install commands, since I don't recommend wasting your time.  However, if you are so inclined to get CPU mining working on your PowerMac G5 read through the comments to see if any of the posts can help. I no longer have access to a G5 so personally can't help much.

Jacob November 06, 2013 ~ 1:38 PM
Trying BFGMiner
I will try BFGMiner tonight and post anything if I can make it work...
Mark Cenicola November 06, 2013 ~ 8:44 AM
Version of CGMiner
What version of CGMiner are you using? Only older versions support CPU Mining and the flag --enable-cpumining must be set. If that still doesn't work, you may want to try BFGMiner. It requires a special C library that needs to be manually installed. I personally prefer to have everything in /usr/ as opposed to /usr/local or /opt/local when installing the prerequisites. Seems to make the configure/make/make install go easier. I no longer have access to a G5 machine anymore so not sure what other recommendations I can provide.
Jacob November 06, 2013 ~ 8:44 AM
Cannot build
I tried building cgminer 2.11.4 and 2.9.7, changing some CFLAGS and I have the same problem -_-
Jacob November 06, 2013 ~ 8:33 AM
Yasm is installed
Yasm is installed and the prefix in configure is OK. CGMiner is able to find yams : checking for yasm... /opt/local/bin/yasm checking if yasm version is greater than 1.0.1... yes I have a PowerMac G5 with 10.5.8
Mark Cenicola November 03, 2013 ~ 4:46 PM
Make sure yasm is installed
It sounds like you didn't install yasm or CGMiner can't find that you installed yasm. If you installed yasm in the default path, try setting the path at configure time for CGMiner to prefix=/usr/local/ If you look at the configure log, it should show you what paths it's looking in for various compile time options.
Jacob November 03, 2013 ~ 11:49 AM
Error on make
I can't seem to build it, when I do make install, it gives me this error: CC cgminer-sha256_altivec_4way.o sha256_altivec_4way.c: In function 'DoubleBlockSHA256': sha256_altivec_4way.c:140:5: error: can't convert between vector values of different size sha256_altivec_4way.c:142:5: error: can't convert between vector values of different size any help?
Mark Cenicola September 15, 2013 ~ 12:56 PM
Re: BFGminer on PPC
Actually, I'm not familiar with Libudev-dev. It's possible that it was installed by another package before I tried BFGminer. I no longer have access to a G5 to test either. Have you tried CGMiner? Not sure if that requires that dependency.
Anonymous September 15, 2013 ~ 9:47 AM
Re: Re: BFGminer on PPC
I'm actually having trouble with the libudev-dev dependency (v.18+)... Can't find a PPC version that wants to install!
Mark A. Cenicola September 11, 2013 ~ 8:15 AM
It will be fixed on 9/13/13
I apologize, but there was a database error with the site and it was causing comments not to display. If you're reading this, it's obviously fixed.
Anonymous September 10, 2013 ~ 9:54 AM
Nobody can read the comments or answers on this blog!
See title!
Mark Cenicola September 08, 2013 ~ 4:49 PM
Re: BFGminer on PPC
Getting BFGMiner working on a PPC is a little tricky since you need to install a particular library (uthash-dev). Installing the library requires placing the library files in the right place. Place uthash.h in the /usr/include folder.
Anonymous September 08, 2013 ~ 3:00 PM
BFGminer on PPC
Have you ever been successful in using BFGminer on a PPC mac? Having trouble compiling a working version.
Mark Cenicola April 30, 2013 ~ 10:27 PM
CGMiner Command to Select Altivec at Runtime
Oh, one more thing. When you run cgminer, you'll need to run it with the flag of "-a altivec" or "-a auto" which will benchmark each algorithm and pick the fastest. On a G5, it will be altivec, so best to pick it specifically as sometimes the initial altivec benchmark in automatic mode can be lower than the other algorithms it tries.

Lastly, CPU mining has been disabled in version 3.0 and above of CGMiner so you'll need to compile from the 2.X source tree.
Mark Cenicola April 30, 2013 ~ 6:43 PM
--enable-cpumining
For cgminer, I did "./configure --enable-cpumining" in the cgminer extracted source directory. If you've installed yasm prior to configuring and compiling cgminer, it will automatically build in the altivec algorithm.
Jacob April 30, 2013 ~ 6:24 PM
configure command
Thanks for the tip! I'd like to know the configure command you used for cgminer? Thanks!!

One Sheet

Mark Cenicola strips away the hype and gives his take on technology and its use in establishing a better business online.

Hard hitting presentations that really get to the core of today's technologically advanced business economy, Mark demonstrates effective strategies for integrating the Internet into a company's operations and giving their website an expanded role in contributing to the success of their business.