JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
770 stars 545 forks source link

Linux says I don't have AES but my CPU does #185

Closed FoxyBit closed 5 years ago

FoxyBit commented 5 years ago

I have successfully downloaded and compiled cpuminer, but when I run it I get the message:

Only CPUs with AES are supported, use legacy version.

However I have a A10-7700K CPU which does indeed have AES support. How can I get this to work? Is there something else that's not in the INSTALL_LINUX instructions I can use to get it working? TIA

JayDDee commented 5 years ago

I assume you're trying to mine hodl, all the others can run without AES.

This message means cpuminer wasn't built with AES. If you used build.sh the compiler built for the "native" architecture meaning the compiler chooses what featurtes to enable. Maybe a problem with the compiler, AMD users have long complained about compiling with the correct features, although not so much recently. Maybe you have an old compiler and the newer ones work better. Or maybe it's a problem with feature detection on yor CPU.

You can force he compiler to use AES. Instead of using build.sh with its defaults run this before make:

CFLAGS="-O3 -maes -mavx -Wall" ./configure --with-curl

Please report your results including posting the cpuminer startup messages. It will tell us where the problem is. If it runs ok it's a compiler problem. If cpuminer can't detect AES either it's a CPU problem. And if it crashes then the compiler was right even though the specs say your CPU has AES and cpuminer passed its AES check.

JayDDee commented 5 years ago

Good catch dooglz. I was doing some clean up and forgot to complete the double polarity reversal. Will be fixed in next release, use v3.8.8.1 for now.

JayDDee commented 5 years ago

cpuminer-opt-3.9.2.5

vladilog commented 5 years ago

Hi JayDDee

When using your latest version for mining roi/hodl on my westmere cpu, I get the following error:

     **********  cpuminer-opt 3.9.5.2  ***********
 A CPU miner with multi algo support and optimized for CPUs
 with AES_NI and AVX2 and SHA extensions.
 BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT

CPU: Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz. SW built on Jul 10 2019 with GCC 9.1.0. CPU features: SSE2 AES SSE4.2. SW features: SSE2 AES SSE4.2. Algo features: AES SSE4.2 AVX2. Start mining with AES SSE4.2.

[2019-07-10 23:13:41] 4 CPU cores available, 2 miner threads selected. [2019-07-10 23:13:42] Starting Stratum on stratum+tcp://roi.optiminer.pl:5000 [2019-07-10 23:13:42] Binding thread 0 to cpu 0. [2019-07-10 23:13:42] 2 miner threads started, using 'hodl' algorithm. [2019-07-10 23:13:42] Binding thread 1 to cpu 1. [2019-07-10 23:13:42] Stratum session id: 26517 [2019-07-10 23:13:43] Stratum difficulty set to 25 [2019-07-10 23:13:43] DEBUG: job_id='020000004336e27b-4bf5-47ba-899f-5855794ebc4e' extranonce2=00000000 ntime=5d26a95b [2019-07-10 23:13:43] roi.optiminer.pl:5000 asks job 1127670395 for block 357992 [2019-07-10 23:13:44] DEBUG: job_id='020000004336e27b-4bf5-47ba-899f-5855794ebc4e' extranonce2=01000000 ntime=5d26a95b [1] 12216 segmentation fault (core dumped) ./cpuminer -a hodl -t 2 -o stratum+tcp://roi.optiminer.pl:5000 -u -p x -D

Coming back to ver 3.8.8.1 (freshly built) gives me zero problem:

     **********  cpuminer-opt 3.8.8.1  ***********
 A CPU miner with multi algo support and optimized for CPUs
 with AES_NI and AVX2 and SHA extensions.
 BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT

CPU: Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz. SW built on Jul 4 2019 with GCC 9.1.0. CPU features: SSE2 AES SSE4.2. SW features: SSE2 AES SSE4.2. Algo features: AES SSE4.2 AVX2. Start mining with AES SSE4.2.

[2019-07-10 23:20:03] 4 CPU cores available, 2 miner threads selected. [2019-07-10 23:20:03] Starting Stratum on stratum+tcp://roi.optiminer.pl:5000 [2019-07-10 23:20:03] 2 miner threads started, using 'hodl' algorithm. [2019-07-10 23:20:04] Stratum difficulty set to 25 [2019-07-10 23:20:16] CPU #1: 482 H, 45.04 H/s [2019-07-10 23:20:16] CPU #0: 480 H, 44.84 H/s [2019-07-10 23:20:26] CPU #1: 483 H, 46.38 H/s [2019-07-10 23:20:26] CPU #0: 482 H, 45.93 H/s [2019-07-10 23:20:36] CPU #0: 517 H, 49.97 H/s [2019-07-10 23:20:36] CPU #1: 490 H, 47.33 H/s [2019-07-10 23:20:47] CPU #0: 498 H, 47.98 H/s......

Is westmere cpu no longer supported? Should I stick to 3.8.8.1?

Thanks in advance.

JayDDee commented 5 years ago

This is a different issue, you're not getting the error message, cpuminer is crashing.

I've reproduced it with a aes-sse42 build even though the CPU is Ryzen. Native Ryzen build works so it's a problem with the aes-sse42 build.

I will investigate. In the meantime use what works for you.

JayDDee commented 5 years ago

Fixed in v3.9.5.3, and faster than v3.8.8.1 on Westmere.

vladilog commented 5 years ago

Yes. I confirm v3.9.5.3 is working. Thanks a lot !