-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.rocm
57 lines (54 loc) · 2.1 KB
/
Dockerfile.rocm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM rocm/pytorch:rocm6.1_ubuntu20.04_py3.9_pytorch_staging
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8
WORKDIR /python3109
RUN sudo apt-get update &&\
apt-get install -y \
build-essential \
zlib1g-dev \
libncurses5-dev \
libgdbm-dev \
libnss3-dev \
libssl-dev \
libreadline-dev \
wget \
libffi-dev \
python3.10
RUN wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz
RUN tar -xf Python-3.10.9.tgz
WORKDIR /python3109/Python-3.10.9
RUN ./configure --enable-optimizations
RUN make -j $(nproc)
RUN sudo make altinstall
RUN sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1
RUN sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1
RUN sudo update-alternatives --config python3
RUN update-alternatives --config python3
RUN sudo apt install --reinstall lsb-release -y
RUN /usr/bin/python3 -m pip install --upgrade pip wheel
WORKDIR /sdtemp
RUN apt-get update &&\
apt-get install -y \
git \
python3-pip \
python-is-python3
WORKDIR /bitsandbytes
RUN git clone https://github.com/hqnicolas/bitsandbytes-rocm
RUN cd bitsandbytes-rocm \
make hip
RUN cd bitsandbytes-rocm \
RUN CUDA_VERSION=gfx1100 /usr/bin/python3 setup.py install \
python3 -m bitsandbytes
WORKDIR /sdtemp
RUN git clone --branch v1.9.3 https://github.com/AUTOMATIC1111/stable-diffusion-webui /sdtemp
#torch and torchvision version number refer to
#https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/launch.py
ENV TORCH_COMMAND="pip install torch==2.1.2+rocm5.6 torchvision==0.16.2+rocm5.6 --extra-index-url https://download.pytorch.org/whl/rocm5.6"
RUN /usr/bin/python3 -m $TORCH_COMMAND
RUN echo -e "export PYTHONPATH="${PYTHONPATH}:/usr/bin/"" > ~/.bash_profile
RUN /usr/bin/python3 launch.py --skip-torch-cuda-test --exit
RUN /usr/bin/python3 -m pip install opencv-python-headless
WORKDIR /stablediff-web