saharmor / dalle-playground

A playground to generate images from any text prompt using Stable Diffusion (past: using DALL-E Mini)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run in docker without GPU ?

remygrandin opened this issue · comments

Can I run the playground with docker without GPU ?

I know CPU only will be slow as heck but for testing I don't care if the pictures take very long to generate

I got this log when running :

Compiled successfully!
dalle-interface |
dalle-interface | You can now view dalle-playground in the browser.
dalle-interface |
dalle-interface |   Local:            http://localhost:3000/dalle-playground
dalle-interface |   On Your Network:  http://172.28.0.26:3000/dalle-playground
dalle-interface |
dalle-interface | Note that the development build is not optimized.
dalle-interface | To create a production build, use yarn build.
dalle-interface |
dalle-interface | webpack compiled successfully
18deb5a0b538_dalle-backend | --> Starting DALL-E Server. This might take up to two minutes.
18deb5a0b538_dalle-backend | 2022-06-28 11:48:50.864133: W external/org_tensorflow/tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
18deb5a0b538_dalle-backend | 2022-06-28 11:48:50.864403: W external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
18deb5a0b538_battleStation_dalle-backend | WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)

However when curling the backend (curl http://172.28.0.26:8080) I get a connection refused

Can it not be run as CPU only ? I didn't find anything in the doc indicating if it is possible or impossible

it can, you need to change the jax library it uses to CPU,
in https://github.com/saharmor/dalle-playground/blob/main/backend/Dockerfile
need to change

# install jax[cuda]
RUN pip3 install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

to

# install jax[cpu]
RUN pip3 install --upgrade "jax[cpu]"

Might also want to change the FROM nvidia/cuda:11.4.3-cudnn8-devel-ubuntu20.04 to a standard ubuntu base image

(its insanely slow, just fyi)

then you can spin it up with the docker-compose.yml and the frontend should play nice