2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ryzen AI Max+ 395 (Radeon 8060S) と Radeon AI PRO R9700 で ROCm 6.4.4 と 7.1.1 の環境構築

2
Last updated at Posted at 2026-01-03

はじめに

Ryzen AI Max+ 395 (Radeon 8060S) および Radeon AI PRO R9700を対象としたROCmの環境構築方法について説明する。技術記事やLLMで出てくる内容については、具体的な方法は省略している。基本的に以下の公式ページに基づく。

BIOS (UEFI)

  • VRAMに64GBまたは96GBを割り当てる(Ryzen AI Max+ 395)
  • セキュアブートを無効化する

OSのインストール

  • OSはUbuntu 24.04.3 LTS をインストール

  • (Ryzen AI Max+ 395) OEMカーネルのインストール

     sudo apt install linux-oem-24.04c
     sudo reboot
     uname -r # 6.14.0-1016-oem
    

Radeon ドライバ + ROCm のインストール

ROCmのメジャーバージョンである6系と7系をUbuntuで共存させる方法についてまとめる。以下の公式ドキュメントに書かれている通りなので、わざわざ記事にするほどでもないが、一応メモしておく。

動機としては次のとおりである。Ryzen AI Max+ 395 (Strix Halo) は、ROCm 6.4系でDeveloper Previewであるのに対して、ROCm 7.1.1で正式にサポートされるようになった。一方、ROCm 7.1.1ではONNX runtime の ROCMExecutionProvider がサポートされなくなり、MIGraphXExecutionProvider に一本化されるという大きな変更がある。またPyTorchも7系への対応はまだnightlyという位置づけである。そのため両方のバージョンを利用できる環境が望ましい。

0. 古いドライバとROCmの削除

古いドライバとROCmが入っている場合は一旦削除し再起動。

sudo amdgpu-install --uninstall --rocmrelease=all
sudo reboot

古い設定を削除

sudo rm -f /etc/apt/sources.list.d/rocm.list
sudo rm -f /etc/apt/sources.list.d/amdgpu*.list

1. ドライバのインストール

GPUのドライバ自体は複数バージョンを共存させることはできない。ここでは新しい7.1.1を入れる。

sudo apt update
wget https://repo.radeon.com/amdgpu-install/7.1.1/ubuntu/noble/amdgpu-install_7.1.1.70101-1_all.deb
sudo apt install -y ./amdgpu-install_7.1.1.70101-1_all.deb

再インストールする場合

Configuration file '/etc/apt/sources.list.d/amdgpu.list' ==> Deleted (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** amdgpu.list (Y/I/N/O/D/Z) [default=N] ?

とか聞かれることがあるのでYを選択する。

ここではROCmを入れずドライバ側(graphics)のみ導入し、再起動する。

sudo apt update
sudo amdgpu-install -y --usecase=graphics
sudo reboot

2. ROCmのインストール

APTリポジトリを登録して2つのバージョンをインストールする。

sudo tee /etc/apt/sources.list.d/rocm.list > /dev/null <<'EOF'
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.1.1 noble main
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.4.4 noble main
EOF

sudo tee /etc/apt/preferences.d/rocm-pin-600 > /dev/null <<'EOF'
Package: *
Pin: release o=repo.radeon.com
Pin-Priority: 600
EOF

sudo apt update
sudo apt install -y rocm7.1.1 rocm6.4.4

3. 実行時のバージョン切り替え

実行時に使用したいバージョンのROCmにパスを通すことで切り替えることができる。

export ROCM_VER=7.1.1   # または 6.4.4
export PATH=/opt/rocm-${ROCM_VER}/bin:$PATH
export LD_LIBRARY_PATH=/opt/rocm-${ROCM_VER}/lib:${LD_LIBRARY_PATH}
export PYTHONPATH=/opt/rocm-${ROCM_VER}/share/amd_smi:${PYTHONPATH:-} # 必要に応じて

そのほかの設定(トラブルシューティング)

(Ryzen AI Max+ 395) 環境変数の設定

後でAI気象モデルを実行する際に、以下のGPUの型番を偽装してROCmに認識させる設定をしないとエラーになる。忘れないように.bashrcに追記しておくとよい。

export HSA_OVERRIDE_GFX_VERSION=11.0.0

(Ryzen AI Max+ 395) Memory access fault 問題

推論を実行していると、

Memory access fault by GPU node-1 (Agent handle: 0x1e3dc380) on address 0x7447423f6000. Reason: Page not present or supervisor privilege.

のようなエラーが出て実行が終了することがある。一度この状態になると、segfaultが発生しROCmの実行ができなくなる1dmesg | tail -n 5等でログを見ると、以下のようになっている。

[ 1124.212345] ai-models[2055]: segfault at 18 ip 00007c52999a4e52 sp 00007ffc2d559ae0 error 4 in libamdhip64.so.6.4.60404[3a4e52,7c5299626000+3f2000] likely on CPU 6 (core 6, socket 0) [ 1124.212357] Code: 39 e5 74 18 0f 1f 40 00 48 8b 7d 00 31 f6 48 83 c5 08 e8 d1 04 00 00 49 39 ec 75 ec 48 8b 83 88 00 00 00 4c 8b a0 e0 00 00 00 <49> 8b 7c 24 18 49 8d 44 24 18 48 89 04 24 48 8b 07 ff 50 18 48 8b

この問題はLLMの推論でも発生することがすでに報告されており、回避策としてLinuxカーネルのブートパラメーターにamdgpu.cwsr_enable=0を指定すれば良いことがわかっている。

具体的には以下のようにする。

sudo nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULTのダブルクォート内にパラメータを追記する。

GRUB_CMDLINE_LINUX_DEFAULT="amdgpu.cwsr_enable=0"

反映後、再起動する。

sudo update-grub
sudo reboot

今のところ私の環境では、設定後にこの問題は再発していない。

(R9700) GPUが正常に認識されない

R9700が正常に認識されていない模様。そのためシロッコファンが100%で回ってとてもうるさい。rocm-smiでも温度などが取れていない。

$ rocm-smi


Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
Expected integer value from monitor, but got ""
======================================== ROCm System Management Interface ========================================
================================================== Concise Info ==================================================
Device  Node  IDs              Temp    Power  Partitions          SCLK  MCLK  Fan  Perf     PwrCap  VRAM%  GPU%
              (DID,     GUID)  (Edge)  (Avg)  (Mem, Compute, ID)
==================================================================================================================
0       1     0x7551,   40901  N/A     N/A    N/A, N/A, 0         N/A   N/A   0%   unknown  N/A     1%     0%
==================================================================================================================
============================================== End of ROCm SMI Log ===============================================

Geminiに聞いたところ、以下のログから『GPUの「省電力モード(Runtime PM)からの復帰」に失敗し、SMU(電源管理ユニット)がクラッシュしています。』と判断。

$ sudo dmesg | grep -i amdgpu
(略)
[ 122.230454] amdgpu 0000:04:00.0: amdgpu: resume of IP block <smu> failed -62

解決方法は、Runtime PM(動的電源管理)の無効化。「GPUが勝手にスリープしないように、カーネルパラメータを設定します。これは計算用GPU(ROCm用途)では安定動作のために推奨される設定です。」らしい。

sudo nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULTamdgpu.runpm=0を追記。初期が空文字""の場合は以下のように変更する。

GRUB_CMDLINE_LINUX_DEFAULT="amdgpu.runpm=0"

設定を反映して再起動する。

sudo update-grub
sudo reboot
  1. この状態になった後に復旧させる手順がよくわからない。キャッシュの削除(rm -rf ~/.cache/miopen)・ドライバ再インストール(sudo amdgpu-uninstallsudo amdgpu-install -y --usecase=graphics,rocm)・カーネルの再インストール(sudo apt install linux-oem-24.04c)を試して何度か再起動しているうちに直ったが、どれが決め手だったか不明。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?