hacksider / Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image
GNU Affero General Public License v3.0
39.29k stars 5.72k forks source link

Feature Request: Add Support for AMD GPUs #333

Closed TheRedCyclops closed 1 week ago

TheRedCyclops commented 2 months ago

I know it's a big ask, but it would be great if support for AMD GPUs would be considered for this project.

vodangtue commented 2 months ago

I'm waiting for this too.

solstice-gao commented 2 months ago

I'm waiting for this too.

yosr481 commented 2 months ago

I think the directML should work with AMD

TiberiusMars commented 2 months ago

Trying to use directml with AMD gives me this:

`python run.py --execution-provider directml

usage: run.py [-h] [-s SOURCE_PATH] [-t TARGET_PATH] [-o OUTPUT_PATH] [--frame-processor {face_swapper,face_enhancer} [{face_swapper,face_enhancer} ...]] [--keep-fps] [--keep-audio] [--keep-frames] [--many-faces] [--video-encoder {libx264,libx265,libvpx-vp9}] [--video-quality [0-51]] [--max-memory MAX_MEMORY] [--execution-provider {dml,cpu} [{dml,cpu} ...]] [--execution-threads EXECUTION_THREADS] [-v] run.py: error: argument --execution-provider: invalid choice: 'directml' (choose from 'dml', 'cpu')`

Using python run.py --execution-provider dml works well and fast for "Preview" until you set everything up and press "Start" - it crashes right after this line:

Processing: 0%| | 0/188 [00:00<?, ?frame/s, execution_providers=['DmlExecutionProvider'], execution_threads=8, max_me

It never gets to 1%.

laggggggg commented 2 months ago

Identical issues to TiberiusMars with my RX 6650xt, including using dml.

cjr60013255 commented 2 months ago

Waiting for this

d1stru3t0r commented 2 months ago

Waiting for this too.

vodangtue commented 2 months ago

I can use AMD GPU with directml. It work perfectly until face enhancer enabled, when face enhancer enabled it not use any GPU or CPU and it generate very slow.

yosr481 commented 2 months ago

Trying to use directml with AMD gives me this:

`python run.py --execution-provider directml

usage: run.py [-h] [-s SOURCE_PATH] [-t TARGET_PATH] [-o OUTPUT_PATH] [--frame-processor {face_swapper,face_enhancer} [{face_swapper,face_enhancer} ...]] [--keep-fps] [--keep-audio] [--keep-frames] [--many-faces] [--video-encoder {libx264,libx265,libvpx-vp9}] [--video-quality [0-51]] [--max-memory MAX_MEMORY] [--execution-provider {dml,cpu} [{dml,cpu} ...]] [--execution-threads EXECUTION_THREADS] [-v] run.py: error: argument --execution-provider: invalid choice: 'directml' (choose from 'dml', 'cpu')`

Using python run.py --execution-provider dml works well and fast for "Preview" until you set everything up and press "Start" - it crashes right after this line:

Processing: 0%| | 0/188 [00:00<?, ?frame/s, execution_providers=['DmlExecutionProvider'], execution_threads=8, max_me

It never gets to 1%.

Maybe try to play with other parameters, like video quality, or the encoder

skrohit22087 commented 2 months ago

it does work on my 6500m using directml.

Try running with python run.py --execution-provider dml --execution-threads 1 --max-memory 4 and increase the value of threads and max-memory according to you gpu's vram usage(for failsafe launch by set threads 1 and max memory lower than your vram first time). and if you are using nsfw content uncomment nsfw options from ui.py in \Deep-Live-Cam\modules location and select nsfw in app(otherwise it may crash).