Install ONNX Runtime for Radeon GPUs#

Refer to this section to install ONNX via the PIP installation method.


Ensure that the following prerequisite installations are successful before proceeding to install ONNX Runtime for use with ROCm™ on Radeon™ GPUs.


  • Radeon Software for Linux (with ROCm) is installed.

  • MIGraphX is installed. This enables ONNX Runtime to build the correct MIGraphX EP.

  • The half library is installed.

    NOTE The half library is installed with MIGraphX. If the half library install is not verified, use the following install command:

    $ sudo apt install half
  • If the prerequisite installations are successful, proceed to install ONNX Runtime.

    NOTE Unless adding custom features, use the pre-built Python wheel files provided in the PIP installation method.

Install ONNX Runtime#


  • Use the provided pre-built Python wheel files from the PIP installation method, unless adding custom features.

  • The wheel file contains the MIGraphX and ROCm Execution Providers (EP). Refer to Install MIGraphX for ONNX RT for more information.

  • Refer to ONNX Runtime Documentation for additional information on ONNX Runtime topics.

  • See ONNX Runtime Tutorials to try out real applications and tutorials on how to get started.

ONNX Runtime install via PIP installation method#

Use the PIP install method to create an ONNX Runtime environment.

To install via PIP,

Enter this command to download and install the ONNX Runtime wheel.

pip3 install

Next, verify your ONNX Runtime installation.

Verify ONNX Runtime installation#

Confirm if ONNX Runtime is correctly installed.

$ python3
$ import onnxruntime as ort

Expected result: The following EPs are displayed.

>>> ort.get_available_providers()
['MIGraphXExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider']

Environment set-up is complete, and the system is ready for use with ONNX Runtime to work with machine learning models, and algorithms.