Get started with MIGraphX#

2026-10-12

3 min read time

Applies to Linux

After you install MIGraphX, use this guide to choose a starting path based on how you plan to use the library. Each section links to validated examples and reference material in this repository.

Choose your path#

MIGraphX supports several integration patterns. Pick the section that matches your role and goal.

Application developer using the C++ API#

Use this path when you embed MIGraphX directly in a C++ application.

  1. Confirm MIGraphX is installed. See MIGraphX on ROCm installation.

  2. In your existing CMake project, set CMAKE_PREFIX_PATH to your MIGraphX installation location and link against the C++ API:

    find_package(migraphx)
    target_link_libraries(my_app migraphx::c)
    

    Replace my_app with your CMake target name. The repository examples already include CMakeLists.txt files, so you do not need to create one when building those examples.

  3. Work through Parse, load, and save a model to learn how to load ONNX models and serialize programs.

  4. Continue with the C++ MNIST inference example at examples/vision/cpp_mnist/ in the MIGraphX GitHub repository for a complete parse, compile, and evaluate workflow.

  5. Consult the MIGraphX C++ API reference for API details.

Application developer using the Python API#

Use this path when you call MIGraphX from Python.

  1. Confirm MIGraphX is installed. See MIGraphX on ROCm installation.

  2. Use a Python virtual environment. Activate it before running examples so the MIGraphX Python module resolves correctly for your install method. If you install MIGraphX from a Python wheel into that environment, the module is available after activation. If you install from a package manager, confirm that import migraphx succeeds in the activated environment before continuing.

  3. Browse the Python examples under examples/ in the MIGraphX GitHub repository. Start with a domain that matches your model, such as vision or natural language processing.

  4. Consult the MIGraphX Python API reference for API details.

Model integrator or inference engineer#

Use this path when you want to inspect, compile, verify, or benchmark models without writing application code.

  1. Confirm migraphx-driver is available on your PATH.

  2. Read MIGraphX driver for commands such as read, compile, run, verify, and perf.

  3. Validate a model against the reference implementation:

    migraphx-driver verify model.onnx --onnx
    
  4. Measure performance:

    migraphx-driver perf model.onnx --onnx --gpu -n 50
    
  5. See Validate model outputs and Tune model performance for environment variables and tolerance settings.

PyTorch user#

Use this path when you integrate MIGraphX with PyTorch workflows through Torch-MIGraphX.

  1. Install Torch-MIGraphX. See Torch-MIGraphX installation.

  2. Refer to the Torch-MIGraphX repository at ROCm/torch_migraphx for model conversion and inference examples.

ONNX Runtime user#

Use this path when you run inference through the ONNX Runtime MIGraphX execution provider.

  1. Install MIGraphX. See MIGraphX on ROCm installation.

  2. Follow the ResNet50 example at examples/onnxruntime/resnet50/ in the MIGraphX GitHub repository for setup and inference steps with ONNX Runtime.

MIGraphX contributor#

Use this path when you modify the MIGraphX source code or add operators and passes.

  1. Set up a build environment. See Build MIGraphX in a Docker container or MIGraphX on ROCm installation.

  2. Read Develop for the MIGraphX code base.

  3. Consult MIGraphX environment variables for tuning, tracing, and testing options used during development.

Next steps#