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

skip cuda mem_get_info if cuda is not available #62

Merged
merged 6 commits into from
May 14, 2023

Conversation

WojtekKowaluk
Copy link

@WojtekKowaluk WojtekKowaluk commented May 14, 2023

Running on MacBook with this PR: ai-forever/Kandinsky-2#36
You can install it with:

source venv/bin/activate
pip uninstall kandinsky2
pip install git+https://github.com/WojtekKowaluk/Kandinsky-2@cpu-mps-fix

and then you run Kubin with:
python src/kubin.py --device mps

However small fix is also required in kubin.

@seruva19 seruva19 changed the base branch from master to dev May 14, 2023 23:41
@seruva19 seruva19 merged commit 7bfe32a into seruva19:dev May 14, 2023
@seruva19
Copy link
Owner

Thank you!

@adrianpuiu
Copy link
Contributor

can't launch with [ --device mps ]. im getting :
raise RuntimeError('Attempting to deserialize object on a CUDA ' RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

@seruva19
Copy link
Owner

When exactly is this error raised, do you have stacktrace?
Also, @WojtekKowaluk, are you getting the same error?

@adrianpuiu
Copy link
Contributor

When exactly is this error raised, do you have stacktrace? Also, @WojtekKowaluk, are you getting the same error?

right after hitting on generate . i mean im launching with device mps . all good, it loads , and when i hit generate i get this

@WojtekKowaluk
Copy link
Author

WojtekKowaluk commented May 22, 2023

@adrianpuiu: seems you are not using my kandinski branch, it is not merged to master:

source venv/bin/activate
pip uninstall kandinsky2
pip install git+https://github.com/WojtekKowaluk/Kandinsky-2@cpu-mps-fix

Let me know if that works.

@adrianpuiu
Copy link
Contributor

aaaaahhh , makes sense man :))) , let me give it a shot .. i let you know in couple of mintues

@adrianpuiu
Copy link
Contributor

pip install git+https://github.com/WojtekKowaluk/Kandinsky-2@cpu-mps-fix

heres the stack trace. still dosent want , now its throwing out ssl cert errors : File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

@seruva19
Copy link
Owner

Try pip install certifi

@adrianpuiu
Copy link
Contributor

installing certificates from the /Applications/Python3.10/install.certificates.command ..
now its loading the models into ram .. so it passed. It's all good .

@adrianpuiu
Copy link
Contributor

adrianpuiu commented May 22, 2023

Try pip install certifi

that was it . pip install --upgrade certifi

@WojtekKowaluk
Copy link
Author

WojtekKowaluk commented Jul 15, 2023

I rebased mac specific fixes for latest kandinsky repo version (2.2) which kubin is now using and put that into new branch. you can install this new branch inside your kubin virtualevn like this:

source venv/bin/activate
pip uninstall kandinsky2
pip install git+https://github.com/WojtekKowaluk/Kandinsky-2@cpu-mps-fix-2_2

I did not look yet into what we need to get 2.2 and diffusers pipeline working, this is just to keep 2.1 working on latest kubin on mac.

you should also look into this PR which includes further fixes:
ai-forever/Kandinsky-2#69

@seruva19
Copy link
Owner

OK, thank you.
There is a link to this thread in wiki so mac users could find and follow your instructions.
I have no way to test it on mac anyway, so that's all I can do for now.

@orcinus
Copy link

orcinus commented Oct 17, 2023

Followed the outlined steps, got everything seemingly working, however, all images produced are either all black pixels, or magenta mess. No errors or anything obviously wrong in the output or logs. No idea what's wrong...

@seruva19
Copy link
Owner

I am afraid I cannot really help you here, as I don't have access to Apple machines and unable to test how Kandinsky works there. Are other PyTorch-powered applications (Automatic1111, etc.) working as expected? And did you try to run Kandinsky using other applications like SD.Next?

@orcinus
Copy link

orcinus commented Oct 18, 2023

Yes, and yes. That's why i'm finding this so puzzling.
I'd get it if it didn't work at all or threw an exception, but everything seems fine.

Kandinsky worked in SD.Next as expected, until the yesterday's dev->master merge (but it's failing there now in a different way - namely, unable to load the model).

@seruva19
Copy link
Owner

There were some significant changes in commit c84c0ac, try checkout to any earlier version, for instance 928fb6b (git checkout 928fb6b) and see if it still fails to run.

@orcinus
Copy link

orcinus commented Oct 20, 2023

Thanks! Will give it a shot over the weekend!

@orcinus
Copy link

orcinus commented Oct 22, 2023

No luck, unfortunately.
Oh well, i'll be back on my intel machine soon anyway.

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

Successfully merging this pull request may close these issues.

4 participants