pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.8k stars 1.22k forks source link

Solaris/SPARC support #140

Open brainst0rmb opened 7 years ago

brainst0rmb commented 7 years ago

Hello, I managed to compile cpuminer on a Solaris/SPARC server but I cannot understand if scrypt-n is supported.

If I launch this:

./minerd -a scrypt:1048576 -o stratum+tcp://vrm.poolium.win:3333 -x http://proxyinfos -u myuser.worker -p pass

I get no hash at all:

[2017-09-11 15:37:07] Starting Stratum on stratum+tcp://vrm.poolium.win:3333
[2017-09-11 15:37:07] Binding thread 12 to cpu 12
--cutted logs--
[2017-09-11 15:37:07] 64 miner threads started, using 'scrypt' algorithm.
[2017-09-11 15:37:07] Binding thread 63 to cpu 63
[2017-09-11 15:38:00] thread 12: 4 hashes, 0.00 khash/s
[2017-09-11 15:38:00] thread 1: 4 hashes, 0.00 khash/s
[2017-09-11 15:38:00] thread 2: 4 hashes, 0.00 khash/s
[2017-09-11 15:38:00] thread 4: 4 hashes, 0.00 khash/s
[2017-09-11 15:38:03] thread 56: 4 hashes, 0.00 khash/s
--cutted logs--

Thanks!

pooler commented 7 years ago

Judging from your log it seems to be working fine. It's just very slow, but I would expect that from an algorithm as heavy as scrypt:1048576.

brainst0rmb commented 7 years ago

Could be useful a -D run? Thanks.

pooler commented 7 years ago

The simplest way to know if it's working is to wait and see if shares get accepted or rejected. Whether you are likely to find a share anytime soon depends on the difficulty set by the server, which you can find out about by running in debug mode.

brainst0rmb commented 7 years ago

Ok thanks, I will run it and see if I find some shares and report here.

ghost commented 7 years ago

Hi there!

I've compiled cpuminer on my new sparc T1 server with 256 CPU but mining performances are terrible!! The hashrate is less then on my laptop :)

I think it could be nice if someone compile sha256 and scrypt for a native cpu support. I found this link for sha256 https://github.com/pinkjersey/sha256lib but nothing on scrypt.

Could someone take a look?

Cheers, Marco

brucestir commented 6 years ago

Hi

so I thought I would have a go at compiling this pooler-cpuminer-2.5.0 on my Sun/Oracle T4-2 after seeing these posts.

However, got the folling errors...

can anyone advise please ??

root@BitCoin:/var/tmp/cpuminer-2.5.0# uname -a SunOS BitCoin 5.11 11.3 sun4v sparc sun4v

root@BitCoin:/var/tmp/cpuminer-2.5.0# ./configure checking build system type... sparc-sun-solaris2.11 checking host system type... sparc-sun-solaris2.11 checking target system type... sparc-sun-solaris2.11 checking for a BSD-compatible install... /usr/bin/ginstall -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/gmkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU 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 whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for gcc option to accept ISO C99... -std=gnu99 checking how to run the C preprocessor... gcc -std=gnu99 -E checking for grep that handles long lines and -e... /usr/bin/ggrep checking for egrep... /usr/bin/ggrep -E checking whether gcc -std=gnu99 needs -traditional... no checking dependency style of gcc -std=gnu99... gcc3 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 sys/endian.h usability... no checking sys/endian.h presence... no checking for sys/endian.h... no checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for sys/sysctl.h... no checking whether be32dec is declared... no checking whether le32dec is declared... no checking whether be32enc is declared... no checking whether le32enc is declared... no checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for getopt_long... yes checking for json_loads in -ljansson... yes checking for pthread_create in -lpthread... yes checking for gawk... (cached) gawk checking for curl-config... /usr/bin/curl-config checking for the version of libcurl... 7.40.0 checking for libcurl >= version 7.15.2... yes checking whether libcurl is usable... yes checking for curl_free... yes checking that generated files are newer than configure... done 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: cpuminer-config.h is unchanged config.status: executing depfiles commands

root@BitCoin:/var/tmp/cpuminer-2.5.0# make make all-recursive Making all in compat gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -fno-strict-aliasing -g -O2 -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 cpu-miner.c:36:21: fatal error: jansson.h: No such file or directory

include

                 ^

compilation terminated. Error code 1 make: Fatal error: Command failed for target `minerd-cpu-miner.o' Current working directory /var/tmp/cpuminer-2.5.0 Error code 1 The following command caused the error: fail=; \ if (target_option=k; case ${target_option-} in ?) ;; ) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if { if test -z '1'; then false; elif test -n ''; then true; elif test -n '' && test -n ''; then true; else false; fi; }; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in \[\ \ ]) bs=\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs ]//g";; esac; fi; skip_next=no; strip_trailopt () { flg=printf '%s\n' "$flg" | sed "s/$1.$//"`; }; for flg in $sane_makeflags; do test $skip_next = yes && { skip_next=no; continue; }; case $flg in =|--) continue;; -I) strip_trailopt 'I'; skip_next=yes;; -I?) strip_trailopt 'I';; -O) strip_trailopt 'O'; skip_next=yes;; -O?) strip_trailopt 'O';; -l) strip_trailopt 'l'; skip_next=yes;; -l?) strip_trailopt 'l';; -[dEDm]) skip_next=yes;; -[JT]) skip_next=yes;; esac; case $flg in $target_option) has_opt=yes; break;; esac; done; test $has_opt = yes); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=echo all-recursive | sed s/-recursive//; \ case "all-recursive" in \ distclean- | maintainer-clean-) list='compat' ;; \ ) list='compat' ;; \ esac; \ for subdir in $list; do \ echo "Making $target in $subdir"; \ if test "$subdir" = "."; then \ dot_seen=yes; \ local_target="$target-am"; \ else \ local_target="$target"; \ fi; \ (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \ || eval $failcom; \ done; \ if test "$dot_seen" = "no"; then \ make "$target-am" || exit 1; \ fi; test -z "$fail" make: Fatal error: Command failed for target all-recursive' Current working directory /var/tmp/cpuminer-2.5.0 *** Error code 1 make: Fatal error: Command failed for targetall'

pooler commented 6 years ago

checking for json_loads in -ljansson... yes [...] cpu-miner.c:36:21: fatal error: jansson.h: No such file or directory

Is Jansson properly installed on your system? It would appear that the library is there but the header file is not.

brucestir commented 6 years ago

Thanks for your response pooler and its funny you mention that, as I was thinking jansson could be the problem somewhere !!

The system is a fresh install as follows...

s11.3 install pkg update reboot pkg install developer/gcc-4/gcc-c-48 pkg install library/jansson

However, this was the output when installing the jansson package...

root@BitCoin:~# pkg search jansson INDEX ACTION VALUE PACKAGE com.oracle.info.description set the Jansson C library pkg:/library/jansson@2.7-0.175.3.0.0.30.0 pkg.description set Jansson is a C library for encoding, decoding and manipulating JSON data. It features a simpl e and intuitive API and data model, comprehensive documentation, full Unicode support (UTF-8), an extensive test suite and no de pendencies on other libraries. pkg:/library/jansson@2.7-0.175.3.0.0.30.0 pkg.summary set Jansson - C library for working with JSON data pkg:/library/jansson@2.7-0.175.3.0.0.30.0 com.oracle.info.name set jansson pkg:/library/jansson@2.7-0.175.3.0.0.30.0 pkg.fmri set solaris/library/jansson pkg:/library/jansson@2.7-0.175.3.0.0.30.0

root@BitCoin:~# pkg install library/jansson No updates necessary for this image.

So is there something else required ??

pooler commented 6 years ago

@brucestir, chances are gcc is not looking for the header file in the right place. If you can locate the file, try telling gcc where to find it with the -I option. Alternatively, if you don't really need jansson to be installed system-wide, you can uninstall the library, so that cpuminer will try to use its in-tree version.

brucestir commented 6 years ago

So here is what I can find...

root@BitCoin:/# find / -name jansson.h -print /usr/include/jansson/jansson.h /opt/csw/include/jansson.h /var/tmp/jansson-2.10/src/jansson.h /var/tmp/cpuminer-2.5.0/compat/jansson/jansson.h

Can you give me the full gcc command you're suggesting ??

pooler commented 6 years ago

@brucestir, maybe try this:

$ CPPFLAGS='-I/usr/include/jansson' ./configure
$ make
brucestir commented 6 years ago

hey pooler, thanks, i'm guessing the output below is all good :-)

root@BitCoin:/var/tmp/cpuminer-2.5.0# CPPFLAGS=' -I/usr/include/jansson' ./configure checking build system type... sparc-sun-solaris2.11 checking host system type... sparc-sun-solaris2.11 checking target system type... sparc-sun-solaris2.11 checking for a BSD-compatible install... /usr/bin/ginstall -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/gmkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU 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 whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for gcc option to accept ISO C99... -std=gnu99 checking how to run the C preprocessor... gcc -std=gnu99 -E checking for grep that handles long lines and -e... /usr/bin/ggrep checking for egrep... /usr/bin/ggrep -E checking whether gcc -std=gnu99 needs -traditional... no checking dependency style of gcc -std=gnu99... gcc3 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 sys/endian.h usability... no checking sys/endian.h presence... no checking for sys/endian.h... no checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for sys/sysctl.h... no checking whether be32dec is declared... no checking whether le32dec is declared... no checking whether be32enc is declared... no checking whether le32enc is declared... no checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for getopt_long... yes checking for json_loads in -ljansson... yes checking for pthread_create in -lpthread... yes checking for gawk... (cached) gawk checking for curl-config... /usr/bin/curl-config checking for the version of libcurl... 7.40.0 checking for libcurl >= version 7.15.2... yes checking whether libcurl is usable... yes checking for curl_free... yes checking that generated files are newer than configure... done 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 root@BitCoin:/var/tmp/cpuminer-2.5.0# make make all-recursive Making all in compat gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -I/usr/include/jansson -fno-strict-aliasing -g -O2 -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 mv -f .deps/minerd-cpu-miner.Tpo .deps/minerd-cpu-miner.Po gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -I/usr/include/jansson -fno-strict-aliasing -g -O2 -MT minerd-util.o -MD -MP -MF .deps/minerd-util.Tpo -c -o minerd-util.o test -f 'util.c' || echo './'util.c mv -f .deps/minerd-util.Tpo .deps/minerd-util.Po gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -I/usr/include/jansson -fno-strict-aliasing -g -O2 -MT minerd-sha2.o -MD -MP -MF .deps/minerd-sha2.Tpo -c -o minerd-sha2.o test -f 'sha2.c' || echo './'sha2.c mv -f .deps/minerd-sha2.Tpo .deps/minerd-sha2.Po gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -I/usr/include/jansson -fno-strict-aliasing -g -O2 -MT minerd-scrypt.o -MD -MP -MF .deps/minerd-scrypt.Tpo -c -o minerd-scrypt.o test -f 'scrypt.c' || echo './'scrypt.c mv -f .deps/minerd-scrypt.Tpo .deps/minerd-scrypt.Po gcc -std=gnu99 -fno-strict-aliasing -g -O2 -pthread -o minerd minerd-cpu-miner.o minerd-util.o minerd-sha2.o minerd-scrypt.o -lcurl -lidn -lssl -lcrypto -lssl -lcrypto -lgss -llber-2.4 -lldap_r-2.4 -lz -lsocket -lnsl -ljansson -lpthread

root@BitCoin:/var/tmp/cpuminer-2.5.0# make install Making install in compat /usr/bin/gmkdir -p '/usr/local/bin' /usr/bin/ginstall -c minerd '/usr/local/bin' /usr/bin/gmkdir -p '/usr/local/share/man/man1' /usr/bin/ginstall -c -m 644 minerd.1 '/usr/local/share/man/man1' root@BitCoin:/var/tmp/cpuminer-2.5.0#

stargeizer commented 6 years ago

How to run the script?

On Nov 9, 2017 7:06 PM, "Marco Fortina" notifications@github.com wrote:

Hi there!

I've compiled cpuminer on my new sparc T1 server with 256 CPU but mining performances are terrible!! The hashrate is less then on my laptop :)

I think it could be nice if someone compile sha256 and scrypt for a native cpu support. I found this link for sha256 https://github.com/pinkjersey/ sha256lib but nothing on scrypt.

Could someone take a look?

Cheers, Marco

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pooler/cpuminer/issues/140#issuecomment-343135334, or mute the thread https://github.com/notifications/unsubscribe-auth/AB96BJiBs78gLzzYGIdsXb-PLN2PIqNgks5s0uqygaJpZM4PVzSi .

brucestir commented 6 years ago

./minerd --url=stratum+tcp://sha256.eu.nicehash.com:3334 --userpass=blahblahblah

[2017-11-28 20:54:11] thread 10: 6450 hashes, 0.18 khash/s [2017-11-28 20:54:11] thread 113: 6540 hashes, 0.18 khash/s [2017-11-28 20:54:11] thread 27: 6533 hashes, 0.18 khash/s [2017-11-28 20:54:11] thread 120: 6489 hashes, 0.18 khash/s [2017-11-28 20:54:11] thread 0: 6619 hashes, 0.19 khash/s [2017-11-28 20:54:11] thread 77: 6581 hashes, 0.19 khash/s [2017-11-28 20:54:11] thread 85: 6539 hashes, 0.18 khash/s [2017-11-28 20:54:11] thread 69: 6689 hashes, 0.19 khash/s [2017-11-28 20:54:11] thread 122: 6561 hashes, 0.19 khash/s [2017-11-28 20:54:11] thread 65: 6632 hashes, 0.19 khash/s [2017-11-28 20:54:11] thread 16: 6496 hashes, 0.18 khash/s [2017-11-28 20:55:10] thread 26: 10986 hashes, 0.19 khash/s [2017-11-28 20:55:10] thread 7: 10773 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 97: 11241 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 83: 11311 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 91: 10957 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 8: 10977 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 106: 10948 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 92: 11231 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 93: 11021 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 2: 10937 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 55: 10996 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 58: 11324 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 16: 11022 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 110: 11008 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 54: 11355 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 72: 11209 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 43: 11291 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 127: 11264 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 117: 11031 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 33: 11348 hashes, 0.19 khash/s [2017-11-28 20:55:11] thread 96: 11023 hashes, 0.18 khash/s [2017-11-28 20:55:11] thread 12: 10968 hashes, 0.18 khash/s

So wasn't sure what to expect, but I'm guessing it is doing its thing :-)

Unfortunately nothing in my wallet overnight and the statistics page suggessting i wont earn anything in a million years :-(

I thought these Sun SPARC chips (T4) had special crypto built into the chip and might prove useful ?!?!?

pooler commented 6 years ago

./minerd --url=stratum+tcp://sha256.eu.nicehash.com:3334 --userpass=blahblahblah

I think you're not using the right algorithm for that server. Try with -a sha256d.

I thought these Sun SPARC chips (T4) had special crypto built into the chip and might prove useful ?!?!?

The code is not optimized for SPARC. As has already been pointed out, it could be optimized, but I don't have time to dedicate to this currently. Also keep in mind that, even with optimizations, it will probably never be profitable.

brucestir commented 6 years ago

...ok thanks pooler, I'll give that a go and report back if i see anything interesting :-)

brucestir commented 6 years ago

Thought i would provide update for those interested in my T4-2 SPARC (128thread/16core CPU) experiment...

After adding the -a sha256d the khash rate jumped right up :-)

Unfortunately over night not a single dime mined :-(

2017-11-30 08:07:49] thread 3: 1752815 hashes, 100.47 khash/s [2017-11-30 08:07:49] thread 13: 1766226 hashes, 100.58 khash/s [2017-11-30 08:07:49] thread 28: 1743013 hashes, 100.36 khash/s [2017-11-30 08:07:49] thread 15: 1750660 hashes, 100.48 khash/s [2017-11-30 08:07:49] thread 19: 1752724 hashes, 100.50 khash/s [2017-11-30 08:07:49] thread 18: 1760918 hashes, 100.50 khash/s [2017-11-30 08:07:49] thread 14: 1794853 hashes, 100.43 khash/s [2017-11-30 08:07:49] thread 30: 1693119 hashes, 99.51 khash/s [2017-11-30 08:07:49] thread 6: 1744696 hashes, 100.25 khash/s [2017-11-30 08:07:49] thread 8: 1749926 hashes, 100.39 khash/s [2017-11-30 08:07:49] thread 16: 1744405 hashes, 100.32 khash/s [2017-11-30 08:07:49] thread 31: 1732534 hashes, 100.40 khash/s [2017-11-30 08:07:49] thread 22: 1749923 hashes, 100.36 khash/s [2017-11-30 08:07:49] thread 7: 1705009 hashes, 100.22 khash/s [2017-11-30 08:07:49] thread 0: 1708449 hashes, 99.59 khash/s [2017-11-30 08:07:49] thread 17: 1759882 hashes, 100.34 khash/s [2017-11-30 08:07:49] thread 2: 1752999 hashes, 100.34 khash/s [2017-11-30 08:07:49] thread 27: 1766238 hashes, 100.57 khash/s [2017-11-30 08:07:49] thread 10: 1744106 hashes, 100.45 khash/s [2017-11-30 08:07:49] thread 29: 1809452 hashes, 100.11 khash/s [2017-11-30 08:07:49] thread 23: 1721315 hashes, 100.17 khash/s [2017-11-30 08:07:49] thread 21: 1757371 hashes, 100.40 khash/s [2017-11-30 08:07:49] thread 26: 1744580 hashes, 100.39 khash/s [2017-11-30 08:07:49] thread 12: 1754268 hashes, 100.36 khash/s [2017-11-30 08:07:49] thread 5: 1739999 hashes, 100.33 khash/s [2017-11-30 08:07:49] thread 9: 1754226 hashes, 100.38 khash/s [2017-11-30 08:07:49] thread 25: 1756256 hashes, 100.32 khash/s [2017-11-30 08:07:49] thread 20: 1748244 hashes, 100.38 khash/s [2017-11-30 08:07:49] thread 24: 1748587 hashes, 100.52 khash/s

pinkjersey commented 6 years ago

I looked into the hashing performance of a T4-2 a couple of years ago. It's nowhere near specialized hardware used by pro-miners. Perhaps it had a chance of mining something when it first came out around 2011 but not anymore.

Zorg33 commented 4 years ago

What about the hashrate in other algorithms? Like RandomX for example.