Install MIGraphX#
2026-11-26
5 min read time
Installing MIGraphX using prebuilt packages is sufficient for most users who want to use the MIGraphX API. If you plan to develop for MIGraphX or contribute to the source code, see Developing for MIGraphX.
Prerequisites#
MIGraphX 2.17.0 is currently supported on:
gfx950AMD Instinct MI355X and MI350Xgfx942AMD Instinct MI325X and MI300Xgfx1200,gfx1201,gfx1100,gfx1101, andgfx1102Radeon GPUs.
See the ROCm 10.0.0 compatibility matrix for more information.
Install MIGraphX on Linux#
MIGraphX requires ROCm to be installed on your system first.
Install ROCm#
For instructions, see Install AMD ROCm 10.0.0. Use the selector panel on that page to view instructions appropriate for your system environment.
Note
Installing MIGraphX using pip requires a ROCm 10.0.0 installation using pip in the same virtual environment. When selecting the ROCm installation method, choose pip as the ROCm installation method and install ROCm 10.0.0 into a Python virtual environment.
Install MIGraphX using pip#
After installing ROCm, install MIGraphX. This method installs MIGraphX 2.17.0 into a Python virtual environment.
Activate the ROCm 10.0.0 virtual environment you created while installing ROCm using pip.
source .venv/bin/activate
Note
Substitute
.venvwith the path to your virtual environment if you used a different name or location.Install the MIGraphX wheel.
python -m pip install --index-url https://stable.repo.amd.com/rocm/migraphx/whl-next/ \ "migraphx==2.17.0+rocm10.0.0"
Importing MIGraphX may fail with a missing shared library error, such as
libhiprtc.so.7: cannot open shared object file. ROCm’s pip wheels place their shared libraries inside your virtual environment’ssite-packagesinstead of/opt/rocm. As a workaround, updateLD_LIBRARY_PATHto link to the required ROCm libraries. Set the environment variable for the current shell session with the virtual environment active, so the paths resolve correctly. Run this command again in each new shell session after activating the virtual environment.# MIGraphX Environment Setup ROCM_SDK_CORE=$(python3 -c "import _rocm_sdk_core, os; print(os.path.dirname(_rocm_sdk_core.__file__))") ROCM_SDK_LIBRARIES=$(python3 -c "import _rocm_sdk_libraries, os; print(os.path.dirname(_rocm_sdk_libraries.__file__))") export LD_LIBRARY_PATH=$ROCM_SDK_CORE/lib:$ROCM_SDK_CORE/lib/rocm_sysdeps/lib:$ROCM_SDK_LIBRARIES/lib:$LD_LIBRARY_PATH
Verify your installation.
Confirm that
migraphx-driverand themigraphxPython module are available in your virtual environment and report the expected version.migraphx-driver --version python -c "import migraphx; print(migraphx.__version__)"
You should see MIGraphX 2.17.0 in the output:
MIGraphX Version: 2.17.0 2.17.0+rocm10.0.0
See also
ONNX Runtime with onnxruntime-ep-migraphx accelerates machine
learning inference using the MIGraphX execution provider on
ROCm-supported GPUs. See the ONNX Runtime installation guide.
Uninstall MIGraphX#
Remove the virtual environment containing MIGraphX.
deactivate rm -rf .venv
Build MIGraphX from source#
Note
For reproducibility, we recommend using the provided Docker environment with MIGraphX build prerequisites preinstalled. See ./build-migraphx-docker.
See the MIGraphX README for more information.
Complete the appropriate ROCm installation prerequisites for your system environment and register AMD package repositories.
Install required ROCm development packages:
sudo apt install amdrocm-runtime-dev10.0 \ amdrocm-blas-dev10.0 \ amdrocm-blas-host10.0 \ amdrocm-dnn-dev10.0 \ amdrocm-dnn-host10.0 \ amdrocm-hipblas-common-dev10.0 \ amdrocm-core10.0
sudo dnf install amdrocm-runtime-devel10.0 \ amdrocm-blas-devel10.0 \ amdrocm-blas-host10.0 \ amdrocm-dnn-devel10.0 \ amdrocm-dnn-host10.0 \ amdrocm-hipblas-common-devel10.0 \ amdrocm-core10.0
sudo zypper install amdrocm-runtime-devel10.0 \ amdrocm-blas-devel10.0 \ amdrocm-blas-host10.0 \ amdrocm-dnn-devel10.0 \ amdrocm-dnn-host10.0 \ amdrocm-hipblas-common-devel10.0 \ amdrocm-core10.0
amdrocm-coreprovides the GPU device code and links/opt/rocm/bin,/opt/rocm/llvm, and the other/opt/rocmentry points to this release, so the paths used in the remaining steps resolve.Note
amdrocm-core10.0installs the device code for every supported architecture. Append your GPU’s architecture to install only the device code that architecture needs, which is a much smaller download:sudo apt install amdrocm-core10.0-gfx942
Run
rocminfo | grep -o -m1 'gfx.*'to find the architecture of an installed GPU. The suffixed package sets up the same/opt/rocmlinks.Install the host build tools. The ROCm packages don’t provide CMake, Git, or the Python headers and
venvmodule that the following steps need.sudo apt install build-essential cmake git pkg-config \ python3-dev python3-pip python3-venv
sudo dnf install gcc-c++ make cmake git \ python3-devel python3-pip
sudo zypper install gcc-c++ make cmake git \ python3-devel python3-pip
Clone the MIGraphX source code:
git clone https://github.com/ROCm/AMDMIGraphX.git cd AMDMIGraphX
Install rbuild into a Python virtual environment.
On Python 3.14 or newer, install
cgetfrom source.python3 -m venv venv_rbuild source venv_rbuild/bin/activate pip install https://github.com/pfultz2/cget/archive/master.tar.gz pip install https://github.com/ROCm/rbuild/archive/master.tar.gz
Build MIGraphX source code. Run this from the root of the checkout, because
rbuildbuilds the source directory you invoke it from:rbuild build -d depend -B build -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
Once completed, all prerequisites are in the depend folder and MIGraphX is in
the build directory.
If you plan to develop for MIGraphX or contribute to the source code, see Developing for MIGraphX.