Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a170e40

Browse files
PeixuanZuopeixuanzuo
andauthored
[ROCm] Update Dockerfiles of ROCm and MIgraphX to ROCm5.4 (microsoft#14013)
Update Dockerfiles of ROCm and MIGraphX to ROCm5.4 Update README.md Co-authored-by: peixuanzuo <peixuanzuo@linmif39a000004.zvflicr54joexhdgnhvmxrxygg.phxx.internal.cloudapp.net>
1 parent b5fd2a6 commit a170e40

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

dockerfiles/Dockerfile.migraphx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# Dockerfile to run ONNXRuntime with MIGraphX integration
66
#--------------------------------------------------------------------------
77

8-
FROM ubuntu:18.04
8+
FROM ubuntu:20.04
99

1010
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
1111
ARG ONNXRUNTIME_BRANCH=main
12+
ARG ROCM_VERSION=5.4
1213
ENV DEBIAN_FRONTEND noninteractive
1314
ENV MIGRAPHX_DISABLE_FAST_GELU=1
1415

@@ -21,10 +22,10 @@ ENV LANG C.UTF-8
2122
# Install rocm
2223
RUN apt-get update && apt-get install -y gnupg2 --no-install-recommends curl && \
2324
curl -sL http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
24-
sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/4.5.2/ ubuntu main > /etc/apt/sources.list.d/rocm.list'
25+
sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/${ROCM_VERSION}/ ubuntu main > /etc/apt/sources.list.d/rocm.list'
2526

2627
RUN apt-get update &&\
27-
apt-get install -y sudo git bash build-essential rocm-dev libpython3.6-dev python3-pip miopen-hip \
28+
apt-get install -y sudo git bash build-essential rocm-dev python3-dev python3-pip miopen-hip \
2829
rocblas half aria2 libnuma-dev
2930

3031
RUN aria2c -q -d /tmp -o cmake-3.24.3-linux-x86_64.tar.gz \
@@ -39,7 +40,7 @@ ENV PATH /opt/miniconda/bin:/code/cmake-3.24.3-linux-x86_64/bin:${PATH}
3940
# Install MIGraphX from source
4041
RUN mkdir -p /migraphx
4142
RUN cd /migraphx && git clone --depth=1 --branch migraphx_for_ort https://github.com/ROCmSoftwarePlatform/AMDMIGraphX src
42-
RUN cd /migraphx && rbuild package --cxx /opt/rocm-4.5.2/llvm/bin/clang++ -d /migraphx/deps -B /migraphx/build -S /migraphx/src/ -DPYTHON_EXECUTABLE=/usr/bin/python3
43+
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
4344
RUN dpkg -i /migraphx/build/*.deb
4445
RUN rm -rf /migraphx
4546

@@ -54,5 +55,5 @@ RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXR
5455
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
5556
cd onnxruntime &&\
5657
/bin/sh ./build.sh --cmake_extra_defines ONNXRUNTIME_VERSION=`cat ./VERSION_NUMBER` --config Release --parallel \
57-
--skip_tests --build_wheel --use_rocm --rocm_version=4.5.2 --rocm_home /opt/rocm --use_migraphx &&\
58+
--skip_tests --build_wheel --use_rocm --rocm_version=${ROCM_VERSION} --rocm_home /opt/rocm --use_migraphx &&\
5859
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl

dockerfiles/Dockerfile.rocm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
# Dockerfile to run ONNXRuntime with ROCm integration
66
#--------------------------------------------------------------------------
77

8-
FROM rocm/pytorch:rocm5.2.3_ubuntu20.04_py3.7_pytorch_1.12.1
8+
FROM rocm/pytorch:rocm5.4_ubuntu20.04_py3.7_pytorch_1.12.1
99

1010
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
1111
ARG ONNXRUNTIME_BRANCH=main
1212

1313
WORKDIR /code
1414

15+
ENV PATH /opt/miniconda/bin:/code/cmake-3.24.3-linux-x86_64/bin:${PATH}
16+
1517
# Prepare onnxruntime repository & build onnxruntime
1618
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
19+
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
1720
cd onnxruntime &&\
1821
/bin/sh ./build.sh --config Release --build_wheel --update --build --parallel --cmake_extra_defines\
1922
ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --use_rocm --rocm_home=/opt/rocm &&\

dockerfiles/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Nothing else from ONNX Runtime source tree will be copied/installed to the image
279279
Note: When running the container you built in Docker, please either use 'nvidia-docker' command instead of 'docker', or use Docker command-line options to make sure NVIDIA runtime will be used and appropiate files mounted from host. Otherwise, CUDA libraries won't be found. You can also [set NVIDIA runtime as default in Docker](https://github.com/dusty-nv/jetson-containers#docker-default-runtime).
280280

281281
## MIGraphX
282-
**Ubuntu 18.04, rocm4.5, AMDMIGraphX v1.2**
282+
**Ubuntu 20.04, ROCm5.4, AMDMIGraphX v1.2**
283283

284284
1. Build the docker image from the Dockerfile in this repository.
285285
```
@@ -293,7 +293,7 @@ Note: When running the container you built in Docker, please either use 'nvidia-
293293
```
294294

295295
## ROCm
296-
**Ubuntu 20.04, ROCm5.2.3**
296+
**Ubuntu 20.04, ROCm5.4**
297297

298298
1. Build the docker image from the Dockerfile in this repository.
299299
```
@@ -303,5 +303,5 @@ Note: When running the container you built in Docker, please either use 'nvidia-
303303
2. Run the Docker image
304304

305305
```
306-
docker run -it --device=/dev/kfd --device=/dev/dri --group-add video --privileged onnxruntime-rocm
306+
docker run -it --device=/dev/kfd --device=/dev/dri --group-add video onnxruntime-rocm
307307
```

0 commit comments

Comments
 (0)