mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-22 14:24:40 -07:00
fix for TCC mode cards(tesla), was conflict with plaidML initialization.
This commit is contained in:
parent
0bdba117ef
commit
7fe4cd4643
1 changed files with 29 additions and 23 deletions
|
@ -274,8 +274,12 @@ has_nvml_cap = False
|
||||||
#- CUDA build of DFL
|
#- CUDA build of DFL
|
||||||
has_nvidia_device = os.environ.get("DFL_FORCE_HAS_NVIDIA_DEVICE", "0") == "1"
|
has_nvidia_device = os.environ.get("DFL_FORCE_HAS_NVIDIA_DEVICE", "0") == "1"
|
||||||
|
|
||||||
|
plaidML_devices = None
|
||||||
|
def get_plaidML_devices():
|
||||||
|
global plaidML_devices
|
||||||
|
global has_nvidia_device
|
||||||
|
if plaidML_devices is None:
|
||||||
plaidML_devices = []
|
plaidML_devices = []
|
||||||
|
|
||||||
# Using plaidML OpenCL backend to determine system devices and has_nvidia_device
|
# Using plaidML OpenCL backend to determine system devices and has_nvidia_device
|
||||||
try:
|
try:
|
||||||
os.environ['PLAIDML_EXPERIMENTAL'] = 'false' #this enables work plaidML without run 'plaidml-setup'
|
os.environ['PLAIDML_EXPERIMENTAL'] = 'false' #this enables work plaidML without run 'plaidml-setup'
|
||||||
|
@ -294,8 +298,10 @@ try:
|
||||||
ctx.shutdown()
|
ctx.shutdown()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
return plaidML_devices
|
||||||
|
|
||||||
plaidML_devices_count = len(plaidML_devices)
|
if not has_nvidia_device:
|
||||||
|
get_plaidML_devices()
|
||||||
|
|
||||||
#choosing backend
|
#choosing backend
|
||||||
|
|
||||||
|
@ -324,7 +330,7 @@ if device.backend is None and not force_tf_cpu:
|
||||||
|
|
||||||
if force_plaidML or (device.backend is None and not has_nvidia_device):
|
if force_plaidML or (device.backend is None and not has_nvidia_device):
|
||||||
#tensorflow backend was failed without has_nvidia_device , or forcing plaidML, trying to use plaidML backend
|
#tensorflow backend was failed without has_nvidia_device , or forcing plaidML, trying to use plaidML backend
|
||||||
if plaidML_devices_count == 0:
|
if len(get_plaidML_devices()) == 0:
|
||||||
#print ("plaidML: No capable OpenCL devices found. Falling back to tensorflow backend.")
|
#print ("plaidML: No capable OpenCL devices found. Falling back to tensorflow backend.")
|
||||||
device.backend = None
|
device.backend = None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue