2020-05-26 20:24:59 +00:00
|
|
|
# --------------------------------------------------------------
|
|
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
# --------------------------------------------------------------
|
|
|
|
|
# Dockerfile to run ONNXRuntime with MIGraphX integration
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
|
|
2024-10-25 18:47:16 +00:00
|
|
|
FROM rocm/pytorch:rocm6.2.3_ubuntu22.04_py3.10_pytorch_release_2.3.0
|
2020-05-26 20:24:59 +00:00
|
|
|
|
|
|
|
|
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
2022-08-16 21:13:05 +00:00
|
|
|
ARG ONNXRUNTIME_BRANCH=main
|
2020-06-26 02:22:57 +00:00
|
|
|
|
2024-11-11 21:05:34 +00:00
|
|
|
ENV PATH=/code/cmake-3.27.3-linux-x86_64/bin:${PATH}
|
2020-05-26 20:24:59 +00:00
|
|
|
|
2022-02-02 00:11:39 +00:00
|
|
|
RUN apt-get update &&\
|
2024-02-29 09:51:29 +00:00
|
|
|
apt-get install -y migraphx
|
2022-02-02 00:11:39 +00:00
|
|
|
|
2020-05-26 20:24:59 +00:00
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
|
|
# Prepare onnxruntime repository & build onnxruntime
|
|
|
|
|
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
|
|
|
|
|
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
|
2024-02-29 09:51:29 +00:00
|
|
|
cd onnxruntime && pip install --upgrade pip &&\
|
2023-03-27 21:46:04 +00:00
|
|
|
/bin/sh ./build.sh --allow_running_as_root --cmake_extra_defines ONNXRUNTIME_VERSION=`cat ./VERSION_NUMBER` --config Release --parallel \
|
2022-12-22 02:03:34 +00:00
|
|
|
--skip_tests --build_wheel --use_rocm --rocm_version=${ROCM_VERSION} --rocm_home /opt/rocm --use_migraphx &&\
|
2022-02-02 00:11:39 +00:00
|
|
|
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl
|