Page 1 of 1
GPU don't work when program aren't started in anaconda
Posted: Mon Nov 06, 2023 11:03 am
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.
Re: GPU don't work when program aren't started in anaconda
Posted: Mon Nov 06, 2023 12:49 pm
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