Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: ssvb on December 29, 2011, 05:47:19 AM



Title: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on December 29, 2011, 05:47:19 AM
During the Christmas holidays I spent some time trying to figure out if PlayStation 3 is any good for Scrypt proof of work (https://github.com/coblee/litecoin/wiki/Scrypt-proof-of-work) used by litecoin. As a result, LTC mining performance went up from ~1 khash/s to something like ~34 khash/s. My patches for jgarzik/ArtForz cpuminer are available at GitHub: https://github.com/ssvb/cpuminer

Everything should build fine in Linux using the standard "./autogen.sh && ./configure && make" steps (the availability of libspe2 library and spu-elf-gcc/embedspu tools should be detected automatically by configure). Setting CFLAGS to the optimal settings "-O3 -mcpu=cell -mtune=cell -maltivec -fstrict-aliasing" before compilation provides best performance. Note: this miner requires linux to run on PS3. If you don't have linux, you can't use it.

Also these optimizations should improve performance on many other PowerPC hardware by using Altivec instructions. If everything goes well, the PowerPC optimizations may be potentially merged with pooler's miner (https://bitcointalk.org/index.php?topic=55038.0) in the future.

If you find any bugs, please let me know. And sorry for a short announcement, I'll try to add more information later.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: michaelmclees on December 29, 2011, 10:34:38 PM
During the Christmas holidays I spent some time trying to figure out if PlayStation 3 is any good for Scrypt proof of work (https://github.com/coblee/litecoin/wiki/Scrypt-proof-of-work) used by litecoin. As a result, LTC mining performance went up from ~1 khash/s to something like ~34 khash/s. My patches for jgarzik/ArtForz cpuminer are available at GitHub: https://github.com/ssvb/cpuminer

Everything should build fine in Linux using the standard "./autogen.sh && ./configure && make" steps (the availability of libspe2 library and spu-elf-gcc/embedspu tools should be detected automatically by configure). Setting CFLAGS to the optimal settings "-O3 -mcpu=cell -mtune=cell -maltivec -fstrict-aliasing" before compilation provides best performance. Note: this miner requires linux to run on PS3. If you don't have linux, you can't use it.

Also these optimizations should improve performance on many other PowerPC hardware by using Altivec instructions. If everything goes well, the PowerPC optimizations may be potentially merged with pooler's miner (https://bitcointalk.org/index.php?topic=55038.0) in the future.

If you find any bugs, please let me know. And sorry for a short announcement, I'll try to add more information later.

PS3 mines at 34khps?  That's quite a deal.  If there's an easy way to install the miner onto the PS3, there may be millions of new users out there.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on December 29, 2011, 11:33:40 PM
PS3 mines at 34khps?  That's quite a deal.  If there's an easy way to install the miner onto the PS3, there may be millions of new users out there.
The Cell/BE optimized miner requires Linux installation running on PS3, which was initially marketed by Sony as OtherOS feature (http://en.wikipedia.org/wiki/OtherOS). This feature was discontinued in newer PS3 Slim models and also removed from older PS3 consoles by firmware update despite the original promise to keep it (http://www.osnews.com/story/23075/Sony_Does_180_Removes_Other_OS_Feature_from_PS3). The users were given a free choice how to cripple their PS3 functionality: forfeit OtherOS or lose the ability to play new games. I myself opted for the latter option. I guess the majority of normal users interested in games made a different choice and there are hardly millions of new users to do LTC mining on PS3 as a result.

Also another side of this story is that such controversial actions from Sony encouraged a lot of hackers to break PS3 protection and recover OtherOS and even enable OtherOS on PS3 Slim at some point by using modified firmware. That's a cat and mouse game between Sony and hackers, but I'm not really tracking the news from this front. After all, my PS3 still has OtherOS supported via an old version of the official firmware. Still on a technical side, the miner should also work fine with the OtherOS from unofficial modified firmware variants developed by hackers.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: mc_lovin on December 29, 2011, 11:36:31 PM
Wow I was discouraged by the 3 kh/s my i7 can do, if we can pump up some real numbers, I think Litecoin has a future!  I just bought nearly 2000 LTC's for 2 BTC's on BTC-E, we'll see if I look back at this post in a years' time and if that was a good decision.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on December 29, 2011, 11:54:59 PM
Wow I was discouraged by the 3 kh/s my i7 can do,
Nowadays i7 is also not so bad at LTC mining thanks to the SSE2 optimizations done by pooler (https://bitcointalk.org/index.php?topic=55038.0). BTW, I have bought some cheap power meter and added the data about my hardware to the Mining hardware comparison (https://github.com/coblee/litecoin/wiki/Mining-hardware-comparison) wiki page. This also includes my Intel Core i7 860 computer, which is able to do at least 25 khash/s. Still I would prefer to keep discussion focused on mining using PowerPC and PlaySatation3 hardware in this topic ;)

Quote
if we can pump up some real numbers, I think Litecoin has a future!  I just bought nearly 2000 LTC's for 2 BTC's on BTC-E, we'll see if I look back at this post in a years' time and if that was a good decision.
If everyone uses the best optimizations in miners, then you don't have any real advantage over the others. But it's good when the force is in balance :) This prevents the scenario when some bad guy keeps an optimized miner for himself and uses it together with some botnet for an extra advantage when attacking the network.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: michaelmclees on December 30, 2011, 01:28:02 AM
Do you think it would be possible to do a tutorial from start to finish for YouTube?


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ThiagoCMC on December 30, 2011, 04:44:34 AM
Linux on PS3?!

What about this:

http://www.ps3linux.net/

http://www.engadget.com/2011/05/06/otheros-brings-linux-back-to-the-ps3-taunts-sony/

http://www.ps3magic.com/

Best!
Thiago


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: mc_lovin on December 30, 2011, 04:50:37 AM
Intel Core i7 860 computer, which is able to do at least 25 khash/s.
Ahh see this is where I failed, and I'm glad I came to realize it before I wasted too much more time.  I had tried getting the miner to work outside of the litecoinpool browser miner and after a few failed attempts, I gave up.  I guess it was just a bit of wasted electricity mining with the browser.  I'm just going to buy LTC's, let you guys mine them.
Still I would prefer to keep discussion focused on mining using PowerPC and PlaySatation3 hardware in this topic ;)
Agreed, sorry about the lite-threadbomb.  Definitely going to be keeping an eye on this one, I'm excited to see high numbers with the Cell processor.  There's a lot of PS3 clusters out there, and although it might not be profitable to run them today, in the future you might be able to pick them up for cheap and put them to work.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on January 02, 2012, 03:06:04 PM
Hi!

As i read this today i started to try it out on my old iBook G4 running Debian.

I got only 0.02 kh/s with your version.
For poolers miner i got somewhere at 0.7

As i'm not familiar to what the cflags do could you please help me figure out what to do?


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on January 02, 2012, 04:34:11 PM
As i read this today i started to try it out on my old iBook G4 running Debian.
Thanks for posting your feedback, you are welcome here.

Quote
I got only 0.02 kh/s with your version.
For poolers miner i got somewhere at 0.7
This looks really strange. Even without the use of Altivec (SIMD instructions on PowerPC), the results should be maybe at most 20-30% slower than pooler's. But with the use of Altivec it should be several times faster.

Quote
As i'm not familiar to what the cflags do could you please help me figure out what to do?
You can try something like this:
Code:
$ git clone git://github.com/ssvb/cpuminer.git
$ cd cpuminer
$ export CFLAGS="-O3 -mcpu=G4 -maltivec -fstrict-aliasing"
$ ./autogen.sh && ./configure && make

The -mcpu and -maltivec options are needed to enable PowerPC specific optimizations for your processor. Otherwise it just runs a slow C implementation.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on January 02, 2012, 06:34:14 PM
Hm i did as you told me but got nearly the same result. Now i'm at 0.04kh/s

If it's too complicated/time-consuming for you to look into it i understand as i think nearly nobody has G4 hardware anymore (especially running Debian instead of OsX i think but i lost the Installation CD and it felt boring slow with 10.3  ;) ) but if you are interested i'll keep on testing  :)

Here is the Terminal output - maybe it helps.

Code:
user@iBookG4:~$ cd Downloads
user@iBookG4:~/Downloads$ ls
cgminer-2.0.6          cgminer-2.0.7          libspe2-2_2.2.80-95-1_powerpc.deb
cgminer-2.0.6.tar.bz2  cgminer-2.0.7.tar.bz2  pooler
user@iBookG4:~/Downloads$ git clone git://github.com/ssvb/cpuminer.git
Cloning into cpuminer...
remote: Counting objects: 741, done.
remote: Compressing objects: 100% (337/337), done.
remote: Total 741 (delta 475), reused 646 (delta 400)
Receiving objects: 100% (741/741), 199.86 KiB | 326 KiB/s, done.
Resolving deltas: 100% (475/475), done.
user@iBookG4:~/Downloads$ cd cpuminer
user@iBookG4:~/Downloads/cpuminer$ ls
AUTHORS       COPYING           miner.h            scrypt-cell-spu.h
autogen.sh    cpu-miner.c       mknsis.sh          scrypt-simd-helpers.h
ChangeLog     elist.h           NEWS               sha256-helpers.h
compat        example-cfg.json  README             util.c
compat.h      LICENSE           scrypt.c
configure.ac  Makefile.am       scrypt-cell-spu.c
user@iBookG4:~/Downloads/cpuminer$ export CFLAGS="-03 -mcpu=G4 -maltivec -fstrict-aliasing"
user@iBookG4:~/Downloads/cpuminer$ ./autogen.sh && ./configure && make
configure.ac:15: installing `./compile'
configure.ac:4: installing `./config.guess'
configure.ac:4: installing `./config.sub'
configure.ac:6: installing `./install-sh'
configure.ac:6: installing `./missing'
compat/jansson/Makefile.am: installing `./depcomp'
Makefile.am: installing `./INSTALL'
checking build system type... powerpc-unknown-linux-gnu
checking host system type... powerpc-unknown-linux-gnu
checking target system type... powerpc-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking whether gcc and cc understand -c and -o together... yes
checking for ranlib... ranlib
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for spe_context_create in -lspe2... no
checking for spu-elf-gcc... no
checking for spu-gcc... spu-gcc
checking for embedspu... embedspu
checking for json_loads in -ljansson... no
checking for pthread_create in -lpthread... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gawk... (cached) gawk
checking for curl-config... /usr/bin/curl-config
checking for the version of libcurl... 7.21.0
checking for libcurl >= version 7.10.1... yes
checking whether libcurl is usable... yes
checking for curl_free... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating compat/Makefile
config.status: creating compat/jansson/Makefile
config.status: creating cpuminer-config.h
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory `/home/user/Downloads/cpuminer'
Making all in compat
make[2]: Entering directory `/home/user/Downloads/cpuminer/compat'
Making all in jansson
make[3]: Entering directory `/home/user/Downloads/cpuminer/compat/jansson'
gcc -DHAVE_CONFIG_H -I. -I../..     -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT dump.o -MD -MP -MF .deps/dump.Tpo -c -o dump.o dump.c
gcc: unrecognized option '-03'
mv -f .deps/dump.Tpo .deps/dump.Po
gcc -DHAVE_CONFIG_H -I. -I../..     -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT hashtable.o -MD -MP -MF .deps/hashtable.Tpo -c -o hashtable.o hashtable.c
gcc: unrecognized option '-03'
mv -f .deps/hashtable.Tpo .deps/hashtable.Po
gcc -DHAVE_CONFIG_H -I. -I../..     -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT load.o -MD -MP -MF .deps/load.Tpo -c -o load.o load.c
gcc: unrecognized option '-03'
mv -f .deps/load.Tpo .deps/load.Po
gcc -DHAVE_CONFIG_H -I. -I../..     -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT strbuffer.o -MD -MP -MF .deps/strbuffer.Tpo -c -o strbuffer.o strbuffer.c
gcc: unrecognized option '-03'
mv -f .deps/strbuffer.Tpo .deps/strbuffer.Po
gcc -DHAVE_CONFIG_H -I. -I../..     -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT utf.o -MD -MP -MF .deps/utf.Tpo -c -o utf.o utf.c
gcc: unrecognized option '-03'
mv -f .deps/utf.Tpo .deps/utf.Po
gcc -DHAVE_CONFIG_H -I. -I../..     -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT value.o -MD -MP -MF .deps/value.Tpo -c -o value.o value.c
gcc: unrecognized option '-03'
mv -f .deps/value.Tpo .deps/value.Po
rm -f libjansson.a
ar cru libjansson.a dump.o hashtable.o load.o strbuffer.o utf.o value.o
ranlib libjansson.a
make[3]: Leaving directory `/home/user/Downloads/cpuminer/compat/jansson'
make[3]: Entering directory `/home/user/Downloads/cpuminer/compat'
make[3]: Für das Ziel »all-am« ist nichts zu tun.
make[3]: Leaving directory `/home/user/Downloads/cpuminer/compat'
make[2]: Leaving directory `/home/user/Downloads/cpuminer/compat'
make[2]: Entering directory `/home/user/Downloads/cpuminer'
gcc -DHAVE_CONFIG_H -I. -pthread -I./compat/jansson    -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT minerd-cpu-miner.o -MD -MP -MF .deps/minerd-cpu-miner.Tpo -c -o minerd-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
gcc: unrecognized option '-03'
mv -f .deps/minerd-cpu-miner.Tpo .deps/minerd-cpu-miner.Po
gcc -DHAVE_CONFIG_H -I. -pthread -I./compat/jansson    -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT minerd-util.o -MD -MP -MF .deps/minerd-util.Tpo -c -o minerd-util.o `test -f 'util.c' || echo './'`util.c
gcc: unrecognized option '-03'
mv -f .deps/minerd-util.Tpo .deps/minerd-util.Po
gcc -DHAVE_CONFIG_H -I. -pthread -I./compat/jansson    -03 -mcpu=G4 -maltivec -fstrict-aliasing -MT minerd-scrypt.o -MD -MP -MF .deps/minerd-scrypt.Tpo -c -o minerd-scrypt.o `test -f 'scrypt.c' || echo './'`scrypt.c
gcc: unrecognized option '-03'
mv -f .deps/minerd-scrypt.Tpo .deps/minerd-scrypt.Po
gcc  -03 -mcpu=G4 -maltivec -fstrict-aliasing -pthread  -o minerd minerd-cpu-miner.o minerd-util.o minerd-scrypt.o -lcurl compat/jansson/libjansson.a -lpthread 
gcc: unrecognized option '-03'
make[2]: Leaving directory `/home/user/Downloads/cpuminer'
make[1]: Leaving directory `/home/user/Downloads/cpuminer'
user@iBookG4:~/Downloads/cpuminer$ ls
aclocal.m4      config.sub            install-sh          mknsis.sh
AUTHORS         configure             LICENSE             NEWS
autogen.sh      configure.ac          Makefile            README
autom4te.cache  COPYING               Makefile.am         scrypt.c
ChangeLog       cpu-miner.c           Makefile.in         scrypt-cell-spu.c
compat          cpuminer-config.h     minerd              scrypt-cell-spu.h
compat.h        cpuminer-config.h.in  minerd-cpu-miner.o  scrypt-simd-helpers.h
compile         depcomp               minerd-scrypt.o     sha256-helpers.h
config.guess    elist.h               minerd-util.o       stamp-h1
config.log      example-cfg.json      miner.h             util.c
config.status   INSTALL               missing
user@iBookG4:~/Downloads/cpuminer$ ./minerd --userpass meti.2:2 --url http://litecoinpool.org:9332 --algo scrypt
[2012-01-02 19:17:27] Binding thread 0 to cpu 0
[2012-01-02 19:17:27] Long-polling activated for http://litecoinpool.org:9332/LP
[2012-01-02 19:17:28] 1 miner threads started, using SHA256 'scrypt' algorithm.
[2012-01-02 19:17:31] LONGPOLL detected new block
[2012-01-02 19:17:31] thread 0: 144 hashes, 0.04 khash/sec
[2012-01-02 19:18:00] LONGPOLL detected new block
[2012-01-02 19:18:00] thread 0: 1306 hashes, 0.04 khash/sec
[2012-01-02 19:18:11] LONGPOLL detected new block
[2012-01-02 19:18:12] thread 0: 488 hashes, 0.04 khash/sec
[2012-01-02 19:19:12] thread 0: 2651 hashes, 0.04 khash/sec
[2012-01-02 19:20:12] thread 0: 2661 hashes, 0.04 khash/sec
[2012-01-02 19:21:16] thread 0: 2659 hashes, 0.04 khash/sec



Thanks for the quick reply btw!


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on January 02, 2012, 07:14:11 PM
Thanks for providing the log. The "gcc: unrecognized option '-03'" error message explains everything. We want -O3 option, written as "minus big-o three" and not "minus zero three" (which means 'O'ptimization level '3'). And because the compiler does not recognize the invalid -03 option, all the optimizations get disabled completely and the performance is totally screwed up. Copy/paste is safer than typing ;)


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on January 02, 2012, 07:21:55 PM
Omg i just saw it myself... well i'm not surfing the web on the ibook therefore no copy&paste  ;)

thanks let's see what it will do!

Now it's about 1.60!!


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on January 02, 2012, 07:47:43 PM
Now it's about 1.60!!
Thanks. By the way, what is the MHz rating of this iBook? Would it be a good idea to add your benchmark data to the mining-hardware-comparison (https://github.com/coblee/litecoin/wiki/Mining-hardware-comparison) page?


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on January 02, 2012, 08:14:38 PM
Can you do that for me as i don't see an option there to add data.

cat /proc/cpuinfo gives me

cpu: 7447A, altivec supported
clock: 1066,666 MHz
revision 1.1
bogomips: 73.72
model: PowerBook6,5
L2 cache: 512K unified

I can't measure the power consumption.

Cores: 1

Command line arguments: none

OS: Debian Squeeze ppc

Model: iBook G4 1Ghz

kHash/s: 1,66

miner: Cell/BE optimized cpuminer

Edit: my main system isn't in the list too...
Its a MacBook Pro 6,2 (Mid 2010)
2,53 GHz Intel Core i5 (I5-540M)
2 Cores (4 with HT)
OS: Mac OsX 10.7.2
kHash/s: 11,7
miner: Poolers optimized miner


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: caston on January 03, 2012, 06:34:14 AM
What kind of hash rate would we get on the xbox 360?


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on January 03, 2012, 07:21:48 AM
That was my 2nd thought too ;D
I have One but it isn't the type that can run Linux. Maybe i can find a cheap One at eBay  ;)
I think it would be quite good as it has 3 cores at 3,2ghz.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ZedZedNova on January 03, 2012, 07:15:31 PM
Hey Folks,

I have access to a pair of PowerMac G5 machines. I don't know the specific model(s) yet, but I found out that Ubuntu 11.10 will run on them with a little effort.  :)  I'll be trying to install a persistent USB build for them and get them running.

Once I have done that, and installed a few libraries and tools, I'll download and try to build pooler's most up-to-date/optimized miner. If that fails, I'll download an run the one mentioned here.

Cheers,

- Zed


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on January 04, 2012, 09:21:22 AM
Hey Folks,

I have access to a pair of PowerMac G5 machines. I don't know the specific model(s) yet, but I found out that Ubuntu 11.10 will run on them with a little effort.  :)  I'll be trying to install a persistent USB build for them and get them running.

Once I have done that, and installed a few libraries and tools, I'll download and try to build pooler's most up-to-date/optimized miner. If that fails, I'll download an run the one mentioned here.

Cheers,

- Zed


I think pooler's optimized miner is optimized especially for Intel processors. You'll probably have more kh/s with the one from ssvb.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ZedZedNova on January 07, 2012, 05:50:02 AM
I think pooler's optimized miner is optimized especially for Intel processors. You'll probably have more kh/s with the one from ssvb.

More specifically it is x86 instruction set optimized assembly code something that will never apply to a PPC machine. 

You are both right, re: pooler's optimizations. I was thinking just about the hash rate increases, and not that the optimizations are Intel and now AMD specific. I still have the G5 machines, but have had no time to do anything since I posted that message on 3-Jan. Hopefully I can burn a few cycles this weekend and get the machines running, although the fans on those suckers are fscking loud. Even the two IBM X3650M2s I had running over the holidays weren't as loud as just one of the PowerMac G5s ...

- Zed


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ZedZedNova on January 08, 2012, 06:01:53 AM
After messing around with Ubuntu 11.10 that didn't seem to like the nVidia graphics card, even when not using KMS (booting with "nouveau.modestate=0"), I finally just installed a CLI version, booted with "nouveau.modestate=0" and all is well. I installed the "missing" libraries and gcc, and built cpuminer.

I'm seeing ~3.10 - 3.25 kH/s now. This is about equivalent to one thread on my 2.3 GHz Core i5 powered Mac Mini.

Edit: Second machine installed and churning out the same as the first.

- Zed


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on January 08, 2012, 07:49:18 PM
What kind of hash rate would we get on the xbox 360?
Assuming that it's possible to get linux running on it, one may expect something like 3 * 3.6 khash/s = ~10.8 khash/s hashing power from xbox 360. At least I'm getting ~3.6 khash/s from two threads of one Cell PPE core. And the 3 cores in Xenon processor are supposedly slightly modified versions of the PPE in the Cell processor according to wikipedia (http://en.wikipedia.org/wiki/Xenon_%28processor%29).

The current code is using gcc vector extensions (http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html) for quick prototyping. This makes it possible to reuse significant parts of the same code on Cell PPE (PowerPC Altivec), Cell SPE (has it's own SIMD architecture) and even x86 (SSE2) architectures. But relying on the compiler to do registers allocation and instructions scheduling sacrifices some of the performance. And this can be easily seen if benchmarking against pooler's hand written SSE2 code (https://bitcointalk.org/index.php?topic=55038.0) on x86 :)

It should be possible to improve Altivec performance by adding hand written assembly optimizations. But realistically, from the whole PowerPC camp, only PlayStation3 has chances to be really competitive in terms of absolute performance per machine or performance per watt.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on February 16, 2012, 11:34:06 PM
The first feedback and actually a patch for the Cell miner sent to me as a private message: https://github.com/shakt1/cpuminer :)
But one problem is that shakti (https://bitcointalk.org/index.php?action=profile;u=51980) is a newly registered user and has no permissions to post anything here yet.

edit: here is his thread in the Newbies section: https://bitcointalk.org/index.php?topic=64222.msg753270#msg753270
If there are more people "on probation" (maybe newcomers from the playstation3 linux community), then it could be a good place for them to post some comments.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: shakti on February 17, 2012, 01:51:06 PM
The first feedback and actually a patch for the Cell miner sent to me as a private message: https://github.com/shakt1/cpuminer :)
But one problem is that shakti (https://bitcointalk.org/index.php?action=profile;u=51980) is a newly registered user and has no permissions to post anything here yet.

edit: here is his thread in the Newbies section: https://bitcointalk.org/index.php?topic=64222.msg753270#msg753270
If there are more people "on probation" (maybe newcomers from the playstation3 linux community), then it could be a good place for them to post some comments.

Finally i can post here :) Nice work ssvb to make miner for PS3, i hope we can tweak it together to make it even better :)


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on February 20, 2012, 11:07:35 PM
Finally i can post here :) Nice work ssvb to make miner for PS3, i hope we can tweak it together to make it even better :)
Sure, more improvements for PS3 miner are definitely possible. I have pushed some of my old unfinished code which implements parts of scrypt in SPU assembly (~5.4 khash/s -> 5.9 khash/s improvement per SPE core) to github. This is only an optimization for the first big loop, handling the second big loop in a similar way is expected to provide about the same speedup. This is just better instructions scheduling and keeping all data in registers avoiding unnecessary spills. Your improvements are focusing on a different aspect - better data layout for less scattered writes and more unrolling to completely eliminate any stray stalls waiting for DMA completion (up to ~6.1 khash/s per SPE core). Combining both optimizations should provide quite good results, maybe even changing to handle 10 hashes at once (5+5) would be beneficial for the second loop. The theoretical peak performance per SPU core, based on counting 128-bit vector ADD/ROL/XOR operations (https://bitcointalk.org/index.php?topic=63365.msg742100#msg742100) is ~7.35 khash/s (an optimistic estimate, not even taking negligible SHA256 part and other overhead into account). Which means that we are already at >80% of the theoretical peak performance.

Just GPU miners are a bit more hot topic at the moment. During the last weekend I was busy installing a new graphics card and then doing some OpenCL coding with it. But I'm going to revisit Cell/BE code after I get my GPU miner up and running ;)


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: tacotime on February 20, 2012, 11:37:58 PM
Finally i can post here :) Nice work ssvb to make miner for PS3, i hope we can tweak it together to make it even better :)
Just GPU miners are a bit more hot topic at the moment. During the last weekend I was busy installing a new graphics card and then doing some OpenCL coding with it. But I'm going to revisit Cell/BE code after I get my GPU miner up and running ;)

I look forward to the performance numbers!  The previously much talked about miner (if it even exists) showed only marginal per-watt performance over CPUs.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on February 21, 2012, 12:10:57 AM
I look forward to the performance numbers!  The previously much talked about miner (if it even exists) showed only marginal per-watt performance over CPUs.
There are better forum (https://bitcointalk.org/index.php?topic=63365.0) threads (https://bitcointalk.org/index.php?topic=64239.0) for speculating about the alleged performance numbers. The GPU miner is going to be released with full sources included when/if I get something ready. No other comments for now.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: Bananahands on September 06, 2013, 08:55:08 AM
Sorry to revive such an old post but where can I find the Cell/PPC optimized miner?  Will it run on OS X 10.5.8?

Thanks,
Mike


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: meti on September 07, 2013, 07:41:38 AM
It's still there... haven't you read the first post?
https://github.com/ssvb/cpuminer

Code:
$ git clone git://github.com/ssvb/cpuminer.git
$ cd cpuminer
$ export CFLAGS="-O3 -mcpu=G4 -maltivec -fstrict-aliasing"
$ ./autogen.sh && ./configure && make


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: Bananahands on September 12, 2013, 09:13:48 AM
Thanks, I'm new to compiling so I overlooked that the first time.

Anyway, I've tried compiling it on both Mac OS X 10.5.8 and Debian Linux (whatever one is for my PPC G5) and I get stuck with

./configure: line 5010: syntax error near unexpected token 'LIBCURL_CHECK_CONFIG'
./configure: line 5010: 'LIBCURL_CHECK_CONFIG(, 7.10.1, ,'

Any idea how to fix this?

Mike


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: ssvb on September 12, 2013, 09:44:38 AM
In debian you can try "apt-get install build-essential libtool libltdl-dev automake" (I hope I did not forget something in this list). The autogen.sh script needs autotools (http://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) installed to generate the configure script. This stuff is often already installed on the computers used for software development, but may be indeed missing on some systems.

edit: hmm, actually based on the error message, the autotools might be already fine. Try "apt-get install libcurl-dev" to see if this resolves the curl related issues.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: Bananahands on September 12, 2013, 06:40:01 PM
Thank you for the reply, I tried both of your suggestions and they worked but I am still getting the same error....

Edit:I guess I was in a hurry, it was asking me to select which libcurl I wanted to install.  Now I just need to figure out how to use it....

Mike


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: Bananahands on September 12, 2013, 07:55:19 PM
It works!  Thank you meti, thank you ssvb.  One final question though.  I don't see any improvement over Pooler's CPUMiner, I'm still getting ~1.45 khash/sec on each processor.  I was thinking I would get a lot more than that seeing how they are 2.0GHz G5 processors.  Does the fact that I did this over many days with the computer being either off or booted in OS X make any difference?  Would deleting everything in the cpuminer folder and starting from scratch do anything?

Mike

Edit: I fixed it.  I guess i first tried using -mcpuG5 because they are G5s but -mcpuG4 is giving me ~3.80 khash/sec!


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: tuaris on January 26, 2014, 01:25:20 PM
Does anyone know if these optimization were ever backported into pooler's CPU miner?
I have a few G5's sitting around doing nothing.


Title: Re: LTC miner optimizations for PowerPC (Power Mac) and Cell/BE (PlayStation 3)
Post by: Eudardoq on December 30, 2017, 01:33:57 PM
Hello .. please help to optimize ps3 ... I already managed to mine ... and mine to 1.46 Khas / s but by there I read that they managed to optimize it to an average of 30 Khas / s someone could help me please ..