Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Specifying gpu results in a crash when generating image #154

Closed
oc013 opened this issue Aug 31, 2022 · 7 comments
Closed

Specifying gpu results in a crash when generating image #154

oc013 opened this issue Aug 31, 2022 · 7 comments

Comments

@oc013
Copy link

oc013 commented Aug 31, 2022

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.

@ainub
Copy link

ainub commented Aug 31, 2022

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.

@hlky
Copy link

hlky commented Aug 31, 2022

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.

@oc013
Copy link
Author

oc013 commented Aug 31, 2022

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.

@hlky
Copy link

hlky commented Aug 31, 2022

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

@oc013
Copy link
Author

oc013 commented Aug 31, 2022

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)

@oc013
Copy link
Author

oc013 commented Aug 31, 2022

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

@hlky hlky closed this as completed Aug 31, 2022
@oc013
Copy link
Author

oc013 commented Aug 31, 2022

Does that mean it's fixed?

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

No branches or pull requests

3 participants