LoginSignup
0
0

More than 3 years have passed since last update.

RX480のBIOSをいじったマイニングGPUを復旧し、Tensorflow 2.0で使えるようにする

Last updated at Posted at 2019-12-05

目的

2017年後半〜2018年前半まで暗号通貨ブームが起こってましたね。みんなGPUを買いまくってマイニングするという現象が起こりました。仮想通貨の値段が下がり、儲からないとみんなは売り出しました。安く手に入れるPCのパーツは楽しいがマイニングによるGPUのBIOS変更などよくあるので、最新のドライバーで使えません。本資料はいじったRX480を復旧し、Tensorflow 2.0で使えるようにする検証をしました。

GPUのBIOSをいじったRX480の復旧

1.まずwindows7 環境またはwindows 10でRX480の16.6.2というドライバーをダウンロードして、RX480をwindowsで認識してくれる状態にします。
2.TechPowerUp GPU-ZでGPUの情報を確認する。https://www.techpowerup.com/download/techpowerup-gpu-z/
 これを使うとGPUの正確の情報が見れるし、LookupをクリックするとGPUの情報を表示するページに移動され、ここで、出荷状態のBIOSをダウンロードできるので、ここで取得します。
3.ati-atiflashをダウンロードします。https://www.techpowerup.com/download/ati-atiflash/
 ati-atiflashで取得したBIOSをflashします。
4.動作確認:最新GPUのドライバーをダウンロードし、インストールしてblackscreenにならなければ、オッケになります。
5.4番ではダメだった場合、次のようにします。
 最新GPUのドライバーをダウンロードした後、解凍して、
 computer iconにクリックし、managerを選んで、
 該当のCPUに右クリックし、ドライバーのアップデートを選んで、
 解凍したinfファイルを使って、ドライバーのアップデートする。

CPUのBIOSでPCIe gen3にする

該当のPCIeだけでなく全てのPCIeを gen3にする必要があります。それとPCIe gen2以下のGPUを外すまたは使わないでください。なぜかというと、一番レベルは低いものを使えるために、マザーボードが低いものに調整するのでPCIe gen2とPCIe gen3一緒に使うと、みんなPCIe gen2になるからです。
ROCMはRX 480のPCIe gen2現時点は使えないのでRX 480のPCIe gen3の状態にしたら、動けます。

Tensorflow 2.0で使えるようにROCMをインストール

1.First make sure your system is up to date

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

2.Add the ROCm apt repository

For Debian-based systems like Ubuntu, configure the Debian ROCm repository as follows:

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

nstall

3.Next, update the apt repository list and install the rocm-dkms meta-package:

sudo apt update
sudo apt install rocm-dkms

4.Next set your permissions

Users will need to be in the video group in order to have access to the GPU. As such, you should ensure that your user account is a member of the video group prior to using ROCm. You can find which groups you are a member of with the following command:

groups
To add yourself to the video group you will need the sudo password and can use the following command:

sudo usermod -a -G video $LOGNAME
You may want to ensure that any future users you add to your system are put into the “video” group by default. To do that, you can run the following commands:

echo 'ADD_EXTRA_GROUPS=1' | sudo tee -a /etc/adduser.conf
echo 'EXTRA_GROUPS=video' | sudo tee -a /etc/adduser.conf
Once complete, reboot your system.

5.Test basic ROCm installation

After rebooting the system run the following commands to verify that the ROCm installation was successful. If you see your GPUs listed by both of these commands, you should be ready to go!

/opt/rocm/bin/rocminfo
/opt/rocm/opencl/bin/x86_64/clinfo
Note that, to make running ROCm programs easier, you may wish to put the ROCm binaries in your PATH.

echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64' | sudo tee -a /etc/profile.d/rocm.sh

Tensorflowをインストールする

Tensorflow Installation
First, you’ll need to install the open-source ROCm stack. Details can be found here: https://rocm.github.io/ROCmInstall.html Then, install these other relevant ROCm packages:

sudo apt update
sudo apt install rocm-libs miopen-hip cxlactivitylogger
And finally, install TensorFlow itself (via the Python Package Index):

sudo apt install wget python3-pip
Pip3 install the whl package from PyPI
pip3 install --user tensorflow-rocm

出会ったエラーの解決方法

1.買ったばかりBIOS変更したGPUをマザーボードに組み立て,windowsで最新ドライバーをダウンロードして、インストールするとwindowsのマークは表示した後、ログイン画面が出てくるはずなのに、blackscreenになる
2.買ったばかりBIOS変更したGPUをマザーボードに組み立て、ubuntu 18.0.4でROCMをインストールして、GPUをチェックしたら以下の2つのコマンドは結果が出てきませんでした。
/opt/rocm/bin/rocminfo
/opt/rocm/opencl/bin/x86_64/clinfo
/opt/rocm/bin/rocm-smi -a を実行したら表示されるがvendorなど表示できない

→理由はドライバーがハドーウェアをコントロールできない?じゃないんですか→RX480の復旧が必要です。

3.RX480の復旧をしたが以下のコマンドを実行しても出てこない →PCIeはgen3になってない
/opt/rocm/bin/rocminfo
/opt/rocm/opencl/bin/x86_64/clinfo

4.以下のコマンドを実行して、詳細に表示されるのですが、公式サイトのMinistのtensorflowを実行するとき、memory 10%などというキーワードのエラーが出てくる
/opt/rocm/bin/rocminfo
/opt/rocm/opencl/bin/x86_64/clinfo

公式サイトのMinistでは最近どんどん高いスペックのPCが必要になります。
RAMの容量が少ないとエラーになるので、4Gではダメで、12GBにしないと実行できません。

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