Skip to content

Commit 393583c

Browse files
fix: address rocm failing build
1 parent 258a27d commit 393583c

File tree

3 files changed

+43
-18
lines changed

3 files changed

+43
-18
lines changed

machine-learning/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ FROM builder-cpu AS builder-rknn
2222

2323
# Warning: 25GiB+ disk space required to pull this image
2424
# TODO: find a way to reduce the image size
25-
FROM rocm/dev-ubuntu-22.04:6.4.3-complete@sha256:1f7e92ca7e3a3785680473329ed1091fc99db3e90fcb3a1688f2933e870ed76b AS builder-rocm
25+
FROM rocm/dev-ubuntu-24.04:6.4.4-complete@sha256:31418ac10a3769a71eaef330c07280d1d999d7074621339b8f93c484c35f6078 AS builder-rocm
2626

2727
# renovate: datasource=github-releases depName=Microsoft/onnxruntime
28-
ARG ONNXRUNTIME_VERSION="v1.20.1"
28+
ARG ONNXRUNTIME_VERSION="v1.21.1"
2929
WORKDIR /code
3030

31-
RUN apt-get update && apt-get install -y --no-install-recommends wget git python3.10-venv
32-
RUN wget -nv https://github.com/Kitware/CMake/releases/download/v3.30.1/cmake-3.30.1-linux-x86_64.sh && \
33-
chmod +x cmake-3.30.1-linux-x86_64.sh && \
34-
mkdir -p /code/cmake-3.30.1-linux-x86_64 && \
35-
./cmake-3.30.1-linux-x86_64.sh --skip-license --prefix=/code/cmake-3.30.1-linux-x86_64 && \
36-
rm cmake-3.30.1-linux-x86_64.sh
31+
RUN apt-get update && apt-get install -y --no-install-recommends wget git python3.12-venv
32+
RUN wget -nv https://github.com/Kitware/CMake/releases/download/v3.31.9/cmake-3.31.9-linux-x86_64.sh && \
33+
chmod +x cmake-3.31.9-linux-x86_64.sh && \
34+
mkdir -p /code/cmake-3.31.9-linux-x86_64 && \
35+
./cmake-3.31.9-linux-x86_64.sh --skip-license --prefix=/code/cmake-3.31.9-linux-x86_64 && \
36+
rm cmake-3.31.9-linux-x86_64.sh
3737

38-
ENV PATH=/code/cmake-3.30.1-linux-x86_64/bin:${PATH}
38+
ENV PATH=/code/cmake-3.31.9-linux-x86_64/bin:${PATH}
3939

4040
RUN git clone --single-branch --branch "${ONNXRUNTIME_VERSION}" --recursive "https://github.com/Microsoft/onnxruntime" onnxruntime
4141
WORKDIR /code/onnxruntime
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
2-
index d90a2a355..bb1a7de12 100644
2+
index 205dccdad6..2a994e2e95 100644
33
--- a/cmake/CMakeLists.txt
44
+++ b/cmake/CMakeLists.txt
5-
@@ -295,7 +295,7 @@ if (onnxruntime_USE_ROCM)
5+
@@ -338,7 +338,7 @@ if (onnxruntime_USE_ROCM)
6+
if (ROCM_VERSION_DEV VERSION_LESS "6.2")
7+
message(FATAL_ERROR "CMAKE_HIP_ARCHITECTURES is not set when ROCm version < 6.2")
8+
else()
9+
- set(CMAKE_HIP_ARCHITECTURES "gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx940;gfx941;gfx942;gfx1200;gfx1201")
10+
+ set(CMAKE_HIP_ARCHITECTURES "gfx900;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102;gfx940;gfx941;gfx942;gfx1200;gfx1201")
11+
endif()
612
endif()
7-
8-
if (NOT CMAKE_HIP_ARCHITECTURES)
9-
- set(CMAKE_HIP_ARCHITECTURES "gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx940;gfx941;gfx942;gfx1200;gfx1201")
10-
+ set(CMAKE_HIP_ARCHITECTURES "gfx900;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102;gfx940;gfx941;gfx942;gfx1200;gfx1201")
11-
endif()
12-
13-
file(GLOB rocm_cmake_components ${onnxruntime_ROCM_HOME}/lib/cmake/*)
13+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/dockerfiles/scripts/install_common_deps.sh b/dockerfiles/scripts/install_common_deps.sh
2+
index bbb672a99e..5bdcdc2cf9 100644
3+
--- a/dockerfiles/scripts/install_common_deps.sh
4+
+++ b/dockerfiles/scripts/install_common_deps.sh
5+
@@ -8,16 +8,16 @@ apt-get update && apt-get install -y --no-install-recommends \
6+
curl \
7+
libcurl4-openssl-dev \
8+
libssl-dev \
9+
- python3-dev
10+
+ python3-dev \
11+
+ python3-numpy \
12+
+ python3-packaging \
13+
+ python3-wheel
14+
15+
# Dependencies: conda
16+
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh -O ~/miniconda.sh --no-check-certificate && /bin/bash ~/miniconda.sh -b -p /opt/miniconda
17+
rm ~/miniconda.sh
18+
/opt/miniconda/bin/conda clean -ya
19+
20+
-pip install numpy
21+
-pip install packaging
22+
-pip install "wheel>=0.35.1"
23+
rm -rf /opt/miniconda/pkgs
24+
25+
# Dependencies: cmake

0 commit comments

Comments
 (0)