From ba0d57e53bba8f483add2747414f4ed409b9476b Mon Sep 17 00:00:00 2001 From: Tongze Wang Date: Mon, 9 Sep 2024 17:32:01 -0700 Subject: [PATCH] feat: basic tf --- blender.dockerfile | 2 ++ tensorflow.dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 tensorflow.dockerfile diff --git a/blender.dockerfile b/blender.dockerfile index 8e5b5d5..2419902 100644 --- a/blender.dockerfile +++ b/blender.dockerfile @@ -15,6 +15,8 @@ WORKDIR /home/rocm/blender RUN ./build_files/build_environment/install_linux_packages.py RUN ./build_files/utils/make_update.py --use-linux-libraries +RUN sudo apt clean && sudo rm -rf /var/lib/apt/lists/* + # > Ref: https://github.com/xuhuisheng/rocm-gfx803/blob/master/blender.md # RUN sed -i 's/__noinline__/__inline__/g' intern/cycles/kernel/device/hip/compat.h RUN sed -i 's/major >= 9/major >= 8/g' intern/cycles/device/hip/util.h diff --git a/tensorflow.dockerfile b/tensorflow.dockerfile new file mode 100644 index 0000000..d161823 --- /dev/null +++ b/tensorflow.dockerfile @@ -0,0 +1,41 @@ +FROM wtongze/rocm-base:5.7.3 +ARG PYTHON_VERSION="3.11.10" +ARG TENSORFLOW_BRANCH="r2.13-rocm-enhanced" +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/* + +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 + +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 +WORKDIR /home/rocm/tensorflow + +RUN pyenv global ${PYTHON_VERSION} +RUN sudo apt-get update && \ +sudo apt install -y rocm-libs && \ +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 ./build_rocm_python3 /opt/rocm + +CMD [ "/bin/bash", "-l" ]