diff --git a/dockerfiles/Dockerfile.migraphx b/dockerfiles/Dockerfile.migraphx index b9b71c7e22..ffda92ec76 100644 --- a/dockerfiles/Dockerfile.migraphx +++ b/dockerfiles/Dockerfile.migraphx @@ -10,6 +10,8 @@ FROM ubuntu:20.04 ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime ARG ONNXRUNTIME_BRANCH=main ARG ROCM_VERSION=5.4 +# MIGraphX version should be the same as ROCm version +ARG MIGRAPHX_VERSION=rocm-5.4.0 ENV DEBIAN_FRONTEND noninteractive ENV MIGRAPHX_DISABLE_FAST_GELU=1 @@ -26,7 +28,7 @@ RUN apt-get update && apt-get install -y gnupg2 --no-install-recommends curl && RUN apt-get update &&\ apt-get install -y sudo git bash build-essential rocm-dev python3-dev python3-pip miopen-hip \ - rocblas half aria2 libnuma-dev + rocblas half aria2 libnuma-dev pkg-config RUN aria2c -q -d /tmp -o cmake-3.24.3-linux-x86_64.tar.gz \ https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.tar.gz &&\ @@ -39,7 +41,7 @@ ENV PATH /opt/miniconda/bin:/code/cmake-3.24.3-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 && git clone --depth=1 --branch ${MIGRAPHX_VERSION} https://github.com/ROCmSoftwarePlatform/AMDMIGraphX src RUN cd /migraphx && rbuild package --cxx /opt/rocm/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 diff --git a/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile b/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile index 2c1c2c78d0..d9dcd19376 100644 --- a/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile +++ b/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile @@ -1,5 +1,8 @@ FROM rocm/pytorch:rocm5.4_ubuntu20.04_py3.7_pytorch_1.12.1 +# MIGraphX version should be the same as ROCm version +ARG MIGRAPHX_VERSION=rocm-5.4.0 + ENV DEBIAN_FRONTEND noninteractive ENV MIGRAPHX_DISABLE_FAST_GELU=1 @@ -21,8 +24,6 @@ RUN cd /opt/mpi_install/ucx/build &&\ make -j $(nproc) &&\ make install - - RUN apt-get update &&\ apt-get install -y half libnuma-dev @@ -31,7 +32,7 @@ RUN pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar. # 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 && git clone --depth=1 --branch ${MIGRAPHX_VERSION} https://github.com/ROCmSoftwarePlatform/AMDMIGraphX src RUN cd /migraphx && rbuild package --cxx /opt/rocm/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