GPU don't work when program aren't started in anaconda

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
wsyn470
Posts: 8
Joined: Mon Feb 13, 2023 4:46 am
Has thanked: 1 time

GPU don't work when program aren't started in anaconda

Post by wsyn470 »

GPU can work when program are started in anaconda(environments-faceswap-open terminal-python faceswap.py gui).
But if I start the program by desktop shortcut(%USERPROFILE%\Anaconda3\envs\faceswap\python.exe %USERPROFILE%/faceswap/faceswap.py gui), the usage rate of GPU flash is 0 and the usage rate of CPU is very high.
I don't know why.

by torzdf » Mon Nov 06, 2023 12:49 pm

The reason is that the Conda environment needs to be activated. Just referencing the correct python library is not enough.

When the Conda environment is activated, some other actions are also executed, which means that Faceswap can find the Cuda/cuDNN libraries stored within the environment.

If you change your shortcut to :

Code: Select all

%USERPROFILE%\Anaconda3\scripts\activate.bat && conda activate faceswap && python %USERPROFILE%/faceswap/faceswap.py gui

it should work

Go to full post
User avatar
torzdf
Posts: 2687
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 135 times
Been thanked: 628 times

Re: GPU don't work when program aren't started in anaconda

Post by torzdf »

The reason is that the Conda environment needs to be activated. Just referencing the correct python library is not enough.

When the Conda environment is activated, some other actions are also executed, which means that Faceswap can find the Cuda/cuDNN libraries stored within the environment.

If you change your shortcut to :

Code: Select all

%USERPROFILE%\Anaconda3\scripts\activate.bat && conda activate faceswap && python %USERPROFILE%/faceswap/faceswap.py gui

it should work

Last edited by torzdf on Mon Nov 06, 2023 12:50 pm, edited 1 time in total.

My word is final

Post Reply