feat: tensorflow
This commit is contained in:
+15
-21
@@ -1,41 +1,35 @@
|
||||
FROM wtongze/rocm-base:5.7.3
|
||||
ARG PYTHON_VERSION="3.11.10"
|
||||
ARG TENSORFLOW_BRANCH="r2.13-rocm-enhanced"
|
||||
ARG TENSORFLOW_BRANCH="r2.11-rocm-enhanced"
|
||||
ARG NUMPY_VERSION="1.22.4"
|
||||
ARG DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt install -y build-essential libssl-dev zlib1g-dev \
|
||||
libbz2-dev libreadline-dev libsqlite3-dev curl git \
|
||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
||||
&& sudo rm -rf /var/lib/apt/lists/*
|
||||
sudo apt-get install -y rocm-libs && \
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /home/rocm
|
||||
RUN curl https://pyenv.run | bash
|
||||
|
||||
ENV PYENV_ROOT=/home/rocm/.pyenv
|
||||
ENV PATH=$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH
|
||||
RUN pyenv install ${PYTHON_VERSION}
|
||||
|
||||
# RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz
|
||||
# RUN tar -xvf clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz
|
||||
# RUN sudo cp -r clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04/* /usr
|
||||
|
||||
# Add GPU target
|
||||
RUN bash -c 'echo -e "gfx803\ngfx900" | sudo tee /opt/rocm/bin/target.lst'
|
||||
|
||||
# Install bazelisk
|
||||
RUN sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.21.0/bazelisk-linux-amd64 && sudo chmod 755 /usr/local/bin/bazel
|
||||
|
||||
RUN git clone -b ${TENSORFLOW_BRANCH} https://github.com/ROCm/tensorflow-upstream.git tensorflow
|
||||
RUN git clone --depth 1 https://github.com/ROCm/tensorflow-upstream.git -b ${TENSORFLOW_BRANCH} tensorflow
|
||||
WORKDIR /home/rocm/tensorflow
|
||||
|
||||
RUN pyenv global ${PYTHON_VERSION}
|
||||
# > https://github.com/ROCm/ROCm/issues/1880
|
||||
ENV PATH=$PATH:/home/rocm/.local/bin
|
||||
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt install -y rocm-libs && \
|
||||
sudo apt-get install -y python3-dev && \
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# TODO: Causing problems....
|
||||
RUN sudo pip install numpy==1.26.0 wheel mock future pyyaml setuptools keras_preprocessing keras_applications jupyter patchelf --upgrade
|
||||
RUN pip install -U --user pip numpy==${NUMPY_VERSION} wheel packaging requests opt_einsum patchelf
|
||||
RUN pip install -U --user keras_preprocessing --no-deps
|
||||
|
||||
# RUN ./build_rocm_python3 /opt/rocm
|
||||
RUN sudo ln -s /usr/bin/python3 /usr/bin/python
|
||||
RUN ./build_rocm_python3 /opt/rocm
|
||||
RUN cp -a /tmp/tensorflow_pkg /home/rocm
|
||||
|
||||
CMD [ "/bin/bash", "-l" ]
|
||||
|
||||
Reference in New Issue
Block a user