🐙
Ryzen AI Max+ 395 マシン (Ubuntu 24.04.3) への ROCm 7.9.0 preview 導入
前の記事で、 AMD Ryzen AI Max+ 395 を積んだMinisforum の MS-S1 MAXというPCに、Ubuntu 24.04.3 をインストールしました。今度は ROCm 7.9.0 preview のインストールです。導入方法は、基本的に AMDのドキュメント ( https://rocm.docs.amd.com/en/7.9.0-preview/index.html ) に従って行いました。PyTorchの導入では、若干の修正が必要でした。
ユーザーのグループ追加
- render, video グループへの帰属を加えます。
$ sudo usermod -a -G render,video ユーザー名
python環境の構築
- python無しの、まっさらな状態から uvでPython仮想環境を構築することにしました。
$ curl -LsSf https://astral.sh/uv/install.sh | sh
- ROCm 7.9.0 用のパスを用意します。
$ mkdir codes
$ cd codes
/codes$ mkdir ROCm790
/codes$ cd ROCm790/
/codes/ROCm790$ uv venv
Using CPython 3.12.3 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
ROCm 7.9.0 preview の環境構築
- gfx1151ではなく、gfx950-dcgpuというパスになっているのが気になりますが、AMDのドキュメント通りに進めます。
- なお、Ubuntu 24.04.3 HWE 用 Driver 25.10.4 のインストールはしていませんし、amdgpu-install コマンドは使用できない状態のままです。
/codes/ROCm790$ uv pip install --index-url https://repo.amd.com/rocm/whl/gfx950-dcgpu/ "rocm[libraries,devel]"
Resolved 4 packages in 1.56s
Built rocm==7.9.0rc1
Prepared 4 packages in 19.38s
Installed 4 packages in 10ms
+ rocm==7.9.0rc1
+ rocm-sdk-core==7.9.0rc1
+ rocm-sdk-devel==7.9.0rc1
+ rocm-sdk-libraries-gfx950-dcgpu==7.9.0rc1
- ROCm 7.9.0 rc1 という表示が出ましたので、preview版がインストールできたとみなして良さそうです。
動作確認
/codes/ROCm790$ uv run rocminfo
ROCk module is loaded
=====================
HSA System Attributes
=====================
Runtime Version: 1.18
Runtime Ext Version: 1.14
(略)
==========
HSA Agents
==========
*******
Agent 1
*******
Name: AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
Uuid: CPU-XX
Marketing Name: AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
Vendor Name: CPU
Feature: None specified
(略)
*******
Agent 2
*******
Name: gfx1151
Uuid: GPU-XX
Marketing Name: AMD Radeon Graphics
Vendor Name: AMD
Feature: KERNEL_DISPATCH
(略)
*******
Agent 3
*******
Name: aie2
Uuid: AIE-XX
Marketing Name: AIE-ML
Vendor Name: AMD
Feature: AGENT_DISPATCH
Profile: BASE_PROFILE
(略)
*** Done ***
- Agent2 に gfx1151という名前が登場しました。有効になっているようです。AIE-MLとして認識されているのは、NPUでしょうね。
/codes/ROCm790$ uv run amd-smi
+------------------------------------------------------------------------------+
| AMD-SMI 26.1.0+b8670bb1 amdgpu version: 6.14.0-33 ROCm version: N/A |
| VBIOS version: 023.011.000.039.000001 |
| Platform: Linux Baremetal |
|-------------------------------------+----------------------------------------|
| BDF GPU-Name | Mem-Uti Temp UEC Power-Usage |
| GPU HIP-ID OAM-ID Partition-Mode | GFX-Uti Fan Mem-Usage |
|=====================================+========================================|
| 0000:f4:00.0 AMD Radeon Graphics | N/A N/A 0 N/A/0 W |
| 0 0 N/A N/A | N/A N/A 458/98304 MB |
+-------------------------------------+----------------------------------------+
+------------------------------------------------------------------------------+
| Processes: |
| GPU PID Process Name GTT_MEM VRAM_MEM MEM_USAGE CU % |
|==============================================================================|
| No running processes found |
+------------------------------------------------------------------------------+
- amd-smi でもBIOSでVRAMとして割り当てたメモリが認識できていることが確認できました。
テスト等
- AMDのドキュメント通りの動作確認です。
/codes/ROCm790$ uv run rocm-sdk targets
gfx950
/codes/ROCm790$ uv run rocm-sdk path --cmake
/home/(略)/codes/ROCm790/.venv/lib/python3.12/site-packages/_rocm_sdk_devel/lib/cmake
/codes/ROCm790$ uv run rocm-sdk path --bin
/home/(略)/codes/ROCm790/.venv/lib/python3.12/site-packages/_rocm_sdk_devel/bin
/codes/ROCm790$ uv run rocm-sdk path --root
/home/(略)/codes/ROCm790/.venv/lib/python3.12/site-packages/_rocm_sdk_devel
/codes/ROCm790$ uv run rocm-sdk test
(略)
Ran 25 tests in 2.032s
OK (skipped=2)
PyTorchの導入
- AMDの説明文書通りでインストールしようとすると、以下のように失敗します。
/codes/ROCm790$ uv pip install --index-url https://repo.amd.com/rocm/whl/gfx1151/ torch torchvision torchaudio
× No solution found when resolving dependencies:
╰─▶ Because torchaudio==2.9.0+rocm7.9.0rc1 has no wheels with a matching platform tag (e.g., `manylinux_2_39_x86_64`) and only torchaudio==2.9.0+rocm7.9.0rc1 is
available, we can conclude that all versions of torchaudio cannot be used.
And because you require torchaudio, we can conclude that your requirements are unsatisfiable.
hint: An index URL (https://repo.amd.com/rocm/whl/gfx1151/) returned a 403 Forbidden error. This could indicate lack of valid authentication credentials, or the
package may not exist on this index.
hint: Wheels are available for `torchaudio` (v2.9.0+rocm7.9.0rc1) on the following platform: `win_amd64`
hint: Pre-releases are available for `torchaudio` in the requested range (e.g., 2.7.1a0+rocm7.9.0rc1), but pre-releases weren't enabled (try: `--prerelease=allow`)
- そこで、prerelease指定をして再度実行してみたら上手く行きました。
/codes/ROCm790$ uv pip install --index-url https://repo.amd.com/rocm/whl/gfx1151/ --prerelease=allow torch torchvision torchaudio
Resolved 18 packages in 3.61s
Prepared 15 packages in 8.97s
Installed 15 packages in 112ms
+ filelock==3.20.0
+ fsspec==2025.9.0
+ jinja2==3.1.6
+ markupsafe==3.0.3
+ mpmath==1.3.0
+ networkx==3.5
+ numpy==2.3.3
+ pillow==11.3.0
+ pytorch-triton-rocm==3.3.1+rocm7.9.0rc1
+ setuptools==80.9.0
+ sympy==1.14.0
+ torch==2.7.1+rocm7.9.0rc1
+ torchaudio==2.7.1a0+rocm7.9.0rc1
+ torchvision==0.22.1+rocm7.9.0rc1
+ typing-extensions==4.15.0
- インストールしたPyTorchの動作確認です。
/codes/ROCm790$ uv run python -c "import torch; print(torch.cuda.is_available())"
True
Comfy UI のインストール
- これもAMDのドキュメント通りです。
/codes/ROCm790$ git clone https://github.com/comfyanonymous/ComfyUI.git
/codes/ROCm790$ uv pip install -r ComfyUI/requirements.txt
/codes/ROCm790$ uv run python ComfyUI/main.py --listen 0.0.0.0
Checkpoint files will always be loaded safely.チェックポイント ファイルは常に安全にロードされます。
Total VRAM 98304 MB, total RAM 31729 MB
pytorch version: 2.7.1+rocm7.9.0rc1
Set: torch.backends.cudnn.enabled = False for better AMD performance.
AMD arch: gfx1151
ROCm version: (7, 1)
Set vram state to: NORMAL_VRAM
Device: cuda:0 AMD Radeon Graphics : native
Using pytorch attention
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
ComfyUI version: 0.3.66
****** User settings have been changed to be stored on the server instead of browser storage. ******
****** For multi-user setups add the --multi-user CLI argument to enable multiple user profiles. ******
ComfyUI frontend version: 1.28.7
[Prompt Server] web root: /home/taka/codes/ROCm790/.venv/lib/python3.12/site-packages/comfyui_frontend_package/static
Import times for custom nodes:
0.0 seconds: /home/taka/codes/ROCm790/ComfyUI/custom_nodes/websocket_image_save.py
Context impl SQLiteImpl.
Will assume non-transactional DDL.
No target revision found.
Starting server
To see the GUI go to: http://0.0.0.0:8188
- AMD arch がgfx1151、ROCm versionが (7, 1)として認識されています。内部の詳しいところまで確認はしていませんが、7.9系はテクノロジープレビュー用の系列ということなので、7.9.0 previewが最終バージョンになるときには7.1系に納まるということなのかもしれません。
Discussion