Faceswap not using GPU

If training is failing to start, and you are not receiving an error message telling you what to do, tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Training process. If you want to get tips, or better understand the Training process, then you should look in the Training Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
anseltrust
Posts: 3
Joined: Wed Aug 28, 2024 9:17 am
Answers: 0
Has thanked: 1 time

faceswap 3 is using cpu and not using my gpu

Post by anseltrust »

While training it uses my cpu and not using my gpu, or it is using my gpu but it's not fast so am i expecting too much? how can I avoid this?

My pc specs are;
NVIDIA RTX 4070 LAPTOP 8GB VRAM
32GB RAM
12TH GEN INTEL I7-12650H 16 CPUs 2.3ghz

I'm a beginner, I would appreciate any help and tips about faceswap:)

Attachments
ikinci.png
ikinci.png (66.38 KiB) Viewed 17950 times
ucuncu.png
ucuncu.png (292.22 KiB) Viewed 17950 times
User avatar
JDBAU
Posts: 15
Joined: Wed Apr 24, 2024 6:00 pm
Answers: 0
Has thanked: 4 times
Been thanked: 2 times

Re: faceswap 3 is using cpu and not using my gpu

Post by JDBAU »

Upload a screenshot of your GPU usage. Chance are the GPU memory is maxed out but the core is not being utilised much.

User avatar
Kappanator
Posts: 2
Joined: Fri Dec 27, 2024 2:41 pm
Answers: 0

Faceswap not using GPU

Post by Kappanator »

Hello, was wondering if anyone can check my issue. I've applied the steps mentioned in the FAQ and check as well as old threads with the same issue but it seems Faceswap just doesn't seem to use my GPU during extraction and training. I tried running deepfacelab separately to compare and the SAEHD training batch file there uses my GPU just fine. Any idea on this one?

Update faceswap: I tried manually installing 11.2 since I got the warning below but doesn't seem to do anything. Altho nvidia-smi says I have CUDA 12.7.

Code: Select all

12/29/2024 22:01:04 INFO     Checking for updates...
12/29/2024 22:01:06 INFO     Faceswap is up to date.
12/29/2024 22:01:06 INFO     Updating dependencies...
12/29/2024 22:01:06 INFO     Setup in Windows 10
12/29/2024 22:01:06 INFO     Installed Python: 3.10.16 64bit
12/29/2024 22:01:06 INFO     Running in Conda
12/29/2024 22:01:06 INFO     Running in a Virtual Environment
12/29/2024 22:01:06 INFO     Encoding: cp1252
12/29/2024 22:01:06 INFO     Installed pip: 24.2
12/29/2024 22:01:06 INFO     Adding conda required package 'zlib-wapi' for backend 'nvidia')
12/29/2024 22:01:06 INFO     Adding conda required package '['cudatoolkit>=11.2,<11.3', 'cudnn>=8.1,<8.2']' for backend 'nvidia')
12/29/2024 22:01:08 INFO     Installing Required Python Packages. This may take some time...
12/29/2024 22:01:08 INFO     Installing Required Conda Packages. This may take some time...
12/29/2024 22:01:08 INFO     Installing cudatoolkit>=11.2,<11.3 cudnn>=8.1,<8.2


12/29/2024 22:01:11 WARNING  Couldn't install ['"cudatoolkit>=11.2,<11.3"', '"cudnn>=8.1,<8.2"'] with Conda. Please install this package manually
12/29/2024 22:01:11 INFO     Dependencies updated

System info:

Code: Select all

============ System Information ============
backend:             nvidia
encoding:            cp1252
git_branch:          master
git_commits:         41b61f9 Update README.md
gpu_cuda:            No global version found. Check Conda packages for Conda Cuda
gpu_cudnn:           No global version found. Check Conda packages for Conda cuDNN
gpu_devices:         GPU_0: NVIDIA GeForce RTX 4060 Ti
gpu_devices_active:  GPU_0
gpu_driver:          566.36
gpu_vram:            GPU_0: 8188MB (7336MB free)
os_machine:          AMD64
os_platform:         Windows-10-10.0.22631-SP0
os_release:          10
py_command:          C:\faceswap/faceswap.py gui
py_conda_version:    conda 24.11.2
py_implementation:   CPython
py_version:          3.10.16
py_virtual_env:      True
sys_cores:           16
sys_processor:       Intel64 Family 6 Model 183 Stepping 1, GenuineIntel
sys_ram:             Total: 32603MB, Available: 23875MB, Used: 8727MB, Free: 23878MB

=============== Pip Packages ===============
absl-py==2.1.0
astunparse==1.6.3
cachetools==5.5.0
certifi==2024.12.14
charset-normalizer==3.4.1
colorama==0.4.6
contourpy==1.3.1
cycler==0.12.1
fastcluster==1.2.6
ffmpy==0.5.0
flatbuffers==24.12.23
fonttools==4.55.3
gast==0.4.0
google-auth==2.37.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.68.1
h5py==3.12.1
idna==3.10
imageio==2.36.1
imageio-ffmpeg==0.5.1
joblib==1.4.2
keras==2.10.0
Keras-Preprocessing==1.1.2
kiwisolver==1.4.8
libclang==18.1.1
Markdown==3.7
MarkupSafe==3.0.2
matplotlib==3.10.0
numexpr==2.10.2
numpy==1.26.4
nvidia-ml-py==12.560.30
oauthlib==3.2.2
opencv-python==4.10.0.84
opt_einsum==3.4.0
packaging==24.2
Pillow==9.5.0
protobuf==3.19.6
psutil==6.1.1
pyasn1==0.6.1
pyasn1_modules==0.4.1
pyparsing==3.2.0
python-dateutil==2.9.0.post0
pywin32==308
pywinpty @ file:///C:/ci_310/pywinpty_1644230983541/work/target/wheels/pywinpty-2.0.2-cp310-none-win_amd64.whl
requests==2.32.3
requests-oauthlib==2.0.0
rsa==4.9
scikit-learn==1.6.0
scipy==1.14.1
six==1.17.0
tensorboard==2.10.1
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.10.1
tensorflow-estimator==2.10.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.5.0
threadpoolctl==3.5.0
tqdm==4.67.1
typing_extensions==4.12.2
urllib3==2.3.0
Werkzeug==3.1.3
wrapt==1.17.0

============== Conda Packages ==============
# packages in environment at C:\Users\Admin\MiniConda3\envs\faceswap:
#
# Name                    Version                   Build  Channel
absl-py                   2.1.0                    pypi_0    pypi
astunparse                1.6.3                    pypi_0    pypi
bzip2                     1.0.8                h2bbff1b_6  
ca-certificates 2024.12.14 h56e8100_0 conda-forge cachetools 5.5.0 pypi_0 pypi certifi 2024.12.14 pypi_0 pypi charset-normalizer 3.4.1 pypi_0 pypi colorama 0.4.6 pypi_0 pypi contourpy 1.3.1 pypi_0 pypi cycler 0.12.1 pypi_0 pypi fastcluster 1.2.6 pypi_0 pypi ffmpy 0.5.0 pypi_0 pypi flatbuffers 24.12.23 pypi_0 pypi fonttools 4.55.3 pypi_0 pypi gast 0.4.0 pypi_0 pypi git 2.45.2 haa95532_1
google-auth 2.37.0 pypi_0 pypi google-auth-oauthlib 0.4.6 pypi_0 pypi google-pasta 0.2.0 pypi_0 pypi grpcio 1.68.1 pypi_0 pypi h5py 3.12.1 pypi_0 pypi idna 3.10 pypi_0 pypi imageio 2.36.1 pypi_0 pypi imageio-ffmpeg 0.5.1 pypi_0 pypi joblib 1.4.2 pypi_0 pypi keras 2.10.0 pypi_0 pypi keras-preprocessing 1.1.2 pypi_0 pypi kiwisolver 1.4.8 pypi_0 pypi libclang 18.1.1 pypi_0 pypi libffi 3.4.4 hd77b12b_1
liblzma 5.6.3 h2466b09_1 conda-forge libsqlite 3.47.2 h67fdade_0 conda-forge libzlib 1.3.1 h2466b09_2 conda-forge libzlib-wapi 1.3.1 h2466b09_2 conda-forge markdown 3.7 pypi_0 pypi markupsafe 3.0.2 pypi_0 pypi matplotlib 3.10.0 pypi_0 pypi numexpr 2.10.2 pypi_0 pypi numpy 1.26.4 pypi_0 pypi nvidia-ml-py 12.560.30 pypi_0 pypi oauthlib 3.2.2 pypi_0 pypi opencv-python 4.10.0.84 pypi_0 pypi openssl 3.4.0 h2466b09_0 conda-forge opt-einsum 3.4.0 pypi_0 pypi packaging 24.2 pypi_0 pypi pillow 9.5.0 pypi_0 pypi pip 24.2 py310haa95532_0
protobuf 3.19.6 pypi_0 pypi psutil 6.1.1 pypi_0 pypi pyasn1 0.6.1 pypi_0 pypi pyasn1-modules 0.4.1 pypi_0 pypi pyparsing 3.2.0 pypi_0 pypi python 3.10.16 h37870fc_1_cpython conda-forge python-dateutil 2.9.0.post0 pypi_0 pypi pywin32 308 pypi_0 pypi pywinpty 2.0.2 py310h5da7b33_0
requests 2.32.3 pypi_0 pypi requests-oauthlib 2.0.0 pypi_0 pypi rsa 4.9 pypi_0 pypi scikit-learn 1.6.0 pypi_0 pypi scipy 1.14.1 pypi_0 pypi setuptools 75.1.0 py310haa95532_0
six 1.17.0 pypi_0 pypi sqlite 3.45.3 h2bbff1b_0
tensorboard 2.10.1 pypi_0 pypi tensorboard-data-server 0.6.1 pypi_0 pypi tensorboard-plugin-wit 1.8.1 pypi_0 pypi tensorflow 2.10.1 pypi_0 pypi tensorflow-estimator 2.10.0 pypi_0 pypi tensorflow-io-gcs-filesystem 0.31.0 pypi_0 pypi termcolor 2.5.0 pypi_0 pypi threadpoolctl 3.5.0 pypi_0 pypi tk 8.6.13 h5226925_1 conda-forge tqdm 4.67.1 pypi_0 pypi typing-extensions 4.12.2 pypi_0 pypi tzdata 2024b h04d1e81_0
ucrt 10.0.22621.0 h57928b3_1 conda-forge urllib3 2.3.0 pypi_0 pypi vc 14.40 haa95532_2
vc14_runtime 14.42.34433 he29a5d6_23 conda-forge vs2015_runtime 14.42.34433 hdffcdeb_23 conda-forge werkzeug 3.1.3 pypi_0 pypi wheel 0.44.0 py310haa95532_0
winpty 0.4.3 4
wrapt 1.17.0 pypi_0 pypi xz 5.4.6 h8cc25b3_1
zlib 1.3.1 h2466b09_2 conda-forge zlib-wapi 1.3.1 h2466b09_2 conda-forge

dxdiag:

Code: Select all

------------------
System Information
------------------
      Time of this report: 12/29/2024, 22:03:44
             Machine name: DESKTOP-R36PH5T
               Machine Id: {D36039C2-3229-4052-B488-4BA83077E3B4}
         Operating System: Windows 11 Pro 64-bit (10.0, Build 22631) (22621.ni_release.220506-1250)
                 Language: English (Regional Setting: English)
      System Manufacturer: Gigabyte Technology Co., Ltd.
             System Model: B760M DS3H AX
                     BIOS: F16 (type: UEFI)
                Processor: Intel(R) Core(TM) i5-14400F (16 CPUs), ~2.5GHz
                   Memory: 32768MB RAM
      Available OS Memory: 32604MB RAM
                Page File: 10878MB used, 23773MB available
              Windows Dir: C:\Windows
          DirectX Version: DirectX 12
      DX Setup Parameters: Not found
         User DPI Setting: 96 DPI (100 percent)
       System DPI Setting: 96 DPI (100 percent)
          DWM DPI Scaling: Disabled
                 Miracast: Available, no HDCP
Microsoft Graphics Hybrid: Not Supported
 DirectX Database Version: 1.6.4
           DxDiag Version: 10.00.22621.3527 64bit Unicode

---------------
Display Devices
---------------
           Card name: NVIDIA GeForce RTX 4060 Ti
        Manufacturer: NVIDIA
           Chip type: NVIDIA GeForce RTX 4060 Ti
            DAC type: Integrated RAMDAC
         Device Type: Full Device (POST)
          Device Key: Enum\PCI\VEN_10DE&DEV_2803&SUBSYS_41061458&REV_A1
       Device Status: 0180200A [DN_DRIVER_LOADED|DN_STARTED|DN_DISABLEABLE|DN_NT_ENUMERATOR|DN_NT_DRIVER] 
 Device Problem Code: No Problem
 Driver Problem Code: Unknown
      Display Memory: 24250 MB
    Dedicated Memory: 7949 MB
       Shared Memory: 16301 MB
User avatar
sash009
Posts: 1
Joined: Tue Mar 11, 2025 2:33 pm
Answers: 0

This program does not use the graphics processor

Post by sash009 »

I reinstalled the program several times. I uninstalled it according to the instructions, but there was no Python folder in the path C:\users\[your username]\AppData\Roaming

Image

Last edited by sash009 on Wed Mar 12, 2025 9:12 am, edited 2 times in total.
User avatar
cornflaketenders
Posts: 2
Joined: Fri Apr 04, 2025 8:42 am
Answers: 0

GPU not being utilized

Post by cornflaketenders »

Did a fresh install via the installer, but GPU doesn't seem to be utilized at all when running, only CPU. What am I missing here?

Image

User avatar
cornflaketenders
Posts: 2
Joined: Fri Apr 04, 2025 8:42 am
Answers: 0

Re: GPU not being utilized

Post by cornflaketenders »

After doing some digging, it appears that the installer failed to install cudatoolkit and cudnn. After installing manually through conda, everything looks fine, but the installer should probably be updated.

User avatar
jiang
Posts: 1
Joined: Sun Apr 13, 2025 4:36 pm
Answers: 0

RTX4070 getting a mixed_float16 error,thank you

Post by jiang »

Hi, my PC is configured with an RTX 4070 and an Intel i7-13700. During installation, I selected the NVIDIA GPU option. However, when I started training, I noticed the following issues: the CPU usage is at 100%, while GPU usage remains between 0–3%. I also checked the backend monitor to confirm this.

I’ve tried reinstalling, but the problem still persists. Could you please advise me on how to fix this?

Thank you very much for your help!
(I’m from Taiwan, and my English may not be perfect — :| thank you for your understanding.) :| :|

Loading...
Setting Faceswap backend to NVIDIA
04/14/2025 00:16:22 INFO Log level set to: INFO
04/14/2025 00:16:25 INFO Model A Directory: 'D:\112\113\swap\a' (98 images)
04/14/2025 00:16:25 INFO Model B Directory: 'D:\112\113\swap\b' (116 images)
04/14/2025 00:16:25 WARNING At least one of your input folders contains fewer than 250 images. Results are likely to be poor.
04/14/2025 00:16:25 WARNING You need to provide a significant number of images to successfully train a Neural Network. Aim for between 500 - 5000 images per side.
04/14/2025 00:16:25 INFO Training data directory: D:\112\113\swap\c
04/14/2025 00:16:25 INFO ===================================================
04/14/2025 00:16:25 INFO Starting
04/14/2025 00:16:25 INFO ===================================================
04/14/2025 00:16:26 INFO Loading data, this may take a while...
04/14/2025 00:16:26 INFO Loading Model from Original plugin...
04/14/2025 00:16:26 INFO No existing state file found. Generating.
04/14/2025 00:16:26 INFO Storing Mixed Precision compatible layers. Please ignore any following warnings about using mixed precision.
04/14/2025 00:16:26 WARNING Mixed precision compatibility check (mixed_float16): WARNING
The dtype policy mixed_float16 may run slowly because this machine does not have a GPU. Only Nvidia GPUs with compute capability of at least 7.0 run quickly with mixed_float16.
If you will use compatible GPU(s) not attached to this host, e.g. by running a multi-worker model, you can ignore this warning. This message will only be logged once

User avatar
torzdf
Posts: 2796
Joined: Fri Jul 12, 2019 12:53 am
Answers: 160
Has thanked: 142 times
Been thanked: 650 times

Re: faceswap 3 is using cpu and not using my gpu

Post by torzdf »

My word is final

User avatar
torzdf
Posts: 2796
Joined: Fri Jul 12, 2019 12:53 am
Answers: 160
Has thanked: 142 times
Been thanked: 650 times

Re: Faceswap not using GPU

Post by torzdf »

This was a regression caused by an updated in how MiniConda handles requirements.

If you re-install faceswap, it should now work.

If you still have issues please provide the newest faceswap_setup.log from your faceswap folder

My word is final

Post Reply