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

REFUSES to use my gpu.

Open filzzzz opened this issue 7 months ago • 13 comments

ive tried literally everything, first ill list my issue

ive tried countless times to make it use my gpu using cuda. i have a 3060 ti, and i have installed cuda 11.8 and installed cudnn. ive set my system variables to make sure everything is running properly. it just redirects everything to my cpu. ill post my most recent log

note, ive tried several cudnn versions and ive received that one error that cuda cant load. so im guessing cuda is broken or something. not sure tho my deep live cam does work, but very very slow at around 1 fps without frame enhancer.

Frame processor face_enhancer not found Frame processor face_enhancer not found ← [ 1 ; 3 1 m 2 0 2 5 - 0 5 - 0 5 1 5 : 3 6 : 4 3 . 4 0 9 8 0 2 2 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 2 0 3 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 6 9 5 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ P y t h o n 3 1 0 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l " ← [ m Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: C:\Users\filz/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0 ← [ 1 ; 3 1 m 2 0 2 5 - 0 5 - 0 5 1 5 : 3 6 : 4 3 . 9 0 7 0 6 8 2 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 2 0 3 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 6 9 5 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ P y t h o n 3 1 0 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l " ← [ m Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: C:\Users\filz/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0 ← [ 1 ; 3 1 m 2 0 2 5 - 0 5 - 0 5 1 5 : 3 6 : 4 3 . 9 8 9 3 8 4 9 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 2 0 3 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 6 9 5 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ P y t h o n 3 1 0 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l " ← [ m Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: C:\Users\filz/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0 ← [ 1 ; 3 1 m 2 0 2 5 - 0 5 - 0 5 1 5 : 3 6 : 4 4 . 0 5 2 2 6 8 9 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 2 0 3 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 6 9 5 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ P y t h o n 3 1 0 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l " ← [ m Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: C:\Users\filz/.insightface\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0 ← [ 1 ; 3 1 m 2 0 2 5 - 0 5 - 0 5 1 5 : 3 6 : 4 4 . 1 5 5 7 5 8 2 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 2 0 3 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 6 9 5 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ P y t h o n 3 1 0 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l " ← [ m Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: C:\Users\filz/.insightface\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5 set det-size: (640, 640) [DLC.FACE-SWAPPER] Loading FP32 model: inswapper_128.onnx ← [ 1 ; 3 1 m 2 0 2 5 - 0 5 - 0 5 1 5 : 3 6 : 4 5 . 1 9 0 3 4 6 2 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 2 0 3 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 6 9 5 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ P y t h o n 3 1 0 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l " ← [ m Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} inswapper-shape: [1, 3, 128, 128]

filzzzz avatar May 05 '25 19:05 filzzzz

Have you installed the CUDA toolkit even after installing requirements.txt?

dragonbg avatar May 06 '25 08:05 dragonbg

same GPU (3060 ti) , same problem

victordht avatar May 06 '25 13:05 victordht

Have you installed the CUDA toolkit even after installing requirements.txt? yes, i installed cuda toolkit 11.8, heres a photo.

Image

filzzzz avatar May 06 '25 20:05 filzzzz

Rtx 3070 here, also refuses to use it. Tried reinstalling everything, updating versions, removing all other CUDA versions except the 11.8... can't get it to run properly

gaiablakely avatar May 07 '25 13:05 gaiablakely

I was able to fix that by upgrading some requirements. Here is my working requirements.txt, assuming that you have installed nvidia driver compatible with cuda12.8:

--extra-index-url https://download.pytorch.org/whl/cu128

numpy>=1.23.5,<2
typing-extensions>=4.8.0
opencv-python==4.10.0.84
cv2_enumerate_cameras==1.1.15
onnx==1.16.0
insightface==0.7.3
psutil==5.9.8
tk==0.1.0
customtkinter==5.2.2
pillow==11.0.0
torch
torchvision
onnxruntime-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64'
onnxruntime-gpu==1.21.1; sys_platform != 'darwin'
tensorflow; sys_platform != 'darwin'
opennsfw2==0.10.2
protobuf==4.23.2

brunodoamaral avatar May 07 '25 21:05 brunodoamaral

I was able to fix that by upgrading some requirements. Here is my working requirements.txt, assuming that you have installed nvidia driver compatible with cuda12.8:

--extra-index-url https://download.pytorch.org/whl/cu128

numpy>=1.23.5,<2
typing-extensions>=4.8.0
opencv-python==4.10.0.84
cv2_enumerate_cameras==1.1.15
onnx==1.16.0
insightface==0.7.3
psutil==5.9.8
tk==0.1.0
customtkinter==5.2.2
pillow==11.0.0
torch
torchvision
onnxruntime-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64'
onnxruntime-gpu==1.21.1; sys_platform != 'darwin'
tensorflow; sys_platform != 'darwin'
opennsfw2==0.10.2
protobuf==4.23.2

Image seems to not have worked, i copied your requirements and reran the script to install the requirements.

filzzzz avatar May 07 '25 21:05 filzzzz

I am familiar with this problem . You can solve this by reverting pytorch and cu , Check for the compability. My whatsapp +2347081306010 I can help you fix that remotely if you need my help.

OpenBullet-maker avatar May 07 '25 21:05 OpenBullet-maker

I am familiar with this problem . You can solve this by reverting pytorch and cu , Check for the compability. My whatsapp +2347081306010 I can help you fix that remotely if you need my help.

i tried to fix my pytorch, so i installed a different version and the old one was cpu only. but for some reason it still doesnt work.

filzzzz avatar May 08 '25 02:05 filzzzz

I am familiar with this problem . You can solve this by reverting pytorch and cu , Check for the compability. My whatsapp +2347081306010 I can help you fix that remotely if you need my help.

i tried to fix my pytorch, so i installed a different version and the old one was cpu only. but for some reason it still doesnt work.

That depends ds on how you try to fix your pytorch, write me on whataapp I will show you how

OpenBullet-maker avatar May 08 '25 04:05 OpenBullet-maker

This eventually worked for me on a 3060:

Windows 11 PowerShell (ran as admin)

I removed my previous venv environment to start again:

deactivate Remove-Item -Recurse -Force venv python -m venv venv venv\Scripts\activate pip install -r requirements.txt iex (irm ffmpeg.tc.ht)

Install CUDA Toolkit 11.8.0 for Windows

  • https://developer.nvidia.com/cuda-11-8-0-download-archive

Download cuDNN for CUDA 11.8:

  • https://developer.nvidia.com/cudnn
  • cudnn-windows-x86_64-8.9.7.29_cuda11-archive
  • Extract the contents and copy the files to your CUDA installation (I believe this to be the key to the whole thing!)

Copy bin/*.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin Copy include/* to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include Copy lib/x64/* to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64

pip uninstall torch torchvision pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118

copy CUDA DLLs to a location in your PATH: copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\*.dll" "C:\Windows\System32\"

Current requirements.txt file lists 1.17 - but 1.16.3 worked better for me pip install onnxruntime-gpu==1.16.3

When trying to run python run.py --execution-provider cuda, it complained I needed pygrabber. pip install pygrabber

Finally it worked python run.py --execution-provider cuda

You can check if Cuda is available via these PowerShell commands: python -c "import torch; print(torch.cuda.is_available())" python -c "import onnxruntime as ort; print(ort.get_device())"

daz-williams avatar May 08 '25 18:05 daz-williams

This eventually worked for me on a 3060:

Windows 11 PowerShell (ran as admin)

I removed my previous venv environment to start again:

deactivate Remove-Item -Recurse -Force venv python -m venv venv venv\Scripts\activate pip install -r requirements.txt iex (irm ffmpeg.tc.ht)

Install CUDA Toolkit 11.8.0 for Windows

  • https://developer.nvidia.com/cuda-11-8-0-download-archive

Download cuDNN for CUDA 11.8:

  • https://developer.nvidia.com/cudnn
  • cudnn-windows-x86_64-8.9.7.29_cuda11-archive
  • Extract the contents and copy the files to your CUDA installation (I believe this to be the key to the whole thing!)

Copy bin/*.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin Copy include/* to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include Copy lib/x64/* to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64

pip uninstall torch torchvision pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118

copy CUDA DLLs to a location in your PATH: copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\*.dll" "C:\Windows\System32\"

Current requirements.txt file lists 1.17 - but 1.16.3 worked better for me pip install onnxruntime-gpu==1.16.3

When trying to run python run.py --execution-provider cuda, it complained I needed pygrabber. pip install pygrabber

Finally it worked python run.py --execution-provider cuda

You can check if Cuda is available via these PowerShell commands: python -c "import torch; print(torch.cuda.is_available())" python -c "import onnxruntime as ort; print(ort.get_device())"

this made it worse for me unfortunately, now it says my cuda doesnt work at all. i already did all of these things before but i tried it again and it didnt work

filzzzz avatar May 08 '25 19:05 filzzzz

this made it worse for me unfortunately, now it says my cuda doesnt work at all. i already did all of these things before but i tried it again and it didnt work

Damn, sorry man. Eventually worked for me...

Did this part install ok, or did it error for you?

pip uninstall torch torchvision
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118

Also, does your Windows 11 Environment Vars look like this?

Image

daz-williams avatar May 08 '25 21:05 daz-williams

this made it worse for me unfortunately, now it says my cuda doesnt work at all. i already did all of these things before but i tried it again and it didnt work

Damn, sorry man. Eventually worked for me...

Did this part install ok, or did it error for you?

pip uninstall torch torchvision
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118

Also, does your Windows 11 Environment Vars look like this?

Image

i have changed my system variables, although no they do not look exactly like that. I copied some of your stuff, although i dont have all the things you have which could be a potential issue. I have the most important ones like cuda, ffmpeg, and some other specific things but theres also stuff i dont have. do you know which ones i need for it to run with gpu? im also on windows 10 and ChatGPT told me to install pytorch with GPU, it installed perfectly fine.

filzzzz avatar May 10 '25 01:05 filzzzz