Install MIGraphX#

2026-11-26

5 min read time

Applies to Linux

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.16.0 is currently supported on gfx950 AMD Instinct MI355X and MI350X data center GPUs and gfx942 MI325X and MI300X GPUs.

See the ROCm 7.14.1 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 7.14.1. Use the selector panel on that page to view instructions appropriate for your system environment.

Note

Installing MIGraphX using pip requires a ROCm 7.14.1 installation using pip in the same virtual environment. When selecting the ROCm installation method, choose pip as the ROCm installation method and install ROCm 7.14.1 into a Python virtual environment.

Install MIGraphX using pip#

After installing ROCm, install MIGraphX. This method installs MIGraphX 2.16.0 into a Python virtual environment.

  1. Activate the ROCm 7.14.1 virtual environment you created while installing ROCm using pip.

    source .venv/bin/activate
    

    Note

    Substitute .venv with the path to your virtual environment if you used a different name or location.

  2. Install the MIGraphX and migraphx-libs wheels.

    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
    
  3. 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’s site-packages instead of /opt/rocm. As a workaround, update LD_LIBRARY_PATH to 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
    
  4. Verify your installation.

    Confirm that migraphx-driver and the migraphx Python 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.16.0 in the output:

    MIGraphX Version: 2.16.0
    2.16.0+rocm7.14.1
    

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#

  1. 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.

  1. Complete the appropriate ROCm installation prerequisites for your system environment and register AMD package repositories.

  2. Install required ROCm development packages:

    sudo apt install amdrocm-runtime-dev7.14 \
        amdrocm-blas-dev7.14 \
        amdrocm-blas-host7.14 \
        amdrocm-dnn-dev7.14 \
        amdrocm-dnn-host7.14 \
        amdrocm-hipblas-common-dev7.14 \
        amdrocm-core7.14
    
    sudo dnf install amdrocm-runtime-devel7.14 \
        amdrocm-blas-devel7.14 \
        amdrocm-blas-host7.14 \
        amdrocm-dnn-devel7.14 \
        amdrocm-dnn-host7.14 \
        amdrocm-hipblas-common-devel7.14 \
        amdrocm-core7.14
    
    sudo zypper install amdrocm-runtime-devel7.14 \
        amdrocm-blas-devel7.14 \
        amdrocm-blas-host7.14 \
        amdrocm-dnn-devel7.14 \
        amdrocm-dnn-host7.14 \
        amdrocm-hipblas-common-devel7.14 \
        amdrocm-core7.14
    

    amdrocm-core provides the GPU device code and links /opt/rocm/bin, /opt/rocm/llvm, and the other /opt/rocm entry points to this release, so the paths used in the remaining steps resolve.

    Note

    amdrocm-core7.14 installs 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-core7.14-gfx942
    

    Run rocminfo | grep -o -m1 'gfx.*' to find the architecture of an installed GPU. The suffixed package sets up the same /opt/rocm links.

  3. Install the host build tools. The ROCm packages don’t provide CMake, Git, or the Python headers and venv module 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
    
  4. Clone the MIGraphX source code:

    git clone https://github.com/ROCm/AMDMIGraphX.git
    cd AMDMIGraphX
    
  5. Install rbuild into a Python virtual environment.

    On Python 3.14 or newer, install cget from 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
    
  6. Build MIGraphX source code. Run this from the root of the checkout, because rbuild builds 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.