This commit is contained in:
2026-06-10 15:43:34 +08:00
parent 177c508da0
commit a94374fbb1
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ MODEL_DIR=./data/models
MIOPEN_CACHE=./data/miopen
# ---- 代理设置(国内访问 GitHub 慢时开启)----
# GIT_PROXY=http://127.0.0.1:8118
GIT_PROXY=http://127.0.0.1:8118
# ---- 模型下载源 ----
# huggingface(默认,需科学上网)或 modelscope(国内可用)
+7 -3
View File
@@ -34,6 +34,7 @@ WORKDIR /opt
# ===========================================================================
RUN sed -i 's|http://.*archive.ubuntu.com|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources && \
sed -i 's|http://.*security.ubuntu.com|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources && \
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
apt-get update && apt-get install -y --no-install-recommends \
wget curl ca-certificates gnupg software-properties-common && \
wget -q https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
@@ -78,9 +79,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apt-get clean && rm -rf /var/lib/apt/lists/*
# ===========================================================================
# 阶段 4:CMake 4.0
# 阶段 4:CMake 4.0(通过代理下载加速)
# ===========================================================================
RUN cd /tmp && \
RUN export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
cd /tmp && \
wget -q https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0-linux-x86_64.tar.gz && \
tar -xzf cmake-4.0.0-linux-x86_64.tar.gz && \
cp -r cmake-4.0.0-linux-x86_64/bin/* /usr/local/bin/ && \
@@ -108,7 +110,8 @@ RUN python${PYTHON_VER} -m venv ${VENV} && \
# ===========================================================================
# 阶段 6:ROCm 开发包
# ===========================================================================
RUN apt-get update && apt-get install -y --no-install-recommends \
RUN export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
apt-get update && apt-get install -y --no-install-recommends \
hipblas-dev hiprand-dev hipsparse-dev hipsparselt-dev \
hipsolver-dev hipcub-dev rocprim-dev rocthrust-dev \
rocblas-dev rocrand-dev hipfft-dev hipblaslt-dev \
@@ -281,6 +284,7 @@ RUN set -ex && \
${VENV}/bin/pip install regex && \
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \
${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
${VENV}/bin/pip install --force-reinstall \
torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \
--index-url ${TORCH_INDEX} && \