LoginSignup
1
0

More than 3 years have passed since last update.

ROCm-Pytorch-Dockerの環境構築

Last updated at Posted at 2019-09-03

docker,ROCm環境はすでに構築済みと仮定します

この前に書いたやつと内容はそれほど変わりません

環境構築

ホストマシン側での下準備

cd ~
mkdir data
cd ./data
git clone https://github.com/pytorch/pytorch.git
cd pytorch
git submodule update --init --recursive

docker imageの用意とDocker run

sudo docker pull rocm/pytorch:rocm2.7_ubuntu16.04_py3.6_pytorch
sudo docker run --name pytroch_rocm -it -v /home/???/data/:/data --privileged --rm --device=/dev/kfd --device=/dev/dri --group-add video rocm/pytorch:rocm2.7_ubuntu16.04_py3.6_pytorch 

???にはユーザーの名前を入れてください、絶対パスで設定しています

Dockerコンテナ内での下準備

ココらへんは頻繁に開発環境を用意するようならdockerfileにまとめていい気がしてますね

apt update
apt install git
apt install nano (vimでもいい)

Dockerコンテナ内でのpytorch build

buildを一々しないと駄目な仕様なので事前に時間のあるときにハイパワーPCでやったほうがいいです。

一応環境変数にexport PYTORCH_ROCM_ARCH=gfx900を追加しておきました
RadeonⅦならgfx906、RX400や500だったらgfx803でいいと思います

cd /data/pytorch
./.jenkins/pytorch/build.sh 

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