2021-03-12 15:51:08 +00:00
|
|
|
# --------------------------------------------------------------
|
|
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
# --------------------------------------------------------------
|
2022-09-15 02:41:49 +00:00
|
|
|
# Dockerfile to run ONNXRuntime with ROCm integration
|
2021-03-12 15:51:08 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
|
|
2024-02-29 09:51:29 +00:00
|
|
|
FROM rocm/pytorch:rocm6.0_ubuntu20.04_py3.9_pytorch_2.1.1
|
2021-03-12 15:51:08 +00:00
|
|
|
|
|
|
|
|
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
2022-08-16 21:13:05 +00:00
|
|
|
ARG ONNXRUNTIME_BRANCH=main
|
2021-03-12 15:51:08 +00:00
|
|
|
|
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
2024-02-29 09:51:29 +00:00
|
|
|
ENV PATH /code/cmake-3.27.3-linux-x86_64/bin:${PATH}
|
2022-12-22 02:03:34 +00:00
|
|
|
|
2021-03-12 15:51:08 +00:00
|
|
|
# Prepare onnxruntime repository & build onnxruntime
|
|
|
|
|
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
|
2022-12-22 02:03:34 +00:00
|
|
|
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
|
2021-03-12 15:51:08 +00:00
|
|
|
cd onnxruntime &&\
|
2023-03-27 21:46:04 +00:00
|
|
|
/bin/sh ./build.sh --allow_running_as_root --config Release --build_wheel --update --build --parallel --cmake_extra_defines\
|
2022-02-02 00:11:39 +00:00
|
|
|
ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --use_rocm --rocm_home=/opt/rocm &&\
|
2021-03-12 15:51:08 +00:00
|
|
|
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
|
2022-02-02 00:11:39 +00:00
|
|
|
cd ..
|