Install Rocm and Torch on Ubuntu

2026-04-26T20:20:18

Install Rocm via pip

pip install --index-url https://rocm.nightlies.amd.com/v2/gfx1151/ "rocm[libraries,devel]"
https://github.com/ROCm/TheRock/blob/main/RELEASES.md#rocm-for-gfx1151

Install Rocm via apt

To find the latest available release:

Step 1: Browse the index pages:
    Debian packages: https://rocm.nightlies.amd.com/deb/
    RPM packages: https://rocm.nightlies.amd.com/rpm/
Step 2: Look for directories in the format YYYYMMDD-<action-run-id> (e.g., 20260310-12345678)
Step 3: Use the latest date in the installation commands below
# Step 1: Find the latest release from https://rocm.nightlies.amd.com/deb/
#         Look for directories like "20260310-12345678"
# Step 2: Look at the "GPU family and package mapping" table above to find
#         the GFX Family for your GPU (e.g., gfx94x, gfx110x, gfx1151)
# Step 3: Set the variables below

export RELEASE_ID=20260310-12345678  # Replace with actual date-runid
export GFX_ARCH=gfx110x              # Replace with GFX Family from the mapping table

# Step 4: Add repository and install
sudo apt update
sudo apt install -y ca-certificates
echo "deb [trusted=yes] https://rocm.nightlies.amd.com/deb/${RELEASE_ID} stable main" \
  | sudo tee /etc/apt/sources.list.d/rocm-nightly.list
sudo apt update
sudo apt install amdrocm-core-sdk-${GFX_ARCH}
# If only runtime is needed, install amdrocm-${GFX_ARCH} instead

Install Torch via pip

pip install --index-url https://rocm.nightlies.amd.com/v2/gfx1151/ torch torchaudio torchvision
# Optional additional packages on Linux:
#   apex
https://github.com/ROCm/TheRock/blob/main/RELEASES.md#torch-for-gfx1151
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »