mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 13:32:09 -07:00
fix long load when using various gpus in the same DFL folder
This commit is contained in:
parent
540650c610
commit
818a2d65f0
1 changed files with 15 additions and 7 deletions
|
@ -1,15 +1,18 @@
|
||||||
|
import contextlib
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import contextlib
|
from pathlib import Path
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from .CAInitializer import CAGenerateWeights
|
|
||||||
import multiprocessing
|
|
||||||
from joblib import Subprocessor
|
|
||||||
|
|
||||||
from utils import std_utils
|
|
||||||
from .device import device
|
|
||||||
from interact import interact as io
|
from interact import interact as io
|
||||||
|
from joblib import Subprocessor
|
||||||
|
from utils import std_utils
|
||||||
|
|
||||||
|
from .CAInitializer import CAGenerateWeights
|
||||||
|
from .device import device
|
||||||
|
|
||||||
|
|
||||||
class nnlib(object):
|
class nnlib(object):
|
||||||
device = device #forwards nnlib.devicelib to device in order to use nnlib as standalone lib
|
device = device #forwards nnlib.devicelib to device in order to use nnlib as standalone lib
|
||||||
|
@ -173,6 +176,11 @@ NLayerDiscriminator = nnlib.NLayerDiscriminator
|
||||||
os.environ.pop('CUDA_VISIBLE_DEVICES')
|
os.environ.pop('CUDA_VISIBLE_DEVICES')
|
||||||
|
|
||||||
os.environ['CUDA_CACHE_MAXSIZE'] = '536870912' #512Mb (32mb default)
|
os.environ['CUDA_CACHE_MAXSIZE'] = '536870912' #512Mb (32mb default)
|
||||||
|
|
||||||
|
if sys.platform[0:3] == 'win':
|
||||||
|
if len(device_config.gpu_idxs) == 1:
|
||||||
|
os.environ['CUDA_CACHE_PATH'] = \
|
||||||
|
str(Path(os.environ['APPDATA']) / 'NVIDIA' / ('ComputeCache_' + device_config.gpu_names[0].replace(' ','_')))
|
||||||
|
|
||||||
os.environ['TF_MIN_GPU_MULTIPROCESSOR_COUNT'] = '2'
|
os.environ['TF_MIN_GPU_MULTIPROCESSOR_COUNT'] = '2'
|
||||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #tf log errors only
|
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #tf log errors only
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue