2011年8月1日月曜日

8/1 Linux + OpenCLの続き 作業ログ

うまくいったような気がしたが、それは嘘だった。
サンプルプログラムのコンパイルは成功しているが、実行ができない。

例)
# cd /usr/global/AMD-APP-SDK-v2.4-lnx64/samples/opencl/bin/x86_64/
# ./HelloCL
HelloCL!
Getting Platform Information
Platform::get() failed (-1001)

エラーです。お疲れ様です。


色々原因を探ってみる。
aticonfigとかamdcccleなど、AMDのドライバ系のツールがある。

# aticonfig --lsa
* 0. 00:01.0 AMD Radeon HD 6300 series Graphics

* - Default adapter

と、なるのでとりあえずAPUは認識されている。
VNC経由で、
# aticonfig --initial
として初期化もやってみる。

しかしうまくいかない。

# amdcccle
は壮大なエラーを吐いて停止する。
何か、AMDのGPUドライバが入ってないとか言われる。マジか。
もう一度インストールしてみた。
その前にrpm-buildもyum installしておく。
(一回これがないためにドライバのビルドが失敗しているよう)

# ./ati-driver-installer-11-7-x86.x86_64.run
今度は「Generate Distribution Specific Driver Package」してみた。
CentOS 5.6 AMD64なので、「RedHat/RHEL5_64a」と「RedHat/RHEL5」を選択。

インストールは成功したが、うまくいかない。
さらに調べたが、/etc/OpenCL/vendorsが悪いみたい。
これがATI系の名前のままだと失敗する。

中身を見るとただのテキストファイルなので、自分で書いたほうがよさそう。

/etc/OpenCL/vendors/amdocl32.icd
中身↓
libamdocl32.so

/etc/OpenCL/vendors/amdocl64.icd
中身↓
libamdocl64.so

こんなやつを作ればOK。
パーミッションはリードオンリーでOK。

ようやく動いた。
たぶんドライバは関係ない。
vendorsが悪い。


ここまで到着するのに3時間くらい消費した。
疲れた。肉食いたい。


成功パターンも一応記載してみる。
# ./HelloCL
HelloCL!
Getting Platform Information
Creating a context AMD platform
Getting device info
Loading and compiling CL source
Running CL program
Done
Passed!

3 件のコメント:

  1. バンド幅ベンチの結果


    $ ./GlobalMemoryBandwidth
    Platform 0 : Advanced Micro Devices, Inc.
    GPU not found. Falling back to CPU device

    Selected Platform Vendor : Advanced Micro Devices, Inc.
    Device 0 : AMD E-350 Processor
    Build Options are : -D DATATYPE=float4

    Global Memory Read
    AccessType : single
    VectorElements : 4
    Bandwidth : 15.6892 GB/s

    Global Memory Read
    AccessType : linear
    VectorElements : 4
    Bandwidth : 14.29 GB/s

    Global Memory Read
    AccessType : linear(uncached)
    VectorElements : 4
    Bandwidth : 13.0191 GB/s

    Global Memory Write
    AccessType : linear
    VectorElements : 4
    Bandwidth : 10.286 GB/s

    返信削除
  2. 何かGPU not foundになっている。ヤバイ。

    返信削除
  3. 解決策が判明。
    http://forums.amd.com/devforum/messageview.cfm?catid=390&threadid=152445&highlight_key=y

    [To make the GPU visible when logging in remotely, I had to export DISPLAY=:0. This solved all of my problems.]
    とのことらしい。

    返信削除