33 lines
977 B
Docker
33 lines
977 B
Docker
ARG ROCM_VERSION="5.7.3"
|
|
FROM wtongze/rocm-base:${ROCM_VERSION}
|
|
ARG HIP_ARCH="gfx803;gfx900"
|
|
ARG BLENDER_BRANCH="v4.2.1"
|
|
ARG DEBIAN_FRONTEND="noninteractive"
|
|
|
|
RUN sudo apt update && \
|
|
sudo apt install -y python3 git git-lfs
|
|
|
|
WORKDIR /home/rocm
|
|
RUN git clone -b ${BLENDER_BRANCH} https://projects.blender.org/blender/blender.git && \
|
|
mkdir blender/build
|
|
|
|
WORKDIR /home/rocm/blender
|
|
RUN ./build_files/build_environment/install_linux_packages.py
|
|
RUN ./build_files/utils/make_update.py --use-linux-libraries
|
|
|
|
# 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
|
|
|
|
WORKDIR /home/rocm/blender/build
|
|
RUN cmake \
|
|
-DWITH_CYCLES_HIP_BINARIES=ON \
|
|
-DCYCLES_HIP_BINARIES_ARCH=${HIP_ARCH} \
|
|
-DCMAKE_INSTALL_PREFIX=/opt/blender \
|
|
-DWITH_INSTALL_PORTABLE=OFF \
|
|
..
|
|
RUN make -j$(nproc)
|
|
RUN cpack -G DEB
|
|
|
|
CMD ["bash", "-l"]
|