mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-13 08:33:50 -07:00
fix nnlib/device.py for some notebooks
This commit is contained in:
parent
ac5ac75645
commit
7db469a1da
1 changed files with 8 additions and 3 deletions
|
@ -260,7 +260,12 @@ class device:
|
||||||
force_plaidML = os.environ.get("force_plaidML", "0") == "1"
|
force_plaidML = os.environ.get("force_plaidML", "0") == "1"
|
||||||
has_nvml = False
|
has_nvml = False
|
||||||
has_nvml_cap = False
|
has_nvml_cap = False
|
||||||
|
|
||||||
|
#use force_has_nvidia_device=1 if
|
||||||
|
#- your NVIDIA cannot be seen by OpenCL
|
||||||
|
#- CUDA build of DFL
|
||||||
has_nvidia_device = os.environ.get("force_has_nvidia_device", "0") == "1"
|
has_nvidia_device = os.environ.get("force_has_nvidia_device", "0") == "1"
|
||||||
|
|
||||||
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
|
||||||
|
@ -309,8 +314,8 @@ if device.backend is None:
|
||||||
device.backend = None
|
device.backend = None
|
||||||
has_nvml = False
|
has_nvml = False
|
||||||
|
|
||||||
if device.backend is None or force_plaidML:
|
if not has_nvidia_device and (device.backend is None or force_plaidML):
|
||||||
#tensorflow backend was failed 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 plaidML_devices_count == 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue