LoginSignup
1
1

More than 5 years have passed since last update.

AMD社製GPUを用いたTensorFlow環境構築~サンプル動作(失敗)

Last updated at Posted at 2019-02-08

はじめに

AMD GPUを用いてTensorflowのサンプル動作するまでの過程を記載します。
マイニングマシンからの転用でROCmを用いたTensorFlow環境を構築できるか試してみます。
本構成ではPCIeの必要要件を満たせておらず、実現できませんでした。
別途、必要要件を満たしたシステムを用いて試そうと思います。

構成

CPU: Intel J1900
GPU: Radeon Vega 56
Ubuntu : 18.04 LTS(Kernel 4.15)
ROCm Version: 2.1

Ubuntuの導入

ダウンロードしたUbuntu(今回は18.04)のISOイメージをRufus等でUSBメモリに書き込み、
インストールメディアを作成します。その後USBから起動しローカルディスクへインストールします。

ROCmの導入

公式GitHubのUbuntu Supportを参照しながら以下コマンドを実行しました。

・システムを最新状態にし、再起動

sudo apt update
sudo apt dist-upgrade
sudo apt install libnuma-dev
sudo reboot

・aptリポジトリにROCmを追加

wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list

・aptリポジトリの更新と rocm-dkmsのインストール

sudo apt update
sudo apt install rocm-dkms

・ユーザー権限の設定

sudo usermod -a -G video $LOGNAME 

・システム再起動後、ROCmのインストールが正しく完了したかの確認

/opt/rocm/bin/rocminfo 
/opt/rocm/opencl/bin/x86_64/clinfo 

・実行すると以下のエラー

$/opt/rocm/bin/rocminfo 
hsa api call failure at line 900, file: /home/jenkins/jenkins-root/workspace/compute-rocm-rel-2,1/rocminfo/rocminfo.cc. Call returned 4104


調べてみるとLinuxカーネルバージョンの問題等の可能性があったため、
システムのバージョンを確認

$ sudo uname -a
Linux user 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


ROCm GitHub内のシステム要件を確認

Ubuntu 16.04.x and 18.04.x (Version 16.04.3 and newer or kernels 4.13 and newer)

Vega56のコードネームはVega 10のため以下が該当

4.17: Fiji, Polaris 10, Polaris 11
4.18: Fiji, Polaris 10, Polaris 11, Vega10
4.20: Fiji, Polaris 10, Polaris 11, Vega10, Vega 7nm

ちゃんと満たしてました。
ほかに何が要因かとREADMEを眺めていたら、
CPUの必要要件がPCIe 3.0以降とのことでした。
今回使用していたCPUはCeleron J1900のため2.0しか対応していませんでした。

以下記載もありました。
PCIe 2.0でも一部CPUでは限定的に対応しているようですが、
Celeronは無理そうです。

ROCm 2.1.x should support PCIe 2.0 enabled CPUs such as the AMD Opteron, Phenom, Phenom II, Athlon, Athlon X2, Athlon II and older Intel Xeon and Intel Core Architecture and Pentium CPUs.

まとめ

今回使用したシステムではHW要件を満たせておらず動作ができませんでしたが、
別途、必要要件を満たしたシステムを用いて試そうと思います。

1
1
0

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
1
1