CUDA入門 ― 2014/07/31 07:40

CUDAのプログラムの勉強で、サンプルプログラムの多い入門書を探しております。
以下は解説がメインで、直ぐに動かせるコードは無いです。
はじめてのCUDAプログラミング―驚異の開発環境[GPU+CUDA]を使いこなす! (I・O BOOKS)
http://www.amazon.co.jp/%E3%81%AF%E3%81%98%E3%82%81%E3%81%A6%E3%81%AECUDA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E2%80%95%E9%A9%9A%E7%95%B0%E3%81%AE%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83-GPU-CUDA-%E3%82%92%E4%BD%BF%E3%81%84%E3%81%93%E3%81%AA%E3%81%99-BOOKS/dp/4777514773/ref=sr_1_2?ie=UTF8&qid=1406759950&sr=8-2&keywords=cuda
以下はまあ、サンプルコードは1種類です。その他は解説がメインです。
http://accc.riken.jp/secure/4467/cuda-programming_main.pdf
以下は、windowsでのコードです。Linuxには対応していない様です。
http://cudasample.net/
以下で、「GPGPU」で検索されるCUDAのPDF資料にもサンプルが載っています。
http://www.cc.u-tokyo.ac.jp/support/press/news/
http://exth.net/~ohshima/cgi-bin/fswiki/wiki.cgi?page=%A5%B9%A5%D1%A5%B3%A5%F3%A5%CB%A5%E5%A1%BC%A5%B9
以下で、説明資料とサンプルコードが載っています。
GPUコンピューティング研究会
http://gpu-computing.gsic.titech.ac.jp/classes
以下は解説がメインで、直ぐに動かせるコードは無いです。
はじめてのCUDAプログラミング―驚異の開発環境[GPU+CUDA]を使いこなす! (I・O BOOKS)
http://www.amazon.co.jp/%E3%81%AF%E3%81%98%E3%82%81%E3%81%A6%E3%81%AECUDA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E2%80%95%E9%A9%9A%E7%95%B0%E3%81%AE%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83-GPU-CUDA-%E3%82%92%E4%BD%BF%E3%81%84%E3%81%93%E3%81%AA%E3%81%99-BOOKS/dp/4777514773/ref=sr_1_2?ie=UTF8&qid=1406759950&sr=8-2&keywords=cuda
以下はまあ、サンプルコードは1種類です。その他は解説がメインです。
http://accc.riken.jp/secure/4467/cuda-programming_main.pdf
以下は、windowsでのコードです。Linuxには対応していない様です。
http://cudasample.net/
以下で、「GPGPU」で検索されるCUDAのPDF資料にもサンプルが載っています。
http://www.cc.u-tokyo.ac.jp/support/press/news/
http://exth.net/~ohshima/cgi-bin/fswiki/wiki.cgi?page=%A5%B9%A5%D1%A5%B3%A5%F3%A5%CB%A5%E5%A1%BC%A5%B9
以下で、説明資料とサンプルコードが載っています。
GPUコンピューティング研究会
http://gpu-computing.gsic.titech.ac.jp/classes
Scientific Linux 6でCUDA ― 2014/07/24 08:25
Scientific Linux 6でCUDAをインストールしようと、以下のサイトを参考にインストールしようとしております。
http://www.softek.co.jp/SPG/Pgi/TIPS/public/accel/cuda60_install.html
以下のコマンドを実行したところ、エラーが発生しました。
# yum install cuda
(中略)
---> Package xorg-x11-drv-nvidia-libs.i686 1:331.62-2.el6 will be installed
--> Processing Dependency: libvdpau(x86-32) >= 0.5 for package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.i686
---> Package xorg-x11-drv-nvidia-libs.x86_64 1:331.62-2.el6 will be installed
--> Processing Dependency: libvdpau(x86-64) >= 0.5 for package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.x86_64
--> Finished Dependency Resolution
Error: Package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.i686 (cuda)
Requires: libvdpau(x86-32) >= 0.5
Error: Package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.x86_64 (cuda)
Requires: libvdpau(x86-64) >= 0.5
Available: libvdpau-0.4.1-1.el6.rf.x86_64 (rpmforge)
libvdpau(x86-64) = 0.4.1-1.el6.rf
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
--skip-broken を使用しろという事で、以下のコマンドを実行しましたが、解消されていない様です。
# yum install cuda --skip-broken
エラーメッセージを読むと「libvdpau」と言うパッケージのバージョンが古い為、「0.5」以上にしろと言っています。
以下を読んで、
http://pkgs.org/centos-6/linuxtech/libvdpau-0.5-2.el6.x86_64.rpm.html
1 /etc/yum.repos.d/linuxtech.repo と言うファイルを作成
[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
2 以下のコマンドを実行
# yum install libvdpau
これで、「libvdpau」が「0.5-2.el6」になりました。以下のコマンドが実行できるようになりました。
# yum install cuda
これで、CUDAがインストール出来ました。
パッケージのDLに時間が掛かりすぎる(約半日)為、インストール先が複数台ある時は、runファイルをDLしてインストールした方が良いかもしれません。
pgaccelinfo と言うコマンドでGPUの情報を出力とありました。そういうコマンドは無いようです。PGIコンパイラを購入し、インストールすると使えるようになるようです。
http://www.softek.co.jp/SPG/Pgi/TIPS/public/accel/cuda32_install.html
http://www.softek.co.jp/SPG/Pgi/pgi-price.html
http://www.softek.co.jp/SPG/Pgi/TIPS/public/accel/cuda60_install.html
以下のコマンドを実行したところ、エラーが発生しました。
# yum install cuda
(中略)
---> Package xorg-x11-drv-nvidia-libs.i686 1:331.62-2.el6 will be installed
--> Processing Dependency: libvdpau(x86-32) >= 0.5 for package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.i686
---> Package xorg-x11-drv-nvidia-libs.x86_64 1:331.62-2.el6 will be installed
--> Processing Dependency: libvdpau(x86-64) >= 0.5 for package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.x86_64
--> Finished Dependency Resolution
Error: Package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.i686 (cuda)
Requires: libvdpau(x86-32) >= 0.5
Error: Package: 1:xorg-x11-drv-nvidia-libs-331.62-2.el6.x86_64 (cuda)
Requires: libvdpau(x86-64) >= 0.5
Available: libvdpau-0.4.1-1.el6.rf.x86_64 (rpmforge)
libvdpau(x86-64) = 0.4.1-1.el6.rf
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
--skip-broken を使用しろという事で、以下のコマンドを実行しましたが、解消されていない様です。
# yum install cuda --skip-broken
エラーメッセージを読むと「libvdpau」と言うパッケージのバージョンが古い為、「0.5」以上にしろと言っています。
以下を読んで、
http://pkgs.org/centos-6/linuxtech/libvdpau-0.5-2.el6.x86_64.rpm.html
1 /etc/yum.repos.d/linuxtech.repo と言うファイルを作成
[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
2 以下のコマンドを実行
# yum install libvdpau
これで、「libvdpau」が「0.5-2.el6」になりました。以下のコマンドが実行できるようになりました。
# yum install cuda
これで、CUDAがインストール出来ました。
パッケージのDLに時間が掛かりすぎる(約半日)為、インストール先が複数台ある時は、runファイルをDLしてインストールした方が良いかもしれません。
pgaccelinfo と言うコマンドでGPUの情報を出力とありました。そういうコマンドは無いようです。PGIコンパイラを購入し、インストールすると使えるようになるようです。
http://www.softek.co.jp/SPG/Pgi/TIPS/public/accel/cuda32_install.html
http://www.softek.co.jp/SPG/Pgi/pgi-price.html
XenServer その6 ― 2014/02/11 14:23
XenServer6.2に評価版のライセンスを適用して、不具合を修正するファイルを適応できないか調べています。
5.6の頃の情報です。下にライセンスの適用手順の情報がありますが、適用できないですね。ライセンスファイルは*.xslicと言うファイルの様です。
http://www.citrix.co.jp/products/xenserver/download.html
6.0の頃は「仮想アプライアンス化したライセンス認証サーバー」を用いた様です。
http://cloud.watch.impress.co.jp/docs/column/virtual/20120416_526278.html
6.2では無理なのでしょうか、挫折しそうです。 (^^;
5.6の頃の情報です。下にライセンスの適用手順の情報がありますが、適用できないですね。ライセンスファイルは*.xslicと言うファイルの様です。
http://www.citrix.co.jp/products/xenserver/download.html
6.0の頃は「仮想アプライアンス化したライセンス認証サーバー」を用いた様です。
http://cloud.watch.impress.co.jp/docs/column/virtual/20120416_526278.html
6.2では無理なのでしょうか、挫折しそうです。 (^^;
XenServer その5 ― 2014/02/11 11:18
やり方が分かりました、以下のサイトの通りです。テンプレートを選択する画面で、「Other install media」を選びます。これで、インストーラーが起動できました。
http://www.ospn.jp/press/20111220useit-oss-xenserver.html
インストーラーは起動できたのですが、Liveディスクの為か仮想ディスクにイOSをインストール出来ませんでした。
現状インストールできたのはWindows8.1のみで、linux系のインストールは成功していません。
テンプレートにあるlinux系OSを選んでインストールするにはライセンスを購入する必要があるようで、無料のXenServerで試せるのはここまで位でしょうか。
http://www.ospn.jp/press/20111220useit-oss-xenserver.html
インストーラーは起動できたのですが、Liveディスクの為か仮想ディスクにイOSをインストール出来ませんでした。
現状インストールできたのはWindows8.1のみで、linux系のインストールは成功していません。
テンプレートにあるlinux系OSを選んでインストールするにはライセンスを購入する必要があるようで、無料のXenServerで試せるのはここまで位でしょうか。
XenServer その4 ― 2014/02/10 14:47
書籍や以下のサイトの情報に寄ると、Linuxをインストールするには「Linux Supplemental Packs」を導入する必要が有るとの事です。
http://gihyo.jp/admin/feature/01/virtualize2010/0003
XenServer6.2用の「Linux Supplemental Packs」は以下のDLサイトには有りません。
https://www.citrix.com/downloads/xenserver/product-software/xenserver-62.html
色々調べると、「The Linux supplemental pack has been removed, 」と言う記述が以下のサイトにありました。「Linux Supplemental Packs」は最新版では削除された様です。
http://blogs.citrix.com/2011/09/30/xenserver-6-0-is-here/
XenServer6.0では「Linux Supplemental Packs」無しでも、Linuxのインストールの実績が有る様です。
http://www.ospn.jp/press/20111018useit-oss-xenserver-2.html
http://www.ospn.jp/press/20111220useit-oss-xenserver.html
以下のマニュアルに寄れば、コマンドラインでディスクからインストール可能の様です。でも、GUI(XenCenter)の方が良いですよね。GUIでの方法を探します。
仮想マシンユーザーガイド - XenServer 6.2.0
http://support.citrix.com/servlet/KbServlet/download/35784-102-706187/XenServer-6.2.0-guest_ja.pdf
蛇足ではありますが、試行錯誤して、分かったことを以下に示します。
https://www.citrix.com/downloads/xenserver/product-software/xenserver-62.html
で以下を選択して、
「XenServer 6.2.0 Demo Linux Virtual Appliance」
以下のファイルをDLしました。
XenServer-6.2.0-dlvm.xva
以下のようなVMが構築できました。
Citrix Demonstration Linux Virtual Machine
以下を選択して、
「XenServer 6.2.0 Service Pack 1」
以下のファイルをDLしました。
XS62ESP1.zip
以下のファイル出てきましたが、更新できませんでした。ライセンスの関係でしょう。
XS62E001.xsupdate
https://www.citrix.com/downloads/licensing/license-server.html
で以下を選択して、
「License Server VPX - Version 11.10」
以下のファイルをDLしました。
Citrix_License_Server_VPX_v11.10.0_Build_12002.xva
以下のようなVMが構築できました。ライセンスサーバーがVMとして提供されている様です。
Citrix License Server Virtual Appliance
http://gihyo.jp/admin/feature/01/virtualize2010/0003
XenServer6.2用の「Linux Supplemental Packs」は以下のDLサイトには有りません。
https://www.citrix.com/downloads/xenserver/product-software/xenserver-62.html
色々調べると、「The Linux supplemental pack has been removed, 」と言う記述が以下のサイトにありました。「Linux Supplemental Packs」は最新版では削除された様です。
http://blogs.citrix.com/2011/09/30/xenserver-6-0-is-here/
XenServer6.0では「Linux Supplemental Packs」無しでも、Linuxのインストールの実績が有る様です。
http://www.ospn.jp/press/20111018useit-oss-xenserver-2.html
http://www.ospn.jp/press/20111220useit-oss-xenserver.html
以下のマニュアルに寄れば、コマンドラインでディスクからインストール可能の様です。でも、GUI(XenCenter)の方が良いですよね。GUIでの方法を探します。
仮想マシンユーザーガイド - XenServer 6.2.0
http://support.citrix.com/servlet/KbServlet/download/35784-102-706187/XenServer-6.2.0-guest_ja.pdf
蛇足ではありますが、試行錯誤して、分かったことを以下に示します。
https://www.citrix.com/downloads/xenserver/product-software/xenserver-62.html
で以下を選択して、
「XenServer 6.2.0 Demo Linux Virtual Appliance」
以下のファイルをDLしました。
XenServer-6.2.0-dlvm.xva
以下のようなVMが構築できました。
Citrix Demonstration Linux Virtual Machine
以下を選択して、
「XenServer 6.2.0 Service Pack 1」
以下のファイルをDLしました。
XS62ESP1.zip
以下のファイル出てきましたが、更新できませんでした。ライセンスの関係でしょう。
XS62E001.xsupdate
https://www.citrix.com/downloads/licensing/license-server.html
で以下を選択して、
「License Server VPX - Version 11.10」
以下のファイルをDLしました。
Citrix_License_Server_VPX_v11.10.0_Build_12002.xva
以下のようなVMが構築できました。ライセンスサーバーがVMとして提供されている様です。
Citrix License Server Virtual Appliance
XenServer その3 ― 2014/02/09 12:44
Windowsはインストール出来たのですが、Linuxは出来ません。ISOファイルのURLを指定しましたが、同じ様なエラーが出ました。
The bootloader for this VM returned an error -- did the VM installation succeed? INVALID_SOURCE
Unable to access a required file in the specified repository:
http://isoredirect.centos.org/centos/6/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso/images/xen/vmlinuz
以下に日本語の説明書が有りますので、色々読んでみます。
http://support.citrix.com/product/xens/v6.2.0/doc/?lang=ja
http://www.citrix.co.jp/products/self_setupguide.html
The bootloader for this VM returned an error -- did the VM installation succeed? INVALID_SOURCE
Unable to access a required file in the specified repository:
http://isoredirect.centos.org/centos/6/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso/images/xen/vmlinuz
以下に日本語の説明書が有りますので、色々読んでみます。
http://support.citrix.com/product/xens/v6.2.0/doc/?lang=ja
http://www.citrix.co.jp/products/self_setupguide.html
XenServer その2 ― 2014/02/08 23:08
再度XenServerに挑戦しております。
http://support.citrix.com/servlet/KbServlet/download/35781-102-706184/XenServer-6.2.0-QuickStartGuide_BasicVersion_ja.pdf
これに従ってVMを作ってみました。Windows 8.1 proは成功したのですが、linux系は以下のようなエラーが出て失敗します。
The bootloader for this VM returned an error -- did the VM installation succeed? INVALID_SOURCE
Unable to access a required file in the specified repository: file:///tmp/cdrom-repo-N5N7v/images/xen/vmlinuz
皆さん苦労しているようです。何が原因なのでしょう。書籍を購入しないと駄目なのでしょうか。
http://discussions.citrix.com/topic/237726-unable-to-install-linux-guest/
http://support.citrix.com/servlet/KbServlet/download/35781-102-706184/XenServer-6.2.0-QuickStartGuide_BasicVersion_ja.pdf
これに従ってVMを作ってみました。Windows 8.1 proは成功したのですが、linux系は以下のようなエラーが出て失敗します。
The bootloader for this VM returned an error -- did the VM installation succeed? INVALID_SOURCE
Unable to access a required file in the specified repository: file:///tmp/cdrom-repo-N5N7v/images/xen/vmlinuz
皆さん苦労しているようです。何が原因なのでしょう。書籍を購入しないと駄目なのでしょうか。
http://discussions.citrix.com/topic/237726-unable-to-install-linux-guest/
エラー番号: -2144108526 0x80338012 ― 2014/02/06 13:26

以下に従って、Hyper-Vのクライアントの設定をしておりますが、息詰まりました。
http://ascii.jp/elem/000/000/850/850959/index-2.html
以下のようなエラーが発生してサーバーに接続できません。調べ対策すると接続できるのかもしれませんが、そんなに使う予定はないので、これ以上はやめておくつもりです。これを確かめるためにもノートパソコンを購入したのですが。 (^^;
それにしてもHyper-Vクライアントの設定は面倒ですね。
C:\Windows\system32>winrm set winrm/config/client @{TrustedHosts="hyper01"}
WSManFault
Message = クライアントは、要求で指定された接続先に接続できません。 接続先の
サービスが実行されていて、要求を受け付けられる状態であることを確認してください。
接続先で実行されている WS-Management サービス (通常は IIS または WinRM) に関す
るログとドキュメントを参照してください。 接続先が WinRM サービスの場合は、リモー
ト ホスト上で次のコマンドを実行して、WinRM サービスを分析および構成してください:
"winrm quickconfig"
エラー番号: -2144108526 0x80338012
クライアントは、要求で指定された接続先に接続できません。 接続先のサービスが実行
されていて、要求を受け付けられる状態であることを確認してください。 接続先で実行
されている WS-Management サービス (通常は IIS または WinRM) に関するログとドキュ
メントを参照してください。 接続先が WinRM サービスの場合は、リモート ホスト上で
次のコマンドを実行して、WinRM サービスを分析および構成してください: "winrm quick
config"
http://ascii.jp/elem/000/000/850/850959/index-2.html
以下のようなエラーが発生してサーバーに接続できません。調べ対策すると接続できるのかもしれませんが、そんなに使う予定はないので、これ以上はやめておくつもりです。これを確かめるためにもノートパソコンを購入したのですが。 (^^;
それにしてもHyper-Vクライアントの設定は面倒ですね。
C:\Windows\system32>winrm set winrm/config/client @{TrustedHosts="hyper01"}
WSManFault
Message = クライアントは、要求で指定された接続先に接続できません。 接続先の
サービスが実行されていて、要求を受け付けられる状態であることを確認してください。
接続先で実行されている WS-Management サービス (通常は IIS または WinRM) に関す
るログとドキュメントを参照してください。 接続先が WinRM サービスの場合は、リモー
ト ホスト上で次のコマンドを実行して、WinRM サービスを分析および構成してください:
"winrm quickconfig"
エラー番号: -2144108526 0x80338012
クライアントは、要求で指定された接続先に接続できません。 接続先のサービスが実行
されていて、要求を受け付けられる状態であることを確認してください。 接続先で実行
されている WS-Management サービス (通常は IIS または WinRM) に関するログとドキュ
メントを参照してください。 接続先が WinRM サービスの場合は、リモート ホスト上で
次のコマンドを実行して、WinRM サービスを分析および構成してください: "winrm quick
config"
cpuminer ― 2014/02/01 13:40
今度はcpuminerを試してみました。以下のサイトの通りです。
http://satok.asablo.jp/blog/2014/01/07/7179764
ログは以下の通りです。
ll minerd
-rwxr-xr-x. 1 root root 290095 Feb 1 13:37 minerd
./minerd -a scrypt -o stratum+tcp://ltc.2chpool.com:3333 -u user_id.worker_id -p worker_password
[2014-02-01 13:38:28] Binding thread 0 to cpu 0
[2014-02-01 13:38:28] Starting Stratum on stratum+tcp://ltc.2chpool.com:3333
[2014-02-01 13:38:28] 2 miner threads started, using 'scrypt' algorithm.
[2014-02-01 13:38:28] Binding thread 1 to cpu 1
[2014-02-01 13:38:29] Stratum detected new block
[2014-02-01 13:38:30] thread 1: 4104 hashes, 6.95 khash/s
[2014-02-01 13:38:30] thread 0: 4104 hashes, 6.92 khash/s
[2014-02-01 13:39:08] thread 0: 265224 hashes, 6.97 khash/s
[2014-02-01 13:39:08] accepted: 1/1 (100.00%), 13.92 khash/s (yay!!!)
[2014-02-01 13:39:30] thread 1: 417048 hashes, 6.98 khash/s
[2014-02-01 13:39:55] thread 1: 179616 hashes, 6.99 khash/s
[2014-02-01 13:39:55] accepted: 2/2 (100.00%), 13.95 khash/s (yay!!!)
http://satok.asablo.jp/blog/2014/01/07/7179764
ログは以下の通りです。
ll minerd
-rwxr-xr-x. 1 root root 290095 Feb 1 13:37 minerd
./minerd -a scrypt -o stratum+tcp://ltc.2chpool.com:3333 -u user_id.worker_id -p worker_password
[2014-02-01 13:38:28] Binding thread 0 to cpu 0
[2014-02-01 13:38:28] Starting Stratum on stratum+tcp://ltc.2chpool.com:3333
[2014-02-01 13:38:28] 2 miner threads started, using 'scrypt' algorithm.
[2014-02-01 13:38:28] Binding thread 1 to cpu 1
[2014-02-01 13:38:29] Stratum detected new block
[2014-02-01 13:38:30] thread 1: 4104 hashes, 6.95 khash/s
[2014-02-01 13:38:30] thread 0: 4104 hashes, 6.92 khash/s
[2014-02-01 13:39:08] thread 0: 265224 hashes, 6.97 khash/s
[2014-02-01 13:39:08] accepted: 1/1 (100.00%), 13.92 khash/s (yay!!!)
[2014-02-01 13:39:30] thread 1: 417048 hashes, 6.98 khash/s
[2014-02-01 13:39:55] thread 1: 179616 hashes, 6.99 khash/s
[2014-02-01 13:39:55] accepted: 2/2 (100.00%), 13.95 khash/s (yay!!!)
CUDA & Litecoin ― 2014/02/01 12:04
CentOS6.5をインストールして、早速CUDAをインストールしてみました。手順は基本以下のサイトを参考にしました。初期状態が違う為か微妙に異なってはいます。全てrootで作業しました。「init 3」は実行しませんでしたが、大丈夫の様です。
http://www.softek.co.jp/SPG/Pgi/TIPS/public/accel/cuda55_install.html
以下に示す通り、CentOSをインストールしただけではNVIDIAのドライバーは入っていません。
ll /dev/*nv*
crw-r-----. 1 root kmem 10, 144 Jan 31 21:18 /dev/nvram
lspci | grep -i nVidia
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
uname -a
Linux localhost.localdomain 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
以下のサイトから「cuda-repo-rhel6-5.5-0.x86_64.rpm」をDL。
https://developer.nvidia.com/cuda-downloads
ll cuda-repo-rhel6-5.5-0.x86_64.rpm
-rw-rw-r--. 1 root root 2276 Jan 31 21:41 cuda-repo-rhel6-5.5-0.x86_64.rpm
rpm --install cuda-repo-rhel6-5.5-0.x86_64.rpm
ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Vault.repo mirrors-rpmforge-extras
CentOS-Debuginfo.repo cuda.repo mirrors-rpmforge-testing
CentOS-Media.repo mirrors-rpmforge rpmforge.repo
yum clean expire-cache
yum install cuda
yum install gcc-c++
これでインストールは終了です。この後環境変数を変更します。
vi .bashrc
(前略)
export PATH=/usr/local/cuda-5.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:/lib:$LD_LIBRARY_PATH
:wq
サンプルプログラムを作成します。
vi test.c
main()
{printf("hello\n");}
:wq
which nvcc
/usr/local/cuda-5.5/bin/nvcc
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Wed_Jul_17_18:36:13_PDT_2013
Cuda compilation tools, release 5.5, V5.5.0
nvcc test.c
test.c: In function ‘main’:
test.c:3: warning: incompatible implicit declaration of built-in function ‘printf’
./a.out
hello
ldd a.out
linux-vdso.so.1 => (0x00007fff13ece000)
librt.so.1 => /lib64/librt.so.1 (0x0000003e35400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e35000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003e34800000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003e41800000)
libm.so.6 => /lib64/libm.so.6 (0x0000003e35800000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003e3fc00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003e34c00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003e34400000)
インストールは成功したのではないでしょうか、リブート後に以下のファイルが出来ています。GPUが使えるようになりました。
ll /dev/*nv*
crw-rw-rw-. 1 root root 195, 0 Feb 1 10:48 /dev/nvidia0
crw-rw-rw-. 1 root root 195, 255 Feb 1 10:48 /dev/nvidiactl
crw-r-----. 1 root kmem 10, 144 Feb 1 10:46 /dev/nvram
CUDAの次はGPUを使うLItecoinの採掘をしてみました。以下の記事を参考にしております。LD_LIBRARY_PATH 部分は既に設定済みなので必要ないです。
http://satok.asablo.jp/blog/2014/01/05/7178376
コンパイルに成功しました、採掘可能な様です。
ll cudaminer
-rwxr-xr-x. 1 root root 10597092 Feb 1 11:46 cudaminer
./cudaminer -d 0 -i 0 --benchmark
*** CudaMiner for nVidia GPUs by Christian Buchner ***
This is version 2014-01-20 (beta)
based on pooler-cpuminer 2.3.2 (c) 2010 Jeff Garzik, 2012 pooler
Cuda additions Copyright 2013,2014 Christian Buchner
My donation address: LKS1WDKGED647msBQfLBHV3Ls8sveGncnm
[2014-02-01 11:47:23] 1 miner threads started, using 'scrypt' algorithm.
[2014-02-01 11:47:38] GPU #0: GeForce GTX 650 with compute capability 3.0
[2014-02-01 11:47:38] GPU #0: interactive: 0, tex-cache: 0 , single-alloc: 0
[2014-02-01 11:47:38] GPU #0: 8 hashes / 1.0 MB per warp.
[2014-02-01 11:47:38] GPU #0: Performing auto-tuning (Patience...)
[2014-02-01 11:47:38] GPU #0: maximum total warps (BxW): 948
^C
採掘に成功しましたログは以下の通りです。
./cudaminer -o stratum+tcp://ltc.2chpool.com:3333 -u user_id.worker_id -p worker_password
*** CudaMiner for nVidia GPUs by Christian Buchner ***
This is version 2014-01-20 (beta)
based on pooler-cpuminer 2.3.2 (c) 2010 Jeff Garzik, 2012 pooler
Cuda additions Copyright 2013,2014 Christian Buchner
My donation address: LKS1WDKGED647msBQfLBHV3Ls8sveGncnm
[2014-02-01 11:51:39] 1 miner threads started, using 'scrypt' algorithm.
[2014-02-01 11:51:39] Starting Stratum on stratum+tcp://ltc.2chpool.com:3333
[2014-02-01 11:51:39] Stratum detected new block
[2014-02-01 11:51:40] GPU #0: GeForce GTX 650 with compute capability 3.0
[2014-02-01 11:51:40] GPU #0: interactive: 1, tex-cache: 0 , single-alloc: 0
[2014-02-01 11:51:40] GPU #0: 8 hashes / 1.0 MB per warp.
[2014-02-01 11:51:40] GPU #0: Performing auto-tuning (Patience...)
[2014-02-01 11:51:40] GPU #0: maximum total warps (BxW): 951
[2014-02-01 11:51:47] GPU #0: 20469.36 hash/s with configuration K4x32
[2014-02-01 11:51:47] GPU #0: using launch configuration K4x32
[2014-02-01 11:51:47] GPU #0: GeForce GTX 650, 67.23 khash/s
[2014-02-01 11:51:55] Stratum detected new block
[2014-02-01 11:51:55] GPU #0: GeForce GTX 650, 75.59 khash/s
[2014-02-01 11:52:31] GPU #0: GeForce GTX 650, 75.67 khash/s
[2014-02-01 11:52:31] accepted: 1/1 (100.00%), 75.67 khash/s (yay!!!)
[2014-02-01 11:52:35] Stratum detected new block
[2014-02-01 11:52:35] GPU #0: GeForce GTX 650, 75.12 khash/s
[2014-02-01 11:52:53] GPU #0: GeForce GTX 650, 75.60 khash/s
[2014-02-01 11:52:54] accepted: 2/2 (100.00%), 75.60 khash/s (yay!!!)
[2014-02-01 11:53:41] GPU #0: GeForce GTX 650, 75.67 khash/s
[2014-02-01 11:53:41] accepted: 3/3 (100.00%), 75.67 khash/s (yay!!!)
[2014-02-01 11:53:55] GPU #0: GeForce GTX 650, 75.56 khash/s
[2014-02-01 11:53:55] accepted: 4/4 (100.00%), 75.56 khash/s (yay!!!)
[2014-02-01 11:54:26] GPU #0: GeForce GTX 650, 75.66 khash/s
[2014-02-01 11:54:26] accepted: 5/5 (100.00%), 75.66 khash/s (yay!!!)
http://www.softek.co.jp/SPG/Pgi/TIPS/public/accel/cuda55_install.html
以下に示す通り、CentOSをインストールしただけではNVIDIAのドライバーは入っていません。
ll /dev/*nv*
crw-r-----. 1 root kmem 10, 144 Jan 31 21:18 /dev/nvram
lspci | grep -i nVidia
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
uname -a
Linux localhost.localdomain 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
以下のサイトから「cuda-repo-rhel6-5.5-0.x86_64.rpm」をDL。
https://developer.nvidia.com/cuda-downloads
ll cuda-repo-rhel6-5.5-0.x86_64.rpm
-rw-rw-r--. 1 root root 2276 Jan 31 21:41 cuda-repo-rhel6-5.5-0.x86_64.rpm
rpm --install cuda-repo-rhel6-5.5-0.x86_64.rpm
ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Vault.repo mirrors-rpmforge-extras
CentOS-Debuginfo.repo cuda.repo mirrors-rpmforge-testing
CentOS-Media.repo mirrors-rpmforge rpmforge.repo
yum clean expire-cache
yum install cuda
yum install gcc-c++
これでインストールは終了です。この後環境変数を変更します。
vi .bashrc
(前略)
export PATH=/usr/local/cuda-5.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:/lib:$LD_LIBRARY_PATH
:wq
サンプルプログラムを作成します。
vi test.c
main()
{printf("hello\n");}
:wq
which nvcc
/usr/local/cuda-5.5/bin/nvcc
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Wed_Jul_17_18:36:13_PDT_2013
Cuda compilation tools, release 5.5, V5.5.0
nvcc test.c
test.c: In function ‘main’:
test.c:3: warning: incompatible implicit declaration of built-in function ‘printf’
./a.out
hello
ldd a.out
linux-vdso.so.1 => (0x00007fff13ece000)
librt.so.1 => /lib64/librt.so.1 (0x0000003e35400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e35000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003e34800000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003e41800000)
libm.so.6 => /lib64/libm.so.6 (0x0000003e35800000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003e3fc00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003e34c00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003e34400000)
インストールは成功したのではないでしょうか、リブート後に以下のファイルが出来ています。GPUが使えるようになりました。
ll /dev/*nv*
crw-rw-rw-. 1 root root 195, 0 Feb 1 10:48 /dev/nvidia0
crw-rw-rw-. 1 root root 195, 255 Feb 1 10:48 /dev/nvidiactl
crw-r-----. 1 root kmem 10, 144 Feb 1 10:46 /dev/nvram
CUDAの次はGPUを使うLItecoinの採掘をしてみました。以下の記事を参考にしております。LD_LIBRARY_PATH 部分は既に設定済みなので必要ないです。
http://satok.asablo.jp/blog/2014/01/05/7178376
コンパイルに成功しました、採掘可能な様です。
ll cudaminer
-rwxr-xr-x. 1 root root 10597092 Feb 1 11:46 cudaminer
./cudaminer -d 0 -i 0 --benchmark
*** CudaMiner for nVidia GPUs by Christian Buchner ***
This is version 2014-01-20 (beta)
based on pooler-cpuminer 2.3.2 (c) 2010 Jeff Garzik, 2012 pooler
Cuda additions Copyright 2013,2014 Christian Buchner
My donation address: LKS1WDKGED647msBQfLBHV3Ls8sveGncnm
[2014-02-01 11:47:23] 1 miner threads started, using 'scrypt' algorithm.
[2014-02-01 11:47:38] GPU #0: GeForce GTX 650 with compute capability 3.0
[2014-02-01 11:47:38] GPU #0: interactive: 0, tex-cache: 0 , single-alloc: 0
[2014-02-01 11:47:38] GPU #0: 8 hashes / 1.0 MB per warp.
[2014-02-01 11:47:38] GPU #0: Performing auto-tuning (Patience...)
[2014-02-01 11:47:38] GPU #0: maximum total warps (BxW): 948
^C
採掘に成功しましたログは以下の通りです。
./cudaminer -o stratum+tcp://ltc.2chpool.com:3333 -u user_id.worker_id -p worker_password
*** CudaMiner for nVidia GPUs by Christian Buchner ***
This is version 2014-01-20 (beta)
based on pooler-cpuminer 2.3.2 (c) 2010 Jeff Garzik, 2012 pooler
Cuda additions Copyright 2013,2014 Christian Buchner
My donation address: LKS1WDKGED647msBQfLBHV3Ls8sveGncnm
[2014-02-01 11:51:39] 1 miner threads started, using 'scrypt' algorithm.
[2014-02-01 11:51:39] Starting Stratum on stratum+tcp://ltc.2chpool.com:3333
[2014-02-01 11:51:39] Stratum detected new block
[2014-02-01 11:51:40] GPU #0: GeForce GTX 650 with compute capability 3.0
[2014-02-01 11:51:40] GPU #0: interactive: 1, tex-cache: 0 , single-alloc: 0
[2014-02-01 11:51:40] GPU #0: 8 hashes / 1.0 MB per warp.
[2014-02-01 11:51:40] GPU #0: Performing auto-tuning (Patience...)
[2014-02-01 11:51:40] GPU #0: maximum total warps (BxW): 951
[2014-02-01 11:51:47] GPU #0: 20469.36 hash/s with configuration K4x32
[2014-02-01 11:51:47] GPU #0: using launch configuration K4x32
[2014-02-01 11:51:47] GPU #0: GeForce GTX 650, 67.23 khash/s
[2014-02-01 11:51:55] Stratum detected new block
[2014-02-01 11:51:55] GPU #0: GeForce GTX 650, 75.59 khash/s
[2014-02-01 11:52:31] GPU #0: GeForce GTX 650, 75.67 khash/s
[2014-02-01 11:52:31] accepted: 1/1 (100.00%), 75.67 khash/s (yay!!!)
[2014-02-01 11:52:35] Stratum detected new block
[2014-02-01 11:52:35] GPU #0: GeForce GTX 650, 75.12 khash/s
[2014-02-01 11:52:53] GPU #0: GeForce GTX 650, 75.60 khash/s
[2014-02-01 11:52:54] accepted: 2/2 (100.00%), 75.60 khash/s (yay!!!)
[2014-02-01 11:53:41] GPU #0: GeForce GTX 650, 75.67 khash/s
[2014-02-01 11:53:41] accepted: 3/3 (100.00%), 75.67 khash/s (yay!!!)
[2014-02-01 11:53:55] GPU #0: GeForce GTX 650, 75.56 khash/s
[2014-02-01 11:53:55] accepted: 4/4 (100.00%), 75.56 khash/s (yay!!!)
[2014-02-01 11:54:26] GPU #0: GeForce GTX 650, 75.66 khash/s
[2014-02-01 11:54:26] accepted: 5/5 (100.00%), 75.66 khash/s (yay!!!)
最近のコメント