Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supplied build.sh builds for CPU only and ignores GPU #179

Open
ghost opened this issue Oct 3, 2022 · 3 comments
Open

Supplied build.sh builds for CPU only and ignores GPU #179

ghost opened this issue Oct 3, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 3, 2022

Below is the steps I've executed, on a clean MacOS install with Xcode developer tools and Homebrew. python3 refers to Python 3.10.7, downloaded from Python.org. Not using Conda/Anaconda.

git clone https://github.com/divamgupta/diffusionbee-stable-diffusion-ui
cd diffusionbee-stable-diffusion-ui/backends/stable_diffusion_tf
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements_m1.txt
python3 -m pip install pyinstaller
sh build.sh

Snippets from output:

422 WARNING: Unable to copy metadata for tensorflow: The 'tensorflow' distribution was not found and is required by the application
...
21557 WARNING: Unable to determine requirements for tensorflow: The 'tensorflow' distribution was not found and is required by the application
21562 WARNING: Unable to copy metadata for tensorflow-plugins: The 'tensorflow-plugins' distribution was not found and is required by the application
21667 WARNING: Unable to determine requirements for tensorflow-plugins: The 'tensorflow-plugins' distribution was not found and is required by the application
...
62622 INFO: Analyzing hidden import 'tensorflow.__internal__'
62622 ERROR: Hidden import 'tensorflow.__internal__' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.autograph'
62622 ERROR: Hidden import 'tensorflow.__internal__.autograph' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.decorator'
62622 ERROR: Hidden import 'tensorflow.__internal__.decorator' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.dispatch'
62622 ERROR: Hidden import 'tensorflow.__internal__.dispatch' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.distribute'
62622 ERROR: Hidden import 'tensorflow.__internal__.distribute' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.distribute.combinations'
62622 ERROR: Hidden import 'tensorflow.__internal__.distribute.combinations' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.distribute.interim'
62622 ERROR: Hidden import 'tensorflow.__internal__.distribute.interim' not found
62622 INFO: Analyzing hidden import 'tensorflow.__internal__.distribute.multi_process_runner'
62623 ERROR: Hidden import 'tensorflow.__internal__.distribute.multi_process_runner' not found
62623 INFO: Analyzing hidden import 'tensorflow.__internal__.eager_context'
62623 ERROR: Hidden import 'tensorflow.__internal__.eager_context' not found
...
(hundreds of similar lines)
...
PyInstaller.utils.osx.IncompatibleBinaryArchError: /Users/samuel/git/diffusionbee-stable-diffusion-ui/backends/stable_diffusion_tf/venv/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so is incompatible with target arch arm64 (has arch: x86_64)!

The final error looks to be caused by the default version of protobuf from PIP being built for x86, so I replace it with one built from source:

python3 -m pip uninstall protobuf
python3 -m pip install --no-binary :all: protobuf==3.19.4 --ignore-installed

and re-run: sh build.sh

This time I get a binary. But when testing the binary - by starting it in terminal and using the test prompt:

b2py t2im {"prompt":"cat"}

It logs out that it's using CPU, not GPU, and is ~5x slower than the provided binary in the repo - i.e. 5.5s/it instead of 1s/it.

Any ideas anyone? This is blocking many people from contributing to the project.

@whab
Copy link

whab commented Oct 6, 2022

Using an environment set up using Anaconda and Python 3.9, the produced binary also uses the CPU instead of the GPU when using the "b2py t2im" command (~5s/it instead of 1s/it when using the election GUI).

@polaski
Copy link

polaski commented Oct 7, 2022

Starting to wonder whether anyone other than the @divamgupta has been able to build properly at all. been wanting to contribute for weeks now, I know it's not fun to write build documentation, but I really think it would help the community if there's an actual way to build this repository for anyone other than the original creator.

I had this same issue as well as other issues I still couldn't find an answer to (from this thread #62)

Just making it easy for people to build will accelerate the development exponentially.

@fortinmike
Copy link
Contributor

fortinmike commented May 5, 2023

I have also been wanting to contribute and have succeeded in building the app a few months ago but I had to make a couple of temporary modifications to the backend for it to work. It was clearly not the way it was supposed to be built but it worked for some quick experimentation.

I'd love to have official instructions to setup a development environment / proper build for DiffusionBee. I'm thinking of contributing a few bug fixes at first but I have some other things in mind (mostly small but nice UX tweaks and features) that I'm sure a lot of people would appreciate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants