AbdBarho / stable-diffusion-webui-docker

Easy Docker setup for Stable Diffusion with user-friendly UI
Other
6.71k stars 1.12k forks source link

Error install no NVidia #479

Closed carlorregod closed 1 year ago

carlorregod commented 1 year ago

Error $ docker compose --profile download up --build [+] Building 1.5s (10/10) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 32B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/bash:alpine3.15 1.4s => [auth] library/bash:pull token for registry-1.docker.io 0.0s => [1/4] FROM docker.io/library/bash:alpine3.15@sha256:463b668dccc38f32a5bb5a5d59a3e1b787be432eb69b853fe4ad49cdce9a37d5 0.0s => [internal] load build context 0.0s => => transferring context: 128B 0.0s => CACHED [2/4] RUN apk add parallel aria2 0.0s => CACHED [3/4] COPY . /docker 0.0s => CACHED [4/4] RUN chmod +x /docker/download.sh 0.0s => exporting to image 0.0s => => exporting layers 0.0s => => writing image sha256:b2aadf2fa49a21f9cf4376c8907e51c4751ee38a98a4fe5531c23f8f0e2d8ebf 0.0s => => naming to docker.io/library/webui-docker-download 0.0s [+] Running 1/0

carlos@MSI MINGW64 ~/Desktop/Stable Diffusion/stable-diffusion-webui-docker (master) $ docker compose --profile auto up --build [+] Building 4.5s (36/36) FINISHED => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 32B 0.0s => [internal] load .dockerignore 0.1s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/python:3.10.9-slim 4.0s => [internal] load metadata for docker.io/alpine/git:2.36.2 2.8s => [internal] load metadata for docker.io/library/alpine:3.17 4.0s => [auth] alpine/git:pull token for registry-1.docker.io 0.0s => [auth] library/alpine:pull token for registry-1.docker.io 0.0s => [auth] library/python:pull token for registry-1.docker.io 0.0s => [internal] load build context 0.0s => => transferring context: 149B 0.0s => [download 1/8] FROM docker.io/alpine/git:2.36.2@sha256:ec491c893597b68c92b88023827faa771772cfd5e106b76c713fa5e1c75dea84 0.0s => [xformers 1/3] FROM docker.io/library/alpine:3.17@sha256:124c7d2707904eea7431fffe91522a01e5a861a624ee31d03372cc1d138a3126 0.0s => [stage-2 1/15] FROM docker.io/library/python:3.10.9-slim@sha256:76dd18d90a3d8710e091734bf2c9dd686d68747a51908db1e1f41e9a5ed4e2c5 0.0s => CACHED [stage-2 2/15] RUN apt-get update && apt install fonts-dejavu-core rsync git jq moreutils aria2 -y && apt-get clean 0.0s => CACHED [stage-2 3/15] RUN --mount=type=cache,target=/cache --mount=type=cache,target=/root/.cache/pip aria2c -x 5 --dir /cache --out torch-2.0.0-c 0.0s => CACHED [stage-2 4/15] RUN --mount=type=cache,target=/root/.cache/pip git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git && cd 0.0s => CACHED [xformers 2/3] RUN apk add --no-cache aria2 0.0s => CACHED [xformers 3/3] RUN aria2c -x 5 --dir / --out wheel.whl 'https://github.com/AbdBarho/stable-diffusion-webui-docker/releases/download/5.0.3/xfor 0.0s => CACHED [stage-2 5/15] RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.20.de 0.0s => CACHED [download 2/8] COPY clone.sh /clone.sh 0.0s => CACHED [download 3/8] RUN . /clone.sh taming-transformers https://github.com/CompVis/taming-transformers.git 24268930bf1dce879235a7fddd0b2355b84d7ea6 0.0s => CACHED [download 4/8] RUN . /clone.sh stable-diffusion-stability-ai https://github.com/Stability-AI/stablediffusion.git 47b6b607fdd31875c9279cd2f4f16 0.0s => CACHED [download 5/8] RUN . /clone.sh CodeFormer https://github.com/sczhou/CodeFormer.git c5b4593074ba6214284d6acd5f1719b6c5d739af && rm -rf assets 0.0s => CACHED [download 6/8] RUN . /clone.sh BLIP https://github.com/salesforce/BLIP.git 48211a1594f1321b00f14c9f7a5b4813144b2fb9 0.0s => CACHED [download 7/8] RUN . /clone.sh k-diffusion https://github.com/crowsonkb/k-diffusion.git 5b3af030dd83e0297272d861c19477735d0317ec 0.0s => CACHED [download 8/8] RUN . /clone.sh clip-interrogator https://github.com/pharmapsychotic/clip-interrogator 2486589f24165c8e3b303f84e9dbbea318df83e8 0.0s => CACHED [stage-2 6/15] COPY --from=download /repositories/ /stable-diffusion-webui/repositories/ 0.0s => CACHED [stage-2 7/15] RUN mkdir /stable-diffusion-webui/interrogate && cp /stable-diffusion-webui/repositories/clip-interrogator/data/* /stable-diff 0.0s => CACHED [stage-2 8/15] RUN --mount=type=cache,target=/root/.cache/pip pip install -r /stable-diffusion-webui/repositories/CodeFormer/requirements.t 0.0s => CACHED [stage-2 9/15] RUN --mount=type=cache,target=/root/.cache/pip pip install pyngrok git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d9 0.0s => CACHED [stage-2 10/15] RUN apt-get -y install libgoogle-perftools-dev && apt-get clean 0.0s => CACHED [stage-2 11/15] RUN --mount=type=cache,target=/root/.cache/pip cd stable-diffusion-webui && git fetch && git reset --hard 89f9faa6338875 0.0s => CACHED [stage-2 12/15] RUN --mount=type=cache,target=/root/.cache/pip pip install -U opencv-python-headless 0.0s => CACHED [stage-2 13/15] COPY . /docker 0.0s => CACHED [stage-2 14/15] RUN python3 /docker/info.py /stable-diffusion-webui/modules/ui.py && mv /stable-diffusion-webui/style.css /stable-diffusio 0.0s => CACHED [stage-2 15/15] WORKDIR /stable-diffusion-webui 0.0s => exporting to image 0.2s => => exporting layers 0.0s => => writing image sha256:1775966e2d592ec892940d4da778bdb360443405d322f64c9c7168140237a123 0.1s => => naming to docker.io/library/sd-auto:56 0.0s Attaching to webui-docker-auto-1 Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container-cli: initialization error: WSL environment detected but no adapters were found: unknown

Steps to Reproduce

Additional context Any other context about the problem here. If applicable, add screenshots to help explain your problem.

AbdBarho commented 1 year ago

Please fillout the bug report template: https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/master/.github/ISSUE_TEMPLATE/bug.md

That being said, it seems that you are running WSL, maybe you need to update the nvidia-container-toolkit or the drivers, not really sure.

simonmcnair commented 1 year ago

You may also need to install cuda on the host too

kienerj commented 1 year ago

I have the exact same issue as OP.

This container fails with the exact same error as OP.

You may also need to install cuda on the host too

This could potentially indeed be the issue? I rely on conda environments using cuda-toolkit to provide the cuda function or official NVIDIA docker containers. Does this container not ship with the cuda toolkit included?

UPDATE: strange. After a VM reboot I'm now getting a different error, the dreaded RuntimeError: No CUDA GPUs are available. The settings from the FAQ regarding this do not help either.

AbdBarho commented 1 year ago

@kienerj do you have the nvidia-container-toolkit installed in the VM where you want to run the container?

kienerj commented 1 year ago

@kienerj do you have the nvidia-container-toolkit installed in the VM where you want to run the container?

thanks for getting back to me so quickly.

yes it was already installed. About the specific issue of this thread, I'm not sure why it went away. A reboot solved it. I suspect it was caused by Ubuntu updating updating kernel and then me having to reinstall NVIDIA driver and possibly forgot to reboot. not 100% sure.

The second issue I was able to solve. See other issue: https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/389#issuecomment-1571340508

In essence with the A100 (which has no graphics function), I needed to change on the docker compose file the device capabilities from ["gpu"] to ["compute", "utility"] ("compute" alone also seemed to work).

So the FAQ did help a bit as these capabilities are referenced there and I just tried it and it worked.

AbdBarho commented 1 year ago

Maybe we should add these capabilities to the docker compose file...

kienerj commented 1 year ago

Probably yes if someone confirms it also works for normal gaming GPUs.

AbdBarho commented 1 year ago

I tested it locally and changed it, let's see if users face problems.