iperov / DeepFaceLive

Real-time face swap for PC streaming or video calls
GNU General Public License v3.0
25.79k stars 4.36k forks source link

No GPU option for Face Merger under linux #89

Closed hcker2000 closed 1 year ago

hcker2000 commented 1 year ago

I have GPU options for everything else that I should except the Face Merger.

image
iperov commented 1 year ago

looks like no OpenCL driver installed in linux

hcker2000 commented 1 year ago

looks like no OpenCL driver installed in linux

I installed nvidia-opencl-icd-384 and rebooted but now it just crashes at the start with:

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown.

iperov commented 1 year ago

@CeeBeeEh do you know what to install for generic compatible OpenCL 1.2 ?

CeeBeeEh commented 1 year ago

@iperov I just created a PR (https://github.com/iperov/DeepFaceLive/pull/90) to get OpenCL support into the container. There seems to be some oddity with how Nvidia handles OpenCL in their containers. It seems they didn't even support it as of a few years ago. Technically, manually installing driver libraries in the container is not the way to go, but the fix I put in is a serviceable workaround. I'll look for a "better" solution in the meantime.

Just a quick note: I have only tested this workaround on my desktop (Ubuntu 22.04) for now. ~I'll try to test on my laptop (EndeavourOS) over the weekend.~ I tested the latest PR (https://github.com/iperov/DeepFaceLive/pull/91) on my laptop as well and it works.

@hcker2000 I have a feeling that your host Nvidia driver is broken now. I would bet that nvidia-smi will not show proper output. If that's the case, try to reinstall the Nvidia drivers to get back into a working state. Just a reference for the future, for Nvidia containers all you need on the host is the Nvidia driver. Everything else (CUDA libraries, cudNN, etc) will be provided by the container itself. So as long as nvidia-smi gives you sane outputs, your host is good to go.

CeeBeeEh commented 1 year ago

Just tested on my laptop, and throwing an error "Exception: Unable to create OpenCL context" when selecting GPU under "Face merger". Will look into this further.

Nm, I had "Face animator" enabled at the same time. Turned off "Face animator" and it works now.

Submitting another PR soon that will make getting the Nvidia driver version more robust across distros

iperov commented 1 year ago

@CeeBeeEh thank you

hcker2000 commented 1 year ago

@CeeBeeEh I went ahead and removed OpenCL and re-installed the normal drivers all good. cant wait to try this once the pull request makes it in.