2017年11月29日水曜日

ccminer for monacoin を速くする

https://github.com/Nanashi-Meiyo-Meijin/ccminer/releases/tag/v2.2-mod-r2
からソースをdownload

autogen.sh
configure
make

ccminerが出来上がる。

こちらでpool miningすると
35MH/sと爆速になる。


ccminerをubuntu 17.04にinstall 成功?!

色々試したが、CUDAのinstallを自前でやるのではなく、aptで入れることでなんとかなった。

ubuntu 17.04を再度install

apt update
apt install git automake

apt install libcuda1-384

ここでrebootしnvidiaのdriverが使用されているのを確認。

apt install  nvidia-cuda-toolkit
apt install libssl-dev libcurl4-nss-dev
apt install g++-5

git clone https://github/dim34/ccminer-lyra
cd ccminer-lyra
bash autogen.sh
./configure
make
これでccminerができるはず。

./ccminer -a lyra2v2 -o stratum+tcp://vippool.net:8888 -u blueknight611jp.R17 -p ????
これで採掘開始。

13Mhash/s程度だった。





ccminerをinstall 失敗!

Monacoinを掘るためのccmierをinstallしてみる。

/usr/local/cuda/bin
にPATHを通す。

$ export PATH=$PATH:/usr/local/cuda/bin

~/,profileにも追加しておく。


必要となるlibssl-devをinstall
$ sudo apt-get install libssl-dev


$ git clone https://github.com/djm34/ccminer-lyra
$ cd ccminer-lyra
$ bash autogen.sh
$ ./configure
$ make

これでcompileはできるのだが、実際にccminerを起動すると
errorとなり、採掘できない。



2017年11月26日日曜日

Ryzen-ubuntu 17.04にCUDAをinstall

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
を参考にCUDAを入れてみる。

$ lspci |grep NVIDIA
24:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)

24:00.1 Audio device: NVIDIA Corporation GP104 High Definition Audio Controller (rev a1)
ボードは認識されている。

$ uname -m
x86_64

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="17.04 (Zesty Zapus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 17.04"
VERSION_ID="17.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=zesty
UBUNTU_CODENAME=zesty

と対応システムに含まれている。

$ gcc --version
gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

gccのversionを確認。

kernel headerを確認する。
$ uname -r
4.10.0-40-generic

$ sudo apt-get install linux-headers-4.10.0-40-generic
これはすでにinstallされていた。

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704&target_type=deblocal
から

cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64.deb
をdownloadする。

$ sudo dpkg -i cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64.deb
$ sudo apt-key add /var/cuda-repo-9.0-local/7fa2af80.pub
$ sudo apt-get update
$ sudo apt-get install cuda

sampleを試します。

/usr/local/cuda/bin/cuda-install-samples-9.0.sh /home/hogehoge(適当なところ)
$ cd NVIDIA_CUDA-9.0_Samples
$ make
かなり時間かかります
$ cd bin/x86_64/linux/release
$ sudo ./deviceQuery

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 1070"
  CUDA Driver Version / Runtime Version          9.0 / 9.0
  CUDA Capability Major/Minor version number:    6.1
  Total amount of global memory:                 8113 MBytes (8506769408 bytes)
  (15) Multiprocessors, (128) CUDA Cores/MP:     1920 CUDA Cores
  GPU Max Clock rate:                            1709 MHz (1.71 GHz)
  Memory Clock rate:                             4004 Mhz
  Memory Bus Width:                              256-bit
  L2 Cache Size:                                 2097152 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 2 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 36 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA Runtime Version = 9.0, NumDevs = 1

Result = PASS

と最後PASSしていれば問題なし。




Ryzenでbitzenyを掘ってみる

Ubuntu 17.10を入れたRyzen 1700機でbitzenyを掘ってみる。

$ sudo apt-get install git automake libcurl4-openssl-dev
$ git clone https://github.com/bitzeny/cpuminer
$ cd cpuminer

$ ./autogen.sh
$ ./configure
$ make

./minerd -a yescrypt -o stratum+tcp://bunnymining.work:19334 -u user.worker -p workerpass

これで採掘できているが
5.38khash/s
しか出ない。
こんなものかなあ。

mining machineを組んでubuntuをinstall

mining machineとして構成したのは以下のもの

ubuntu 17.10日本語版を UnetbootinでUSBに焼いてinstallしたところ
無事に起動した。

Graphic Cardは NV134と認識されている。

GTX1070のDriverはhttp://www.nvidia.com/Download/index.aspx?lang=jpで検索して
version 384.98
であることがわかるので、
$ sudo apt-get install nvidia-384
再起動すると
GeForce GTX 1070/PCIe/SSE2
と認識された。

MSI X370 GAMING PRO CARBON ATX ゲーミングマザーボード [AMD RYZEN対応 socket AM4] MB3907


2017年11月24日金曜日

bitzenyを掘る

なんのニュースだったか、monacoinの記事を読んだ。
仮想通貨のminingは専門のハードを注ぎ込んで大規模にやるものになってしまったようだが、 monacoinとか、同じく日本発のbitzenyなんかは、個人でのminingも(まだ?)可能なようだ。

仮想通貨のお勉強もかねて、bitzenyを採掘してみた。



  • オンラインウォレットの登録
オンラインウォレットbitzeny walletにお財布を作る。
ユーザー登録をしてアドレスを入手する。
このアドレスにbitzenyが送金できる。
ZxNKRLcuunvFyzVmMusPjLhRPz1CHafV8d
  • 採掘場の登録
採掘はpool miningが主流。

採掘場はBitZeny Mining Pool - うさぎコイン発掘所 BitZeny版 https://bunnymining.work/bitzeny/index.php
ここにもユーザー登録をしてWORKERを登録。

WORKER Nameはマシンの名前とか適当に
WORKER passwordはとりあえずなんでも良いので 1234 とかにして登録。

  • 採掘ソフトの準備
mining programは bitzenyの場合、http://bitzeny.orgから入手できる専用のものが必要。
(他のソースのcpumier or minerd で -a yescript としてもエラーで採掘できない)

OSX 10.11.6 (El Capitan)には xcode9.2.1と macports 2.4.2が導入されている。

$ sudo port install git  autoconf curl jansson
必要なものをinstallしておく

http://bitzeny.org/のDownload Minerの Source Githubで
https://github.com/bitzeny/cpuminer
を手元にcloneする
$ git clone https://github.com/bitzeny/cpuminer
$ cd cpuminer
$ ./autogen.sh
$ ./nomacro.pl
$ ./configure
   ここでエラーが出る場合は、必要なpackageを port install で入れる
$ make
これで minerd が出来上がる。
  • 実際の採掘
$ ./minerd -a yescrypt -o stratum+tcp://bunnymining.work:19333 -u user.worker -p password

user.workerのところは poolに登録したユーザー名とWORKER名を ドットで繋いだもの
passwordは1234と適当に決めたWORKER Password

私は blukenight611jpでH97NというWorkerを登録したので

$ ./minerd -a yescrypt -o stratum+tcp://bunnymining.work:19333 -u blueknight611jp.H97N -p 1234
これで起動します。


[2017-11-24 16:19:57] thread 4: 4717 hashes, 0.45 khash/s
[2017-11-24 16:19:57] accepted: 25124/25139 (99.94%), 3.58 khash/s (yay!!!)
[2017-11-24 16:19:58] thread 6: 5370 hashes, 0.45 khash/s
[2017-11-24 16:19:58] accepted: 25125/25140 (99.94%), 3.58 khash/s (yay!!!)

[2017-11-24 16:19:58] Stratum requested work restart

こんな感じで yay!!! がでていれば動いています。
booooとかだったら失敗しています。