Proxmox ROCm LXC Toolkit

Toolkit for building an unprivileged Ubuntu 24.04 LXC on Proxmox and installing ROCm 7.2 with AMD's official Ubuntu package-manager method.

What this includes

  • scripts/create_rocm_lxc.sh
    • Creates an unprivileged Ubuntu 24.04 container using community-scripts ct/ubuntu.sh.
  • scripts/configure_gpu_passthrough.sh
    • Adds /dev/kfd + /dev/dri passthrough and cgroup permissions in LXC config.
  • scripts/install_rocm_in_ct.sh
    • Registers ROCm 7.2 noble apt repos and installs a chosen ROCm meta package.

Requirements

  • Proxmox VE host with a working AMD GPU stack exposing:
    • /dev/kfd
    • /dev/dri
  • Template and container storage names available in Proxmox (for example local and local-lvm).
  • Run scripts on the Proxmox host as root.

Quick start

  1. Create unprivileged container:
chmod +x scripts/*.sh

sudo bash ./scripts/create_rocm_lxc.sh \
	--ctid 120 \
	--hostname rocm-ct \
	--template-storage local \
	--container-storage local-lvm

This script uses:

  • https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/ubuntu.sh
  • (internally by that script) https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/ubuntu-install.sh
  1. Configure GPU passthrough on host:
sudo bash ./scripts/configure_gpu_passthrough.sh --ctid 120
  1. Install ROCm in container:
sudo bash ./scripts/install_rocm_in_ct.sh --ctid 120 --package rocm
  1. Optional manual checks:
pct exec 120 -- bash -lc '/opt/rocm/bin/rocminfo | head -n 40'
pct exec 120 -- bash -lc '/opt/rocm/bin/rocm-smi || true'

ROCm package options

install_rocm_in_ct.sh defaults to rocm, but you can pass alternatives, for example:

  • rocm-hip-runtime
  • rocm-opencl-runtime
  • rocm-ml-libraries

Example:

sudo bash ./scripts/install_rocm_in_ct.sh --ctid 120 --package rocm-hip-runtime

Notes for unprivileged LXC

  • Device passthrough to unprivileged containers can be sensitive to host kernel/driver updates.
  • If your workload runs as a non-root user inside the CT, ensure that user is in video/render groups:
pct exec 120 -- bash -lc 'usermod -aG video,render <your-user>'
  • A CT restart is often required after changing LXC device mappings.

Community scripts (direct usage)

If you want to run the upstream script directly (interactive), use:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/ubuntu.sh)"

Repository:

Alignment with AMD docs

ROCm install flow follows AMDs Ubuntu package-manager guidance for ROCm 7.2 and Ubuntu 24.04 (noble):

  • GPG key to /etc/apt/keyrings/rocm.gpg
  • rocm/apt/7.2 + graphics/7.2/ubuntu apt repos
  • apt preference pin (Pin-Priority: 600)

Reference:

S
Description
No description provided
Readme 66 KiB
Languages
Shell 100%