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.55k stars 5.77k forks source link

can`t use cuda .other way to use GPU also not work #544

Closed qziov closed 2 months ago

qziov commented 2 months ago

D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam>python run.py --execution-provider cuda 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] [--nsfw-filter] [--video-encoder {libx264,libx265,libvpx-vp9}] [--video-quality [0-51]] [--live-mirror] [--live-resizable] [--max-memory MAX_MEMORY] [--execution-provider {azure,cpu} [{azure,cpu} ...]] [--execution-threads EXECUTION_THREADS] [-v] run.py: error: argument --execution-provider: invalid choice: 'cuda' (choose from 'azure', 'cpu')

qziov commented 2 months ago

2024-09-05 14:08:51.2185148 [E:onnxruntime:Default, provider_bridge_ort.cc:1480 onnxruntime::TryGetProviderInfo_CUDA] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1193 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"

EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:743 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported. when using ['CUDAExecutionProvider'] Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying. 2024-09-05 14:08:51.3438087 [E:onnxruntime:Default, provider_bridge_ort.cc:1480 onnxruntime::TryGetProviderInfo_CUDA] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1193 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"

Exception in Tkinter callback Traceback (most recent call last): File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 463, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) RuntimeError: D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:743 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python310\lib\tkinter__init.py", line 1921, in call return self.func(*args) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked self._command() File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\modules\ui.py", line 111, in preview_button = ctk.CTkButton(root, text='Preview', cursor='hand2', command=lambda: toggle_preview()) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\modules\ui.py", line 287, in toggle_preview update_preview() File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\modules\ui.py", line 308, in update_preview get_one_face(cv2.imread(modules.globals.source_path)), File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\modules\face_analyser.py", line 20, in get_one_face face = get_face_analyser().get(frame) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\modules\face_analyser.py", line 14, in get_face_analyser FACE_ANALYSER = insightface.app.FaceAnalysis(name='buffalo_l', providers=modules.globals.execution_providers) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\insightface\app\face_analysis.py", line 31, in init model = model_zoo.get_model(onnx_file, kwargs) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\insightface\model_zoo\model_zoo.py", line 96, in get_model model = router.get_model(providers=providers, provider_options=provider_options) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\insightface\model_zoo\model_zoo.py", line 40, in get_model session = PickableInferenceSession(self.onnx_file, kwargs) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\insightface\model_zoo\model_zoo.py", line 25, in init super().init(model_path, **kwargs) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 430, in init raise fallback_error from e File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 425, in init__ self._create_inference_session(self._fallback_providers, None) File "D:\ASoftwarespace\pythonProject\CatchFace\Deep-Live-Cam\myvenv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 463, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) RuntimeError: D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:743 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

new issue

qziov commented 2 months ago

i am already set PATH about cuda

novichuk commented 3 weeks ago

I have the same problem

EyedressT commented 1 week ago

Solving problem oxnruntime version is 1.18.0 oxntuntime-gpu version - 1.18.0 The protobuf version is 5.28.3 Remove all current versions of CUDNN and CUDA Download CUDA 11.8 and install https://developer.nvidia.com/cuda-11-8-0-download-archive Download CUDNN version 8.6 for CUDA 11.x even more (October 3, 2022), transfer what from the archive to C:\Program Files\Nvidia GPU Computing Toolkit\CUDA\v11. 8

https://developer.nvidia.com/rdp/cudnn-archive

Next, search for "system" in Windows -> "Advanced system settings" (on the right, in small text) -> "Environment Variables" -> Add the path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin" to both tables -> Save

Run with python parameters run.py --execution-provider cuda