0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AMD GPUが使えるAmuseを試す(3、もう一回)

0
Posted at

AMD Ryzen 7 255 w/ Radeon 780M Graphics のミニPCで画像生成AIプログラムAmuseを試しています。v3.3.5-devで上手く行かなかったため、ディレクトリLogsのログファイルを眺めていたのですが、イマイチわかりませんでした。
その後もAmuseは更新されていて、v3.3.6-dev → v3.3.7-dev(TensorStackライブラリが不足していて構築出来ず) → v3.3.8-devになっていますので、v3.3.8-devで追試をします。#自分の忘備録17

Amuse Screenshots v3.3.0-dev

Amuseのダウンロードと構築

AmuseのGitHubからソースをダウンロードして構築してみます。

TensorStack-AI / AmuseAI

いつもの通りCodeをDownload ZIPでダウンロードして構築します。
Amuse.exeを起動して見ます。

(Releaseモードでamusetestにまとめて構築)
cd AmuseAI-master
dotnet build -c Release /p:OutDir=../amusetest/

(Amuse.exe起動)
amusetest\Amuse.exe

実行したら同じスタート画面が出てAmuse v3.3.8-devが起動しました。

amuse_v338-dev_start.png

Loadボタンを押して、python virtual環境(venv)の作成も先に進みました(python3.12ダウンロード、rocm-721インストール)。
次にモデルFLUX.2 Klein 4Bもダウンロードします。ここまでは前回のv3.3.5-devと同じ。
ボタンはLoad→Loading→Readyになっていますが、右のボタンでリセットしてLoadに戻します。

amuse_v338-dev.png

ログファイルとDebugウィンドウの比較

Settingを見ていたら、Experimentalの項目にPipeline Debugのスイッチがあったのでチェックします。

amuse_v338-dev_setting.png

パイプラインステータスが別のウィンドウ(Debugウィンドウ)で表示されるとのことなので、Loadボタンを押してみます。そしたらディレクトリLogsのログファイルでは無かった情報が表示されました。

ディレクトリLogsのログファイルAmuseHost-11-05-2026-*.txtの内容は以下の通り(一部ですが)。

2026-05-11 19:38:03.509 +09:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request.
2026-05-11 19:38:03.513 +09:00 [INF] [PipelineServer] [PipelineChannel] PipelineLoad request received.
2026-05-11 19:38:03.514 +09:00 [INF] [PythonPipeline] [Load] Importing pipeline module 'Flux2KleinPipeline'.
2026-05-11 19:39:25.778 +09:00 [INF] [PythonPipeline] [Load] Loading pipeline.
2026-05-11 19:39:25.931 +09:00 [INF] [PythonPipeline] [PythonRuntime] [07:39:25:914] [Load] Request Device - Device: cuda, DeviceId: 0, PCIBusId: 197
2026-05-11 19:39:25.931 +09:00 [INF] [PythonPipeline] [PythonRuntime] [07:39:25:914] [Load] Found Device - Name: AMD Radeon 780M Graphics, Index: 0, PCIBusId: 197, Arch: gfx1103

その時のDebugウィンドウの内容が以下の通りで、ログファイルとは出力形態は異なりますが、中間の[WARNING]の行からRuntimeError:の行までに、怪しげなメッセージが出ています。

info: Amuse.Host.Program[0]
      [PipelineServer] [PipelineChannel] Waiting for request.
info: Amuse.Host.Program[0]
      [PipelineServer] [PipelineChannel] PipelineLoad request received.
info: Amuse.Host.Program[0]
      [PythonPipeline] [Load] Importing pipeline module 'Flux2KleinPipeline'.
[WARNING] failed to run offload-arch: binary not found.
Could not detect ROCm GPU architecture: [WinError 2] 指定されたファイルが見つかりません。

ROCm GPU architecture detection failed despite ROCm being available.

Could not detect ROCm warp size: [WinError 2] 指定されたファイルが見つかりません。. Defaulting to 64. (some 4-bit functions may not work!)

ROCm warp size detection failed despite ROCm being available.

bitsandbytes library load error: Configured ROCm binary not found at C:\TEST\AmuseAI-master\amusetest\PythonRuntime\Pipelines\.rocm-721\Lib\site-packages\bitsandbytes\libbitsandbytes_rocm72.dll
Traceback (most recent call last):
  File "C:\TEST\AmuseAI-master\amusetest\PythonRuntime\Pipelines\.rocm-721\Lib\site-packages\bitsandbytes\cextension.py", line 320, in <module>
    lib = get_native_library()
          ^^^^^^^^^^^^^^^^^^^^
  File "C:\TEST\AmuseAI-master\amusetest\PythonRuntime\Pipelines\.rocm-721\Lib\site-packages\bitsandbytes\cextension.py", line 288, in get_native_library
    raise RuntimeError(f"Configured {BNB_BACKEND} binary not found at {cuda_binary_path}")
RuntimeError: Configured ROCm binary not found at C:\TEST\AmuseAI-master\amusetest\PythonRuntime\Pipelines\.rocm-721\Lib\site-packages\bitsandbytes\libbitsandbytes_rocm72.dll
info: Amuse.Host.Program[0]
      [PythonPipeline] [Load] Loading pipeline.
info: Amuse.Host.Program[0]
      [PythonPipeline] [PythonRuntime] [07:39:25:914] [Load] Request Device - Device: cuda, DeviceId: 0, PCIBusId: 197
info: Amuse.Host.Program[0]
      [PythonPipeline] [PythonRuntime] [07:39:25:914] [Load] Found Device - Name: AMD Radeon 780M Graphics, Index: 0, PCIBusId: 197, Arch: gfx1103

メッセージの内容は、

  • offload-archというbinaryが見つからない
  • ROCm GPU architecture/ROCm warp sizeが検出出来ないところに、「指定されたファイルが見つかりません。」がある
  • bitsandbytesのROCm binary(libbitsandbytes_rocm72.dll)が見つからなくて例外RuntimeError:

と言う感じの3つの怪しげなエラーメッセージが出ていました。

怪しげなエラーメッセージの解消

"bitsandbytesのROCm binary(libbitsandbytes_rocm72.dll)が見つからなくて例外RuntimeError:" の解消

まず例外RuntimeError:になっているファイルlibbitsandbytes_rocm72.dllですが、ディレクトリAmuseAI-master内には存在していません。
libbitsandbytes_rocm72.dllをインターネット検索してみると、GitHubの0xDELUXA / bitsandbytes_win_rocmに存在していました。

最新版の0.50.0.dev0-py3-rocm7-win_amd64_allのSupported architectures:にはgfx1103(Radeon 780M)が含まれているので、bitsandbytes-0.50.0.dev0-cp312-cp312-win_amd64.whlをダウンロードします。

whlファイルはpythonモジュールファイルですが、ZIPファイル形式なので中を覗くとlibbitsandbytes_rocm72.dllが含まれていました。
試しにlibbitsandbytes_rocm72.dllだけ取り出して、bitsandbytesの格納場所(amusetest\PythonRuntime\Pipelines.rocm-721\Lib\site-packages\bitsandbytes、その他のlibbitsandbytes_*.dllが含まれている)に入れてみました。
そしたら、ROCm binary(libbitsandbytes_rocm72.dll)が見つからない 例外RuntimeError: から 他の例外 になったので、ファイルの格納場所は合っているけど他のファイルとの組み合わせが合わなかったようです。

なので、ダウンロードしたwhlファイルをインストールして見ます。bitsandbytesはpythonのvenvの中にあるので、以下のようにインストールします。

(whlファイルインストール)
amusetest\PythonRuntime\Pipelines\.rocm-721\Scripts\activate.bat
(.rocm-721) pip install C:\Users\user\Downloads\bitsandbytes-0.50.0.dev0-cp312-cp312-win_amd64.whl
deactivate

これにより、RuntimeError:は無くなりました。

"ROCm GPU architecture/ROCm warp sizeが検出出来ないところに、「指定されたファイルが見つかりません。」がある" の解消

次に「ROCm GPU architecture」または「ROCm warp size」の文字列を検索したら、ソース cuda_specs.py の中にあることがわかりました。その中にWindowsのときは hipinfo.exe を使用してGPU情報を取得しているところがありました。
ディレクトリAmuseAI-master内にhipinfo.exeが存在していましたが、そのディレクトリはamusetest\PythonRuntime\Pipelines.rocm-721\Scriptsで、venvディレクトリにありました。
ただ前記のwhlファイルのインストールで、ソース cuda_specs.py が差し替えられて「ROCm warp size」の検出エラー部分は無くなっていました。

ついでに、"offload-archというbinaryが見つからない" の解消ですが、、

offload-arch.exe もディレクトリAmuseAI-master内に存在していました。そのディレクトリはamusetest\PythonRuntime\Pipelines.rocm-721\Scriptsで、hipinfo.exeと同じvenvディレクトリにありました。

hipinfo.exe、offload-arch.exeを実行するときに、venvのパスが通されていないようです。
venvを有効にしてAmuseを起動して見ます。

amusetest\PythonRuntime\Pipelines\.rocm-721\Scripts\activate.bat
amusetest\Amuse.exe

これにより、Loadした時のログファイルAmuseHost-11-05-2026-*.txtとDebugウィンドウの出力内容が、同様になりました。

怪しげなエラーメッセージを解消したAmuse v3.3.8-devを実行

Loadボタンを押して、Promptが有効にして「A cute raccoon playing guitar in the beach」を入力してGenarateボタンを押して画像生成をしてみます。
ありょ~~予期せぬパイプライン終了。。。:worried:

amuse_v338-dev_close-pipeline.png

今回の結果

Amuse v3.3.8-devでも画像生成は、見つかった怪しいメッセージは解消しましたが、予期せぬパイプライン終了となってしまいました。

使用したミニPCの構成は以下の通り。

  • Minisforum AI X1 ミニpc
    • AMD Ryzen 7 255 w/ Radeon 780M Graphics
    • DDR5-5600MHz 64GB
    • SSD 1TB + SSD 1TB追加
    • Windows 11 Pro 25H2

未だにAmuse v3.1.8以外(Amuse v3.1.8より後)のバージョンでの画像生成は上手く行っていません。
ちょっと進んだ感もあるので、引き続き試行錯誤してみようと思います。

今までの経緯

  • AMD GPUが使えるAmuseを試す:リリース版v3.1.8お試し(OK)、この頃ソースから構築したらv3.1.9になっていたが、上手く動かず、
  • AMD GPUが使えるAmuseを試す(2):リリース版v3.2.0お試し(上手く行かず:cold_sweat:)、v3.2.0をソースから構築するも、上手く動かず、、
  • AMD GPUが使えるAmuseを試す(3):v3.3.5-devをソースから構築、雰囲気が変わったが、上手く動かず、、、
  • 今回の、AMD GPUが使えるAmuseを試す(3、もう一回):v3.3.8-devをソースから構築、怪しげなエラーメッセージを解消したが、上手く動かず、、、
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?