AMD Optimizing C/C++ Compiler(AOCC)でcpuminerのRyzen向け最適化ビルドを作る

in #cryptocurrency7 years ago (edited)

こんにちは。@anagotです。
steemit登録したものの何を書けばいいのか迷ったので、
とりあえずは最近ハマっているBitzenyの採掘に使用しているcpuminerのryzen向けの最適化について書こうと思います。

AMD Optimizing C/C++ Compiler(AOCC)

AMD Optimizing C/C++ Compiler(AOCC)はclangベースのAMD製CPUに最適化されたコンパイラです。
インテルと違って無料なのが良いです。
Linux用のものが配布されていたのでこれをWSLのubuntuで使ってみます。
Windows向けのクロスコンパイルは試してみたのですがうまくいきませんでした。


AOCCのインストールと利用方法については
インストールガイドとユーザーガイドを参考にしてください。
https://developer.amd.com/wordpress/media/2017/04/AOCC-1.1-Install-Guide.pdf
https://developer.amd.com/wordpress/media/2017/04/AOCC-1.1-User-Guide.pdf

実行環境

CPU Ryzen 1700 (OC:3.6Ghz)
MEMORY DDR4 3200Mhz 14-15-15-15-32
OS Windows10 64bit (+ Windows Subsystem for Linux :Ubuntu)
電源プロファイル 高パフォーマンス
CPUマイナーのソース https://github.com/macchky/cpuminer/ V2.6.0
ベンチ時のコマンド minerd --benchmark -a yescrypt

コンパイル時のオプション毎の実行結果

./configure CC=clang CFLAGS="-Ofast -march=native" 平均7.31khash/s
./configure CC=clang CFLAGS="-Ofast -march=native -mno-avx -mno-avx2" 平均7.23khash/s
./configure CC=clang CFLAGS="-Ofast -march=native -mno-avx2" 平均7.42khash/s
./configure CC=clang CFLAGS="-Ofast -march=native" --disable-assembly 平均7.40khash/s
./configure CC=clang CFLAGS="-Ofast -march=native -mno-avx -funroll-loops -fomit-frame-pointer" 平均7.25khash/s
./configure CC=clang CFLAGS="-Ofast -march=native -mno-avx -fomit-frame-pointer" 平均7.25khash/s

GCCの場合
./configure CFLAGS="-Ofast -march=native -mno-avx2" 平均7.33khash/s

デフォで配布されてるバイナリ
https://github.com/macchky/cpuminer/releases/tag/v2.6.0
Windows 7.15 khash/s
Linux 7.18 khash/s

結論

RyzenがAVX2が弱いからなのかAVX2を無効にした場合が一番ハッシュレートが高いようです。
WSLではなくネイティブなLinux環境であれば結果は少し変わってくると思います。
どちらにせよ総じて標準の配布バイナリよりハッシュレートが高くなります。

今後もわりとどうでもいいことを書いていくと思いますのでよろしくお願いします。

Sort:  

Congratulations @anagot! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemitBoard Ranking update - A better rich list comparator
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Congratulations @anagot! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.029
BTC 60661.72
ETH 2395.32
USDT 1.00
SBD 2.56