From 7db469a1da96aa1dcba4de370998407722f0f3bf Mon Sep 17 00:00:00 2001 From: iperov Date: Mon, 25 Feb 2019 21:34:47 +0400 Subject: [PATCH] fix nnlib/device.py for some notebooks --- nnlib/device.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nnlib/device.py b/nnlib/device.py index 418d769..683c759 100644 --- a/nnlib/device.py +++ b/nnlib/device.py @@ -260,7 +260,12 @@ class device: force_plaidML = os.environ.get("force_plaidML", "0") == "1" has_nvml = False has_nvml_cap = False -has_nvidia_device = os.environ.get("force_has_nvidia_device", "0") == "1" + +#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" + plaidML_devices = [] # Using plaidML OpenCL backend to determine system devices and has_nvidia_device @@ -309,8 +314,8 @@ if device.backend is None: device.backend = None has_nvml = False -if device.backend is None or force_plaidML: - #tensorflow backend was failed or forcing plaidML, trying to use plaidML backend +if not has_nvidia_device and (device.backend is None or force_plaidML): + #tensorflow backend was failed without has_nvidia_device , or forcing plaidML, trying to use plaidML backend if plaidML_devices_count == 0: print ("plaidML: No capable OpenCL devices found. Falling back to tensorflow backend.") device.backend = None