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?

ROCMm

Last updated at Posted at 2025-11-24

インストールガイド

プレリリース版はindexを指定してaddする

uv add torch torchvision --index pytorch_nightly=https://download.pytorch.org/whl/nightly/rocm7.1

pyproject.tomlには以下の設定が反映される

pyproject.toml
[project]
name = "localcolab"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"

dependencies = [
    "torch",
    "torchvision",
    "torchinfo",
    "transformers",
    "matplotlib>=3.9.0",
    "japanize-matplotlib>=1.1.3",
    "numpy>=2.3.5",
]

[[tool.uv.index]]
name = "pytorch_nightly"
url = "https://download.pytorch.org/whl/nightly/rocm7.1"

[tool.uv.sources]
torch = { index = "pytorch_nightly" }
torchvision = { index = "pytorch_nightly" }

正規版はそのままadd

uv add torchinfo transformers matplotlib japanize-matplotlib numpy

################################################

以下はうまく動作しなかったが、メモとして残す

################################################

pytorchは、stableだとrocm7.1に対応していないため、以下のコマンドでインストールする

pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm7.1

uvでは以下の通り

uv add torch torchvision --pre --index-url https://download.pytorch.org/whl/nightly/rocm7.1

transformersもインストールする場合、バージョンをtorchに合わせる事

uv add transformers --pre --index-url https://download.pytorch.org/whl/nightly/rocm7.1

sync

①プレリリース版のインストール元をproject.tomlに記載する

project.toml
[tool.uv]
# PyTorch nightly ROCm のパッケージサーバを常に有効化
index-url = "https://download.pytorch.org/whl/nightly/rocm7.1"

②プレリリースを許可する(project.tomlに記載できないため、以下のいずれかで対応)

# コマンドラインで指定
uv sync --prerelease allow
.bashrc
# 環境変数で指定(.bashrcに記述)
export UV_PRERELEASE=allow

留意点

事前に以下のパッケージをインストールするとエラーになる(インストール不可)

sudo apt install environment-modules
update-alternatives: エラー: alternative path /lib/rocmmod doesn't exist
dpkg: パッケージ rocm-core の処理中にエラーが発生しました (--configure):
 installed rocm-core package post-installation script subprocess returned error exit status 2
libc6-x32 (2.39-0ubuntu8.6) を設定しています ...
libxnvctrl0:amd64 (510.47.03-0ubuntu4) を設定しています ...
libfile-copy-recursive-perl (0.45-4) を設定しています ...
dpkg: 依存関係の問題により rocm-device-libs の設定ができません:
 rocm-device-libs は以下に依存 (depends) します: rocm-core ...しかし:
  パッケージ rocm-core はまだ設定されていません。
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?