LoginSignup
8
10

More than 5 years have passed since last update.

[ethereum]Ubuntu 15.10でGPUプール採掘

Last updated at Posted at 2016-01-25

追記の追記の追記

玄人志向 | RD-R9-290-E4GB/DF/OC:Radeon R9 290 グラフィックボード

を Ubuntu 15.10(Server) に載せ採掘を再開した。
もしも今から採掘をはじめるのならばグラボのメモリ4GBは必要。
「安いから2GB」はDAGの展開ができず動かないと思われるから買う価値がない。

追記の追記

基本は以下のとおり

追加情報

ethminer
[OPENCL]:Allocating/mapping single buffer failed with: clCreateBuffer(-61). GPU can't allocate the DAG in a single chunk. Bailing.
[OPENCL]:clEnqueueWriteBuffer(-38)

注意事項

  • 採掘専用機として捉えているためいろんな設定がガバガバですし、あなたの環境を意図せず上書きする可能性があります
  • 不要な sudo を実行しているかも……

前提

  • すでにWalletは作成済みであること
  • eth1.nanopool.org:8888 へ接続できること
  • グラボは右記を使用 R7870 Twin Frozr III OC
    • 二日掘りまくってそこそこのMH/sをあげていたが、一旦再起動したら以下のようなエラーメッセージのもと採掘できなくなった
    • 2GB超確実にあればいけるのか?
    • ただ少なくとも再起動直前まで稼働していたのでトリガーがなにか調査中。
      • 追加情報 で対応できたので取り消し線を削除した
    • 再インストールしたらまた稼働しだした。
      • メモリ認識している値が50MBくらい差異があった(再インストール後のほうが多い)
ethminer
[OPENCL]:Found suitable OpenCL device [Pitcairn] with 1940914176 bytes of GPU memory
  ℹ  16:08:41.687|ethminer  Loading full DAG of seedhash: #7e7d8bef…
  ℹ  16:08:41.687|gpuminer0  workLoop 0 #00000000… #1842cb89…
  ℹ  16:08:41.687|gpuminer0  Initialising miner...
[OPENCL]:Using platform: AMD Accelerated Parallel Processing
[OPENCL]:Using device: Pitcairn(OpenCL 1.2 AMD-APP (1800.8))
  ℹ  16:08:46.167|ethminer  Full DAG loaded
[OPENCL]:Printing program log
[OPENCL]:
[OPENCL]:Creating one big buffer for the DAG
[OPENCL]:Allocating/mapping single buffer failed with: clCreateBuffer(-61). GPU can't allocate the DAG in a single chunk. Bailing.
[OPENCL]:clEnqueueWriteBuffer(-38)

ethminer__-list-devices
ethminer --list-devices
[OPENCL]:
Listing OpenCL devices.
FORMAT: [deviceID] deviceName
[0] Pitcairn
        CL_DEVICE_TYPE: GPU
        CL_DEVICE_GLOBAL_MEM_SIZE: 1940914176
        CL_DEVICE_MAX_MEM_ALLOC_SIZE: 1310982144
        CL_DEVICE_MAX_WORK_GROUP_SIZE: 256

  • なおCUDAMinerよりGPUMinerのほうが速いらしい1

下準備

bash
USER=${whoami}
GROUP=$(groups $(whoami) |awk -F' ' '{print $3}')
sudo apt-get -y update
sudo apt-get -y upgrade -f
sudo apt-get -y install git
sudo apt-get -y install software-properties-common
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get -y install build-essential libgmp3-dev golang
sudo apt-get -y upgrade

go-ethereum

bash
# USER=${whoami}
# GROUP=$(groups $(whoami) |awk -F' ' '{print $3}')
cd ~
git  clone https://github.com/ethereum/go-ethereum
sudo chown -R ${USER}:${GROUP} go-ethereum
cd   go-ethereum
make geth

AMD-APP-SDKInstaller を準備

bash
# 以下にファイルを配置する予定で進める
# ~/AMD/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2

mkdir ~/AMD
cd    ~/AMD/

# (snip)すでに配置したものとする(snip)

# 最近のtarはbunzip2いらず?だからtar一撃で終わる?
bunzip2 AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2
tar xvf AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar

# インストールスクリプト実行後、~/${AMDAPPVER} ディレクトリが自動生成されている
# 今回のバージョンは以下
AMDAPPVER="AMDAPPSDK-3.0"
./AMD-APP-SDK-v3.0.130.135-GA-linux64.sh && cat ~/${AMDAPPVER}/InstallLog_*.log

# なんでもかんでも構わず突っ込むのがお手軽
ln -s ~/${AMDAPPVER} ~/AMDAPP

sudo ln -s ~/AMDAPP/include/CL   /usr/include
sudo ln -s ~/AMDAPP/lib/x86_64/* /usr/lib/
sudo ldconfig
sudo reboot

AMD製GPUを対応させていく

bash
sudo apt-get install -y fglrx-updates

sudo aticonfig --adapter=all --initial  # ここでエラーがでるようならグラボは認識されていない
sudo aticonfig --list-adapters          # なお僕は補助電源の存在を意識せずにPCI Expressのポートに挿しただけだったので、
                                        # 当然グラボは認識されなかったし挙句の果てに電源ユニットを買い足す必要に迫られた

ethminer

bash
# 14.04
## sudo add-apt-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main"
# 15.04
## sudo add-apt-repository "deb http://llvm.org/apt/vivid/ llvm-toolchain-vivid-3.7 main"
# 15.10
sudo add-apt-repository "deb http://llvm.org/apt/wily/ llvm-toolchain-wily-3.7 main"
sudo apt-get install    -y software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum-qt
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get update     -y
sudo apt-get install    -y ethereum
sudo apt-get install    -y cpp-ethereum

GPU Mining を eth1.nanopool.org:8888 で行う

  • Ethereum nanopool Help を見るとだいたいわかる
  • -FfarmへのURL を指定
    • ${_0x_WALLET_ID} は すでに作成されているはずのあなたのWallet ID
    • ${woker_name} は nanopoolでの稼働名 / 実行マシンごとに付け替えるのが吉(理由は後述)
    • ${your_mail_address} は ${worker_name} がオフラインになったよ、という警告メールを受け取るメールアドレス
  • -G は GPUminer ということ
  • なお稼働状況は http://nanopool.org/account/${_0x_WALLET_ID} で確認可能
bash
# 以下を実行するとPoolでの採掘を始める
ethminer -F http://eth1.nanopool.org:8888/${_0x_WALLET_ID}/${woker_name}/${your_mail_address} -G

複数台あれば以下のように実行するのがよいのではないか

  • ${worker_name} をマシンごとに変更している
bash
ethminer -F http://eth1.nanopool.org:8888/0x5ca8278379e3cfbd2b5e89f0b451170b0f9089fe/ubuntu01/hoge+ubuntu01@example.com -G
ethminer -F http://eth1.nanopool.org:8888/0x5ca8278379e3cfbd2b5e89f0b451170b0f9089fe/ubuntu02/hoge+ubuntu02@example.com -G

nohup を利用するのもよいかもしれない

bash
nohup ethminer -F http://eth1.nanopool.org:8888/0x5ca8278379e3cfbd2b5e89f0b451170b0f9089fe/ubuntu01/hoge+ubuntu01@example.com -G &
tail -f nohup.out

最後に

それではみなさま採掘に勤しみましょう。
家内安全、千客万来、Mining御礼2の精神で行きましょう。3


  1. 2016.01現在 

  2. どうしても言いたかった 

  3. ちなみに現状ですと電気代をぎりぎりペイできるかどうか(多分つらい)というくらいと思います。 

8
10
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10