Deep-Live-Cam icon indicating copy to clipboard operation
Deep-Live-Cam copied to clipboard

Feature Request: Add Support for AMD GPUs

Open TheRedCyclops opened this issue 1 year ago • 10 comments

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

TheRedCyclops avatar Aug 15 '24 08:08 TheRedCyclops

I'm waiting for this too.

vodangtue avatar Aug 15 '24 08:08 vodangtue

I'm waiting for this too.

solstice-gao avatar Aug 15 '24 09:08 solstice-gao

I think the directML should work with AMD

yosr481 avatar Aug 15 '24 12:08 yosr481

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%.

TiberiusMars avatar Aug 16 '24 00:08 TiberiusMars

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

laggggggg avatar Aug 16 '24 01:08 laggggggg

Waiting for this

cjr60013255 avatar Aug 17 '24 19:08 cjr60013255

Waiting for this too.

d1stru3t0r avatar Aug 17 '24 21:08 d1stru3t0r

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.

vodangtue avatar Aug 18 '24 03:08 vodangtue

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

yosr481 avatar Aug 18 '24 07:08 yosr481

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).

skrohit22087 avatar Aug 19 '24 11:08 skrohit22087