title: Tensorflow Adding visible gpu devices: 0
body: <p>Adding a GPU to a TF takes a long time (about 5 minutes).</p>
  <pre><code>2020-10-13 20:40:44.526254: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
  2020-10-13 20:40:47.807350: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
  2020-10-13 20:40:48.359657: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: 
  pciBusID: 0000:01:00.0 name: GeForce 940MX computeCapability: 5.0
  coreClock: 1.2415GHz coreCount: 3 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 13.41GiB/s
  2020-10-13 20:40:48.359929: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
  2020-10-13 20:40:48.364802: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
  2020-10-13 20:40:48.368740: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
  2020-10-13 20:40:48.370131: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
  2020-10-13 20:40:48.376559: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
  2020-10-13 20:40:48.381379: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
  2020-10-13 20:40:48.395729: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
  2020-10-13 20:40:48.395998: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
  2020-10-13 20:40:48.396450: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
  2020-10-13 20:40:48.410138: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1ad0e760780 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
  2020-10-13 20:40:48.410394: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
  2020-10-13 20:40:48.410790: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: 
  pciBusID: 0000:01:00.0 name: GeForce 940MX computeCapability: 5.0
  coreClock: 1.2415GHz coreCount: 3 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 13.41GiB/s
  2020-10-13 20:40:48.411524: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
  2020-10-13 20:40:48.411782: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
  2020-10-13 20:40:48.412092: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
  2020-10-13 20:40:48.412353: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
  2020-10-13 20:40:48.412651: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
  2020-10-13 20:40:48.412943: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
  2020-10-13 20:40:48.413248: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
  2020-10-13 20:40:48.413576: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
  </code></pre>
  <p>I tried changing the version of Python and TF, but it didn't help. Also tried adding</p>
  <pre><code>import os
  os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
  </code></pre>
  <p>it to the beginning of the code, but then the program freezes on this line for a long time(I waited 10 minutes and nothing happened)</p>
  <p>tf version 2.2.0 / python 3.6.8</p>