Install MIGraphX#
MIGraphX is AMD’s graph inference engine for optimizing and executing ONNX models on AMD GPUs using ROCm. This page describes how to install the version of MIGraphX that ships with your selected ROCm release.
Prerequisites#
MIGraphX 2.18 is currently supported on:
gfx950AMD Instinct MI355X, MI350X, and MI350Pgfx942AMD Instinct MI325X, MI300X, and MI300Agfx90aAMD Instinct MI250X, MI250, and MI210gfx1200,gfx1201,gfx1100,gfx1101, andgfx1102Radeon GPUs.gfx1153,gfx1152,gfx1151, andgfx1150Ryzen AI processors.
See the ROCm compatibility matrix for more information.
MIGraphX is currently supported on:
gfx950AMD Instinct MI355X and MI350Xgfx942AMD Instinct MI325X and MI300Xgfx1200,gfx1201,gfx1100,gfx1101, andgfx1102Radeon GPUs.
See the ROCm compatibility matrix for more information.
MIGraphX is currently supported on gfx950 AMD Instinct MI355X and MI350X
data center GPUs and gfx942 MI325X and MI300X GPUs. See the ROCm
compatibility matrix
for more information.
MIGraphX is currently supported on gfx950 AMD Instinct MI355X and MI350X
data center GPUs and gfx942 MI325X and MI300X GPUs. See the ROCm
compatibility matrix
for more information.
Ensure your system has Python 3.12 installed and accessible.
Ensure your system has Python 3.14 or 3.12 installed and accessible.
Ensure your system has Python 3.12 installed and accessible.
Install MIGraphX on Linux#
MIGraphX requires ROCm to be installed on your system first.
Install ROCm#
For instructions, see Install AMD ROCm 10.1.0. Use the selector panel on that page to view instructions appropriate for your system environment.
For instructions, see Install AMD ROCm 10.0.0. Use the selector panel on that page to view instructions appropriate for your system environment.
For instructions, see Install AMD ROCm 7.14.1. Use the selector panel on that page to view instructions appropriate for your system environment.
For instructions, see Install AMD ROCm 7.14.0. Use the selector panel on that page to view instructions appropriate for your system environment.
Install MIGraphX 2.18.0 via package manager#
Use the following steps to install MIGraphX system-wide using your distribution’s package manager on top of ROCm core libraries.
Register the ROCm MIGraphX repository.
sudo mkdir --parents --mode=0755 /etc/apt/keyrings wget https://stable.repo.amd.com/rocm/gpg/packages.gpg -O - | \ gpg --dearmor | sudo tee /etc/apt/keyrings/amdrocm.gpg > /dev/null sudo tee /etc/apt/sources.list.d/amdrocm-migraphx.sources << 'EOF' X-Repo-Id: amdrocm-migraphx Types: deb URIs: https://stable.repo.amd.com/rocm/migraphx/packages/ubuntu2604/ Suites: stable Components: main Architectures: amd64 Signed-By: /etc/apt/keyrings/amdrocm.gpg Enabled: yes EOF sudo apt update
sudo mkdir --parents --mode=0755 /etc/apt/keyrings wget https://stable.repo.amd.com/rocm/gpg/packages.gpg -O - | \ gpg --dearmor | sudo tee /etc/apt/keyrings/amdrocm.gpg > /dev/null sudo tee /etc/apt/sources.list.d/amdrocm-migraphx.sources << 'EOF' X-Repo-Id: amdrocm-migraphx Types: deb URIs: https://stable.repo.amd.com/rocm/migraphx/packages/ubuntu2404/ Suites: stable Components: main Architectures: amd64 Signed-By: /etc/apt/keyrings/amdrocm.gpg Enabled: yes EOF sudo apt update
sudo mkdir --parents --mode=0755 /etc/apt/keyrings wget https://stable.repo.amd.com/rocm/gpg/packages.gpg -O - | \ gpg --dearmor | sudo tee /etc/apt/keyrings/amdrocm.gpg > /dev/null sudo tee /etc/apt/sources.list.d/amdrocm-migraphx.sources << 'EOF' X-Repo-Id: amdrocm-migraphx Types: deb URIs: https://stable.repo.amd.com/rocm/migraphx/packages/ubuntu2204/ Suites: stable Components: main Architectures: amd64 Signed-By: /etc/apt/keyrings/amdrocm.gpg Enabled: yes EOF sudo apt update
sudo mkdir --parents --mode=0755 /etc/apt/keyrings wget https://stable.repo.amd.com/rocm/gpg/packages.gpg -O - | \ gpg --dearmor | sudo tee /etc/apt/keyrings/amdrocm.gpg > /dev/null sudo tee /etc/apt/sources.list.d/amdrocm-migraphx.sources << 'EOF' X-Repo-Id: amdrocm-migraphx Types: deb URIs: https://stable.repo.amd.com/rocm/migraphx/packages/debian13/ Suites: stable Components: main Architectures: amd64 Signed-By: /etc/apt/keyrings/amdrocm.gpg Enabled: yes EOF sudo apt update
sudo mkdir --parents --mode=0755 /etc/apt/keyrings wget https://stable.repo.amd.com/rocm/gpg/packages.gpg -O - | \ gpg --dearmor | sudo tee /etc/apt/keyrings/amdrocm.gpg > /dev/null sudo tee /etc/apt/sources.list.d/amdrocm-migraphx.sources << 'EOF' X-Repo-Id: amdrocm-migraphx Types: deb URIs: https://stable.repo.amd.com/rocm/migraphx/packages/debian12/ Suites: stable Components: main Architectures: amd64 Signed-By: /etc/apt/keyrings/amdrocm.gpg Enabled: yes EOF sudo apt update
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel10/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel9/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel8/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel10/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel9/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel8/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/yum.repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/rhel9/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo dnf clean all
sudo tee /etc/zypp/repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/sles16/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo zypper --gpg-auto-import-keys refresh
sudo tee /etc/zypp/repos.d/amdrocm-migraphx.repo <<EOF [amdrocm-migraphx] name=AMD ROCm MIGraphX baseurl=https://stable.repo.amd.com/rocm/migraphx/packages/sles15/x86_64 enabled=1 gpgcheck=1 gpgkey=https://stable.repo.amd.com/rocm/gpg/packages.gpg priority=50 EOF sudo zypper --gpg-auto-import-keys refresh
Install the MIGraphX packages and ROCm dependencies.
sudo apt install amdrocm10-migraphx amdrocm10-migraphx-dev
sudo dnf install amdrocm10-migraphx amdrocm10-migraphx-devel
sudo zypper install amdrocm10-migraphx amdrocm10-migraphx-devel
Complete the following post-installation steps.
Configure environment variables so that MIGraphX is added to the
PATHandLD_LIBRARY_PATH.# MIGraphX Environment Setup tee --append ~/.bashrc << 'EOF' # BEGIN MIGraphX environment configuration export ROCM_PATH=/opt/rocm/core-10.1 export MIGRAPHX_PATH=/opt/rocm/extras-10 export PATH=$MIGRAPHX_PATH/bin:$PATH export LD_LIBRARY_PATH=$MIGRAPHX_PATH/lib:$ROCM_PATH/lib:$LD_LIBRARY_PATH # END MIGraphX environment configuration EOF source ~/.bashrc
# MIGraphX Environment Setup tee --append ~/.profile << 'EOF' # BEGIN MIGraphX environment configuration export ROCM_PATH=/opt/rocm/core-10.1 export MIGRAPHX_PATH=/opt/rocm/extras-10 export PATH=$MIGRAPHX_PATH/bin:$PATH export LD_LIBRARY_PATH=$MIGRAPHX_PATH/lib:$ROCM_PATH/lib:$LD_LIBRARY_PATH # END MIGraphX environment configuration EOF source ~/.profile
# MIGraphX Environment Setup sudo tee /etc/profile.d/set-migraphx-env.sh << 'EOF' export ROCM_PATH=/opt/rocm/core-10.1 export MIGRAPHX_PATH=/opt/rocm/extras-10 export PATH=$MIGRAPHX_PATH/bin:$PATH export LD_LIBRARY_PATH=$MIGRAPHX_PATH/lib:$ROCM_PATH/lib:$LD_LIBRARY_PATH EOF sudo chmod +x /etc/profile.d/set-migraphx-env.sh source /etc/profile.d/set-migraphx-env.sh
Verify your installation.
Confirm that
migraphx-driveris on yourPATHand reports the expected version.migraphx-driver --versionYou should see MIGraphX 2.18.0 in the output:
MIGraphX Version: 2.18.0
Tip
If the command isn’t found, the environment variables from the previous step aren’t set in your current shell. Re-run the
sourcecommand or open a new shell session.ONNX Runtime accelerates machine learning inference using the MIGraphX execution provider on ROCm-supported GPUs. See the installation guidance.
Note
The ONNX Runtime MIGraphX execution provider requires MIGraphX to be installed using pip. The
onnxruntime-ep-migraphxwheel depends onmigraphx-libs, which pip can’t resolve from a package manager installation. To use the execution provider, install MIGraphX using pip instead.
Uninstall MIGraphX#
Use your package manager to remove the installed packages.
sudo apt remove amdrocm10-migraphx amdrocm10-migraphx-dev
sudo dnf remove amdrocm10-migraphx amdrocm10-migraphx-devel
sudo zypper remove amdrocm10-migraphx amdrocm10-migraphx-devel
Remove the MIGraphX repository.
# Remove MIGraphX repository sudo rm /etc/apt/sources.list.d/amdrocm-migraphx.sources # Clear the cache and clean the system sudo apt clean sudo apt update
# Remove MIGraphX repository sudo rm /etc/yum.repos.d/amdrocm-migraphx.repo # Clear the cache and clean the system sudo dnf clean all
# Remove MIGraphX repository sudo rm /etc/zypp/repos.d/amdrocm-migraphx.repo # Clear the cache and clean the system sudo zypper clean --all sudo zypper refresh
Remove the MIGraphX environment configuration.
If you opted for a user-specific setup during the installation process, remove the MIGraphX environment configuration block – the lines between the
BEGINandENDmarkers – from~/.bashrc.If you opted for a user-specific setup during the installation process, remove the MIGraphX environment configuration block – the lines between the
BEGINandENDmarkers – from~/.profile.If you opted for a system-wide setup during the installation process, remove the MIGraphX environment variables.
sudo rm -f /etc/profile.d/set-migraphx-env.sh
Install MIGraphX 2.18.0 using pip#
After installing ROCm, install MIGraphX. This method installs MIGraphX into a Python virtual environment.
Create and activate a virtual environment or activate an existing ROCm 10.1.0 environment.
python3.12 -m venv .venv source .venv/bin/activate
Install the MIGraphX and
migraphx-libswheels.python -m pip install --index-url https://stable.repo.amd.com/rocm/migraphx/whl-next/ \ "migraphx==2.18.0+rocm10.1.0" "migraphx-libs==2.18.0+rocm10.1.0"
Verify your installation.
Confirm that
migraphx-driveris available in your virtual environment and reports the expected version.migraphx-driver --versionONNX Runtime accelerates machine learning inference using the MIGraphX execution provider on ROCm-supported GPUs. See the installation guidance.
Install MIGraphX 2.18.0 using tarball#
After installing ROCm, install MIGraphX using the tarball method.
Download the MIGraphX tarball.
wget https://stable.repo.amd.com/rocm/migraphx/tarball/amdrocm10-migraphx-2.18.0.tar.gzExtract the tarball.
MIGraphX is part of the ROCm Extras set of tools that work with the ROCm Core SDK and requires configuring the location of a ROCm installation. Set the
ROCM_INSTALL_PATHvariable to the install directory of ROCm. For example, if you installed the ROCm Core SDK using your Linux distribution’s package manager, set it to/opt/rocm/core-10.1. If ROCm was installed via tarball to a custom location, setROCM_INSTALL_PATHto that location, for example$HOME/therock-tarball/install.MIGRAPHX_INSTALL_PATHis set to the installation of MIGraphX to an extras location within the ROCm installation.# Set installation paths ROCM_INSTALL_PATH="$HOME/therock-tarball/install" MIGRAPHX_INSTALL_PATH="$HOME/therock-tarball/install/extras-10" # Extract to the MIGraphX directory mkdir -p $MIGRAPHX_INSTALL_PATH tar -xzf amdrocm10-migraphx-2.18.0.tar.gz -C $MIGRAPHX_INSTALL_PATH
Note
The installation path for MIGraphX above assumes ROCm was installed to
$HOME/therock-tarball/install.Complete the following post-installation steps.
Configure environment variables so that MIGraphX is added to the
PATHandLD_LIBRARY_PATH.MIGRAPHX_PATHandROCM_PATHare set to the values used during extraction.# MIGraphX Environment Setup tee --append ~/.bashrc << EOF # BEGIN MIGraphX environment configuration export ROCM_PATH=$ROCM_INSTALL_PATH export MIGRAPHX_PATH=$MIGRAPHX_INSTALL_PATH export PATH=\$MIGRAPHX_PATH/bin:\$PATH export LD_LIBRARY_PATH=\$MIGRAPHX_PATH/lib:\$ROCM_PATH/lib:\$LD_LIBRARY_PATH # END MIGraphX environment configuration EOF source ~/.bashrc
# MIGraphX Environment Setup tee --append ~/.profile << EOF # BEGIN MIGraphX environment configuration export ROCM_PATH=$ROCM_INSTALL_PATH export MIGRAPHX_PATH=$MIGRAPHX_INSTALL_PATH export PATH=\$MIGRAPHX_PATH/bin:\$PATH export LD_LIBRARY_PATH=\$MIGRAPHX_PATH/lib:\$ROCM_PATH/lib:\$LD_LIBRARY_PATH # END MIGraphX environment configuration EOF source ~/.profile
# MIGraphX Environment Setup sudo tee /etc/profile.d/set-migraphx-env.sh << EOF export ROCM_PATH=$ROCM_INSTALL_PATH export MIGRAPHX_PATH=$MIGRAPHX_INSTALL_PATH export PATH=\$MIGRAPHX_PATH/bin:\$PATH export LD_LIBRARY_PATH=\$MIGRAPHX_PATH/lib:\$ROCM_PATH/lib:\$LD_LIBRARY_PATH EOF sudo chmod +x /etc/profile.d/set-migraphx-env.sh source /etc/profile.d/set-migraphx-env.sh
Verify your installation.
Confirm that
migraphx-driveris on yourPATHand reports the expected version.migraphx-driver --versionTip
If the command isn’t found, the environment variables from the previous step aren’t set in your current shell. Re-run the
sourcecommand or open a new shell session.
Uninstall MIGraphX#
Remove the installation directory.
To uninstall MIGraphX, remove your MIGraphX installation directory.
Important
The following command assumes you’re working with the
MIGRAPHX_INSTALL_PATHdirectory set to$HOME/therock-tarball/install/extras-10. If you chose a different directory when installing MIGraphX, adjust the command accordingly.rm -rf "$HOME/therock-tarball/install/extras-10"
Remove the MIGraphX environment configuration.
If you opted for a user-specific setup during the installation process, remove the MIGraphX environment configuration block – the lines between the
BEGINandENDmarkers – from~/.bashrc.If you opted for a user-specific setup during the installation process, remove the MIGraphX environment configuration block – the lines between the
BEGINandENDmarkers – from~/.profile.If you opted for a system-wide setup during the installation process, remove the MIGraphX environment variables.
sudo rm -f /etc/profile.d/set-migraphx-env.sh
Install MIGraphX 2.17.0 using pip#
After installing ROCm, install MIGraphX. This method installs MIGraphX into a Python virtual environment.
Create and activate a virtual environment or activate an existing ROCm 10.0.0 environment.
python3.14 -m venv .venv source .venv/bin/activate
python3.12 -m venv .venv source .venv/bin/activate
Install the MIGraphX and
migraphx-libswheels.python -m pip install --index-url https://stable.repo.amd.com/rocm/migraphx/whl-next/ \ "migraphx==2.17.0+rocm10.0.0"
ONNX Runtime accelerates machine learning inference using the MIGraphX execution provider on ROCm-supported GPUs. See the installation guidance.
Install MIGraphX 2.16.0 using pip#
After installing ROCm, install MIGraphX. This method installs MIGraphX into a Python virtual environment.
Create and activate a virtual environment or activate an existing ROCm 7.14.1 environment.
python3.12 -m venv .venv source .venv/bin/activate
Install the MIGraphX and
migraphx-libswheels.python -m pip install --index-url https://rocm.frameworks.amd.com/whl-multi-arch/ \ "migraphx==2.16.0+rocm7.14.1" \ https://rocm.frameworks.amd.com/whl-multi-arch/migraphx/migraphx_libs-2.16.0%2Brocm7.14.1-py3-none-manylinux_2_28_x86_64.whl
ONNX Runtime accelerates machine learning inference using the MIGraphX execution provider on ROCm-supported GPUs. See the installation guidance.
Install MIGraphX 2.16.0 using pip#
After installing ROCm, install MIGraphX. This method installs MIGraphX into a Python virtual environment.
Create and activate a virtual environment or activate an existing ROCm 7.14.0 environment. To create a new Python 3.12 virtual environment:
python3.12 -m venv .venv source .venv/bin/activate
Download the wheel.
wget https://rocm.frameworks.amd.com/whl-multi-arch/migraphx/migraphx-2.16.0%2Brocm7.14.0-cp312-none-manylinux_2_28_x86_64.whlInstall the wheels and required packages.
python -m pip install migraphx-2.16.0+rocm7.14.0-cp312-none-manylinux_2_28_x86_64.whl
ONNX Runtime accelerates machine learning inference using the MIGraphX execution provider on ROCm-supported GPUs. See the installation guidance.