Sygil-Dev / stable-diffusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specifying gpu results in a crash when generating image

oc013 opened this issue · comments

commented

Started webui.py with arguments --gpu 2 and after clicking generate received this message

Expected all tensors to be on the same device, but found at least two devices, cuda:2 and cuda:0! (when checking argument for argument index in method wrapper__index_select)

I found #114 with a similar error message. This is happening with default settings, just putting in a prompt, so gfpgan and esrgan are off.

commented

Make sure you have the latest version and the correct facexlib installed. To be on the safe side, recreate the conda environment to pull the lib from this git.

commented

Yes thanks @ainub for that gfpgan related fix, I'll put a note about this on the readme

@oc013 If gfpgan and esrgan are off it shouldn't be the same issue, try --gpu 2 --extra-models-gpu --esrgan-gpu 2 --gfpgan-gpu 2 though please it could be something to do with how the options are set, I only have 1 graphics card so it's difficult to test this properly on my end.

commented

I am updated to latest

If there are further updates for facexlib does conda not cover it?

sd  |   Attempting uninstall: facexlib
sd  |     Found existing installation: facexlib 0.2.4
sd  |     Uninstalling facexlib-0.2.4:
sd  |       Successfully uninstalled facexlib-0.2.4
sd  |   Running setup.py develop for facexlib

This is happening with default settings, just putting in a prompt, so gfpgan and esrgan are off.

commented

Ok so can you try --gpu 2 --extra-models-gpu --esrgan-gpu 2 --gfpgan-gpu 2

commented

Same error, and I tried with gfpgan and esrgan enabled with the same effect

sd  |  Expected all tensors to be on the same device, but found at least two devices, cuda:2 and cuda:0! (when checking argument for argument index in method wrapper__index_select)
commented

It looks like the gpu param only works with --optimized flag, model.to(device) is only called when that is set

commented

Does that mean it's fixed?