From 5c28bfcf29ab7e092fb3bb5af604ad2632633d89 Mon Sep 17 00:00:00 2001 From: Winston Ma Date: Fri, 28 Jul 2023 15:59:33 +0800 Subject: [PATCH 1/2] Split one command into multiple --- Dockerfile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8367101..68d2a1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,13 +9,18 @@ ENV PORT=7860 \ COMMANDLINE_ARGS='' WORKDIR /opt -RUN apt-get -y update && \ - apt-get install -y --no-install-recommends libstdc++-12-dev ca-certificates wget gnupg2 gawk curl git libglib2.0-0 apt-utils python3.10-venv python3-pip && \ - wget https://repo.radeon.com/amdgpu-install/5.5/ubuntu/jammy/amdgpu-install_5.5.50500-1_all.deb && \ - apt-get install -y ./amdgpu-install_5.5.50500-1_all.deb && \ - amdgpu-install -y --usecase=rocm --no-dkms && \ - git clone -b $SD_BRANCH https://github.com/hydrian/stable-diffusion-webui.git /sd && \ - true + +RUN apt -y update + +RUN apt-get install -y --no-install-recommends libstdc++-12-dev ca-certificates wget gnupg2 gawk curl git libglib2.0-0 apt-utils python3.10-venv python3-pip + +RUN wget https://repo.radeon.com/amdgpu-install/5.5/ubuntu/jammy/amdgpu-install_5.5.50500-1_all.deb + +RUN apt-get install -y ./amdgpu-install_5.5.50500-1_all.deb + +RUN amdgpu-install -y --usecase=rocm --no-dkms + +RUN git clone -b $SD_BRANCH https://github.com/hydrian/stable-diffusion-webui.git /sd WORKDIR /sd From c7665129b9dab0e9a58465fcbd3a0163d48c3447 Mon Sep 17 00:00:00 2001 From: Winston Ma Date: Fri, 28 Jul 2023 16:00:52 +0800 Subject: [PATCH 2/2] Always install the latest AMD Driver --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68d2a1d..3846af5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,13 +12,16 @@ WORKDIR /opt RUN apt -y update -RUN apt-get install -y --no-install-recommends libstdc++-12-dev ca-certificates wget gnupg2 gawk curl git libglib2.0-0 apt-utils python3.10-venv python3-pip +RUN apt-get install -y --no-install-recommends libstdc++-12-dev ca-certificates wget gnupg2 gawk curl git libglib2.0-0 apt-utils python3.10-venv python3-pip libxml2-utils -RUN wget https://repo.radeon.com/amdgpu-install/5.5/ubuntu/jammy/amdgpu-install_5.5.50500-1_all.deb +# Install AMD Driver +RUN FILENAME=$(curl https://repo.radeon.com/amdgpu-install/latest/ubuntu/jammy/ | grep deb | xmllint --html --format --xpath "string(//a/@href)" - ) \ + && TEMP_DEB="$(mktemp)" \ + && wget -O "$TEMP_DEB" https://repo.radeon.com/amdgpu-install/latest/ubuntu/jammy/"$FILENAME" \ + && dpkg -i "$TEMP_DEB" \ + && rm -f "$TEMP_DEB" -RUN apt-get install -y ./amdgpu-install_5.5.50500-1_all.deb - -RUN amdgpu-install -y --usecase=rocm --no-dkms +RUN amdgpu-install -y --usecase=rocm RUN git clone -b $SD_BRANCH https://github.com/hydrian/stable-diffusion-webui.git /sd