dribnet / pixray

neural image generation
Other
402 stars 53 forks source link

pixray only uses the cpu, would prefer it use our gpu #24

Closed geeknik closed 3 years ago

geeknik commented 3 years ago

Hello, great project you have here. cog run python pixray.py --drawer=pixel --prompt=prompt --output output.png runs successfully on our Fedora 34 machine, however, it always starts with Using device: cpu which is incredibly slow. We have an Nvidia RTX 2070 with the latest official drivers. Other VQGAN projects run fine on this rig, though I must confess, this is our first time using a dockerized environment with cog, so maybe we're doing something wrong? Anyways, if you could point us to the right place where we can force GPU usage that would be great. Thank you.

dribnet commented 3 years ago

sorry about that. note cog is optional, so you can also try running in a regular python requirement.

geeknik commented 3 years ago

Thank you, we can successfully get it to use our GPU with the command line python3 pixray.py --prompt=prompt --output output.png, however as soon as we add --drawer=pixel we get this error:

Traceback (most recent call last):
  File "/opt/pixray/pixray.py", line 1665, in <module>
    main()
  File "/opt/pixray/pixray.py", line 1660, in main
    settings = apply_settings()    
  File "/opt/pixray/pixray.py", line 1635, in apply_settings
    class_table[settings_core.drawer].add_settings(vq_parser)
KeyError: 'pixel'

However, it works when we run cog run python3 pixray.py --drawer=pixel --prompt=prompt --output output.png, we're just limited to the CPU instead of the GPU.

dribnet commented 3 years ago

looks like you don't have diffvg installed correctly yet. does drawer=vqgan work fine?

geeknik commented 3 years ago

Looks like that was it. What a simple thing that turned out to be. Thanks for helping out!

dribnet commented 3 years ago

Sure - if you can think of any way to make this on boarding less bumpy, happy to accept any pull requests.