mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-17 21:10:43 +00:00
1. Update SDLNativeRules from v2 to v3. The new one allows us setting excluded paths. 2. Update TSAUpload from v1 to v2. And add a config file ".gdn/.gdntsa" for it. 3. Fix some parentheses warnings 4. Update cmake to the latest. 5. Remove "--x86" build option from pipeline yaml files. Now we can auto-detect cpu architecture from python. So we don't need to ask user to specify it.
55 lines
2.5 KiB
Text
55 lines
2.5 KiB
Text
# --------------------------------------------------------------
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
# --------------------------------------------------------------
|
|
# Dockerfile to run ONNXRuntime with MIGraphX integration
|
|
#--------------------------------------------------------------------------
|
|
|
|
FROM ubuntu:18.04
|
|
|
|
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
|
ARG ONNXRUNTIME_BRANCH=master
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
ENV MIGRAPHX_DISABLE_FAST_GELU=1
|
|
|
|
RUN apt-get clean && apt-get update && apt-get install -y locales
|
|
RUN locale-gen en_US.UTF-8
|
|
RUN update-locale LANG=en_US.UTF-8
|
|
ENV LC_ALL C.UTF-8
|
|
ENV LANG C.UTF-8
|
|
|
|
# Install rocm
|
|
RUN apt-get update && apt-get install -y gnupg2 --no-install-recommends curl && \
|
|
curl -sL http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | apt-key add - && \
|
|
sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/4.2/ xenial main > /etc/apt/sources.list.d/rocm.list'
|
|
|
|
RUN apt-get update &&\
|
|
apt-get install -y sudo git bash build-essential rocm-dev libpython3.6-dev python3-pip miopen-hip \
|
|
rocblas half aria2
|
|
|
|
RUN aria2c -q -d /tmp -o cmake-3.21.0-linux-x86_64.tar.gz \
|
|
https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0-linux-x86_64.tar.gz &&\
|
|
tar -zxf /tmp/cmake-3.21.0-linux-x86_64.tar.gz --strip=1 -C /usr
|
|
|
|
# Install rbuild
|
|
RUN pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
|
|
|
|
ENV PATH /opt/miniconda/bin:/code/cmake-3.21.0-linux-x86_64/bin:${PATH}
|
|
|
|
# Install MIGraphX from source
|
|
RUN mkdir -p /migraphx
|
|
RUN cd /migraphx && git clone --depth=1 --branch migraphx_for_ort https://github.com/ROCmSoftwarePlatform/AMDMIGraphX src
|
|
RUN cd /migraphx && rbuild package --cxx /opt/rocm-4.2.0/llvm/bin/clang++ -d /migraphx/deps -B /migraphx/build -S /migraphx/src/ -DPYTHON_EXECUTABLE=/usr/bin/python3
|
|
RUN dpkg -i /migraphx/build/*.deb
|
|
RUN rm -rf /migraphx
|
|
|
|
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 &&\
|
|
cd onnxruntime &&\
|
|
/bin/sh ./build.sh --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --use_migraphx &&\
|
|
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
|
|
cd .. &&\
|
|
rm -rf onnxruntime cmake-3.21.0-linux-x86_64
|