Author

Topic: [ANN]: cpuminer-opt v3.8.8.1, open source optimized multi-algo CPU miner - page 174. (Read 444040 times)

legendary
Activity: 1470
Merit: 1114
Can you run this command on your AMD processors and show me the output?
Code:
gcc -march=native -Q --help=target | fgrep march

Here you are:
Code:
root@beast:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               amdfam10

This curious. I presume that shows which arch is used by native.

On my skylake I get core2-avx and on my haswell sandy bridge I get corei7-avx.
configure fails with -march=skylake on my skylake.
Yeah! This got me curious and do some tests too.  Cool

Intel Core i7-4790K CPU @ 4.40GHz
Code:
root@storm:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               core-avx2

AMD Sempron 145
Code:
root@wolverine:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               amdfam10

Correction, my sandy bridge shows corei7-avx.
sr. member
Activity: 312
Merit: 250
Can you run this command on your AMD processors and show me the output?
Code:
gcc -march=native -Q --help=target | fgrep march

Here you are:
Code:
root@beast:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               amdfam10

This curious. I presume that shows which arch is used by native.

On my skylake I get core2-avx and on my haswell I get corei7-avx.
configure fails with -march=skylake on my skylake.
Yeah! This got me curious and do some tests too.  Cool

Intel Core i7-4790K CPU @ 4.40GHz
Code:
root@storm:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               core-avx2

AMD Sempron 145
Code:
root@wolverine:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               amdfam10
legendary
Activity: 1470
Merit: 1114
legendary
Activity: 1470
Merit: 1114
Can you run this command on your AMD processors and show me the output?
Code:
gcc -march=native -Q --help=target | fgrep march

Here you are:
Code:
root@beast:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               amdfam10

This curious. I presume that shows which arch is used by native.

On my skylake I get core2-avx and on my haswell I get corei7-avx.
configure fails with -march=skylake on my skylake.
jr. member
Activity: 324
Merit: 1
sr. member
Activity: 312
Merit: 250
Can you run this command on your AMD processors and show me the output?
Code:
gcc -march=native -Q --help=target | fgrep march

Here you are:
Code:
root@beast:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               amdfam10
member
Activity: 83
Merit: 10
Code:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)

Can you run this command on your AMD processors and show me the output?
Code:
gcc -march=native -Q --help=target | fgrep march

Below are examples of how output should look like.

Output on my core2:
Code:
hmage@wraith:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               core2

On haswell:
Code:
hmage@dhmd:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               haswell

On ivybridge:
Code:
hmage@education:~$ gcc -march=native -Q --help=target | fgrep march
  -march=                               ivybridge

List of supported architectures on GCC 4.8.4 is here -- https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/i386-and-x86-64-Options.html
sr. member
Activity: 312
Merit: 250
Please try with
Code:
./configure CFLAGS="-O3 -march=btver1" --with-curl --with-crypto

Build successful on both AMD CPU's without -DNO_AES_NI

So, what was the setup that was giving the errors? If it works with and without NO_AES_NI?

What was the version of gcc?
Default Ubuntu Server GCC
3.19.0-58-generic kernel
AMD Phenom II X4 940 @ 3.6GHz with 4GB RAM

Code:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
legendary
Activity: 1470
Merit: 1114
Please try with
Code:
./configure CFLAGS="-O3 -march=btver1" --with-curl --with-crypto

Build successful on both AMD CPU's without -DNO_AES_NI

So, what was the setup that was giving the errors? If it works with and without NO_AES_NI?

What was the version of gcc?

I don't understand your question.

If you mean my request above to test it was just to confirm it works on real non-aes HW, which I don't have.

If you are referring to the compile problems in 3.1.14 it was because of a misunderstanding on the maning of __AES__.

If you're referring to you problems with -march=native I have no idea.

gcc v4.8.4

Did any of these answer your question?
member
Activity: 83
Merit: 10
Please try with
Code:
./configure CFLAGS="-O3 -march=btver1" --with-curl --with-crypto

Build successful on both AMD CPU's without -DNO_AES_NI

So, what was the setup that was giving the errors? If it works with and without NO_AES_NI?

What was the version of gcc?
legendary
Activity: 1470
Merit: 1114
Please try with
Code:
./configure CFLAGS="-O3 -march=btver1" --with-curl --with-crypto

Build successful on both AMD CPU's without -DNO_AES_NI

Excelllent, thanks.
sr. member
Activity: 312
Merit: 250
Please try with
Code:
./configure CFLAGS="-O3 -march=btver1" --with-curl --with-crypto

Build successful on both AMD CPU's without -DNO_AES_NI
legendary
Activity: 1470
Merit: 1114

Also, just to confirm, did you successfully compile without the -DNO_AES_NI flag?


I compiled successfully few times on each cpu with this configure
Code:
./configure CFLAGS="-DNO_AES_NI -O3 -march=btver1" --with-curl --with-crypto


Please try with
Code:
./configure CFLAGS="-O3 -march=btver1" --with-curl --with-crypto
sr. member
Activity: 312
Merit: 250

Also, just to confirm, did you successfully compile without the -DNO_AES_NI flag?


I compiled successfully few times on each cpu with this configure
Code:
./configure CFLAGS="-DNO_AES_NI -O3 -march=btver1" --with-curl --with-crypto

The build.sh error at the end is this:
Code:
In file included from algo/echo/aes_ni/hash.c:19:0:
algo/echo/aes_ni/hash.c: At top level:
./miner.h:479:20: warning: ‘algo_names’ defined but not used [-Wunused-variable]
 static const char *algo_names[] = {
                    ^
In file included from algo/echo/aes_ni/hash.c:20:0:
algo/echo/aes_ni/hash_api.h:47:23: warning: ‘initial_echo512_ctx’ defined but not used [-Wunused-variable]
 static hashState_echo initial_echo512_ctx =
                       ^
make[2]: *** [algo/echo/aes_ni/cpuminer-hash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f algo/groestl/.deps/cpuminer-groestl.Tpo algo/groestl/.deps/cpuminer-groestl.Po
In file included from algo/groestl/myr-groestl.c:1:0:
./miner.h:479:20: warning: ‘algo_names’ defined but not used [-Wunused-variable]
 static const char *algo_names[] = {
                    ^
mv -f algo/.deps/cpuminer-fresh.Tpo algo/.deps/cpuminer-fresh.Po
mv -f algo/groestl/.deps/cpuminer-myr-groestl.Tpo algo/groestl/.deps/cpuminer-myr-groestl.Po
make[2]: Leaving directory `/home/*****/cpuminer-opt-3.1.15-phenom'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/*****/cpuminer-opt-3.1.15-phenom'
make: *** [all] Error 2
strip: 'cpuminer': No such file

And this one
Code:
algo/echo/aes_ni/hash.c:385:4: note: in expansion of macro ‘TRANSFORM’
    TRANSFORM(_state[i][j], _k_opt, t1, t2);
    ^
In file included from algo/echo/aes_ni/hash.c:19:0:
algo/echo/aes_ni/hash.c: At top level:
./miner.h:479:20: warning: ‘algo_names’ defined but not used [-Wunused-variable]
 static const char *algo_names[] = {
                    ^
In file included from algo/echo/aes_ni/hash.c:20:0:
algo/echo/aes_ni/hash_api.h:47:23: warning: ‘initial_echo512_ctx’ defined but not used [-Wunused-variable]
 static hashState_echo initial_echo512_ctx =
                       ^
mv -f algo/argon2/ar2/.deps/cpuminer-ar2-scrypt-jane.Tpo algo/argon2/ar2/.deps/cpuminer-ar2-scrypt-jane.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -Iyes/include -Iyes/include -fno-strict-aliasing  -I. -Iyes/include -Iyes/include -Wno-pointer-sign -Wno-pointer-to-int-cast   -O3 -march=native -Wall  -Iyes/include -Iyes/include -MT algo/groestl/sse2/cpuminer-grso-asm.o -MD -MP -MF algo/groestl/sse2/.deps/cpuminer-grso-asm.Tpo -c -o algo/groestl/sse2/cpuminer-grso-asm.o `test -f 'algo/groestl/sse2/grso-asm.c' || echo './'`algo/groestl/sse2/grso-asm.c
make[2]: *** [algo/echo/aes_ni/cpuminer-hash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f algo/groestl/.deps/cpuminer-myr-groestl.Tpo algo/groestl/.deps/cpuminer-myr-groestl.Po
mv -f algo/groestl/sse2/.deps/cpuminer-grso.Tpo algo/groestl/sse2/.deps/cpuminer-grso.Po
mv -f algo/groestl/sse2/.deps/cpuminer-grso-asm.Tpo algo/groestl/sse2/.deps/cpuminer-grso-asm.Po
make[2]: Leaving directory `/home/*****/cpuminer-opt-3.1.15-sempron'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/*****/cpuminer-opt-3.1.15-sempron'
make: *** [all] Error 2
strip: 'cpuminer': No such file
legendary
Activity: 1470
Merit: 1114
Following the topic I get the impression that the new changes detects cpu, OS, algo (for AES-NI support)
and if the cpu, OS, algo doesnt support AES-NI it falls back to SSE2.

I will send you PM in a few minutes with the compile logs for both CPU's - Phenom II X4 940 and Sempron 145

That is correct. You need all three to get the best performance.

I haven't found specifically whether either of your CPUs has AES_NI but I suspect not. Try compiling with
-march=core2. It seems to have worked for others.

Both AMD's are without AES-NI support.
-march=core2 works on both, but the compiled binary is about 15% slower than with -march=btver1.

AFAIK its related to SSE implementations on AMD CPU's. So with -march=btver1 which is AMD specific I got the best results.
I tried several -march options, starting with core2 and measured the hashrate on the miner and the pool to choose that one for me.

P.S. Logs are on the way Wink

The logs you sent had no errors, but that's ok I found the nugget in the first line of the previous compile session:
make[2]: *** [algo/echo/aes_ni/cpuminer-hash.o] Error 1
It's clear it was trying to compile AES code.

Also, just to confirm, did you successfully compile without the -DNO_AES_NI flag?

I've drafted the following note to be added to the README file:

Also, just to confirm, did you successfully compile without the -DNO_AES_NI flag?
sr. member
Activity: 312
Merit: 250
Following the topic I get the impression that the new changes detects cpu, OS, algo (for AES-NI support)
and if the cpu, OS, algo doesnt support AES-NI it falls back to SSE2.

I will send you PM in a few minutes with the compile logs for both CPU's - Phenom II X4 940 and Sempron 145

That is correct. You need all three to get the best performance.

I haven't found specifically whether either of your CPUs has AES_NI but I suspect not. Try compiling with
-march=core2. It seems to have worked for others.

Both AMD's are without AES-NI support.
-march=core2 works on both, but the compiled binary is about 15% slower than with -march=btver1.

AFAIK its related to SSE implementations on AMD CPU's. So with -march=btver1 which is AMD specific I got the best results.
I tried several -march options, starting with core2 and measured the hashrate on the miner and the pool to choose that one for me.

P.S. Logs are on the way Wink
legendary
Activity: 1470
Merit: 1114
Following the topic I get the impression that the new changes detects cpu, OS, algo (for AES-NI support)
and if the cpu, OS, algo doesnt support AES-NI it falls back to SSE2.

I will send you PM in a few minutes with the compile logs for both CPU's - Phenom II X4 940 and Sempron 145

That is correct. You need all three to get the best performance.

I haven't found specifically whether either of your CPUs has AES_NI but I suspect not. Try compiling with
-march=core2. It seems to have worked for others.
sr. member
Activity: 312
Merit: 250
Following the topic I get the impression that the new changes detects cpu, OS, algo (for AES-NI support)
and if the cpu, OS, algo doesnt support AES-NI it falls back to SSE2.

I will send you PM in a few minutes with the compile logs for both CPU's - Phenom II X4 940 and Sempron 145
legendary
Activity: 1470
Merit: 1114
New in v3.1.15

  - unified build procedure fixed
     - build.sh now works for CPUs with and without AES_NI
     - it is no longer necessary to add "-DNO_AES_NI" CFLAG to the
       configure command when building for CPUs without AES_NI.
     - The system will automatically compile for the correct architecture

Thanks!

Strange thing - when I compile with
Code:
./autogen.sh && ./configure CFLAGS="-DNO_AES_NI -O3 -march=btver1" --with-curl --with-crypto && make
on AMD Sempron 145, all works like a charm.

When I use ./build.sh I get an error in compile.

Will try on AMD Phenom II X4 940 and see can I reproduce it.

Edit: ./build.sh fails also on AMD Phenom II X4 940
Code:
make[2]: *** [algo/echo/aes_ni/cpuminer-hash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f algo/groestl/sse2/.deps/cpuminer-grso-asm.Tpo algo/groestl/sse2/.deps/cpuminer-grso-asm.Po
mv -f algo/argon2/ar2/.deps/cpuminer-opt.Tpo algo/argon2/ar2/.deps/cpuminer-opt.Po
mv -f algo/argon2/ar2/.deps/cpuminer-ar2-scrypt-jane.Tpo algo/argon2/ar2/.deps/cpuminer-ar2-scrypt-jane.Po
make[2]: Leaving directory `/home/urban/cpuminer-opt-3.1.15'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/*****/cpuminer-opt-3.1.15'
make: *** [all] Error 2

The only real difference I see is -march. build.sh always uses native. -DNO_AES_NI is now redundant and should
not be necessary unless -march=native is choosing an incompatible architecture. If that's the case I don't know
what I can do other than document the workaround.

It would be nice to see the compile errors to give me an idea what it was trying to do.

I don't have a non-aesni CPU to test on so it would be nice if you could confirm the capabilities reported when the miner
is started is correct.

Edit: the real errors are further back but didn't cause the compile to fail immediately. Do they compile if you specify
a specific arch but without -DNO_AES_NI?
Jump to: