title: Why is Tensorflow not recognizing my GPU after conda install?
body: <p>I am new to deep learning and I have been trying to install tensorflow-gpu version in my pc in vain for the last 2 days. I avoided installing CUDA and cuDNN drivers since several forums online don't recommend it due to numerous compatibility issues. Since I was already using the conda distribution of python before, I went for the <code>conda install -c anaconda tensorflow-gpu</code> as written in their official website here: <a href="https://anaconda.org/anaconda/tensorflow-gpu" rel="noreferrer">https://anaconda.org/anaconda/tensorflow-gpu</a> .</p>
  <p>However even after installing the gpu version in a fresh virtual environment (to avoid potential conflicts with pip installed libraries in the base env), tensorflow doesn't seem to even recognize my GPU for some mysterious reason.</p>
  <p>Some of the code snippets I ran(in anaconda prompt) to understand that it wasn't recognizing my GPU:-</p>
  <p>1.</p>
  <pre><code>&gt;&gt;&gt;from tensorflow.python.client import device_lib
          &gt;&gt;&gt;print(device_lib.list_local_devices())
                      [name: &quot;/device:CPU:0&quot;
                  device_type: &quot;CPU&quot;
                  memory_limit: 268435456
                  locality {
                  }
                  incarnation: 7692219132769779763
                  ]
  </code></pre>
  <p>As you can see it completely ignores the GPU.</p>
  <p>2.</p>
  <pre><code>&gt;&gt;&gt;tf.debugging.set_log_device_placement(True)
      &gt;&gt;&gt;a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
  2020-12-13 10:11:30.902956: I tensorflow/core/platform/cpu_feature_guard.cc:142] This 
  TensorFlow 
  binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU 
  instructions in performance-critical operations:  AVX AVX2
  To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
  &gt;&gt;&gt;b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
  &gt;&gt;&gt;c = tf.matmul(a, b)
  &gt;&gt;&gt;print(c)
  tf.Tensor(
  [[22. 28.]
  [49. 64.]], shape=(2, 2), dtype=float32)
  </code></pre>
  <p>Here, it was supposed to indicate that it ran with a GPU by showing <code>Executing op MatMul in device /job:localhost/replica:0/task:0/device:GPU:0</code> (as written here: <a href="https://www.tensorflow.org/guide/gpu" rel="noreferrer">https://www.tensorflow.org/guide/gpu</a>) but nothing like that is present. Also I am not sure what the message after the 2nd line means.</p>
  <p>I have also searched for several solutions online including here but almost all of the issues are related to the first manual installation method which I haven't tried yet since everyone recommended this approach.</p>
  <p>I don't use cmd anymore since the environment variables somehow got messed up after uninstalling tensorflow-cpu from the base env and on re-installing, it worked perfectly with anaconda prompt but not cmd. This is a separate issue (and widespread also) but I mentioned it in case that has a role to play here. I installed the gpu version in a fresh virtual environment to ensure a clean installation and as far as I understand path variables need to be set up only for manual installation of CUDA and cuDNN libraries.</p>
  <p>The card which I use:-(which is CUDA enabled)</p>
  <pre><code>C:\WINDOWS\system32&gt;wmic path win32_VideoController get name
  Name
  NVIDIA GeForce 940MX
  Intel(R) HD Graphics 620
  </code></pre>
  <p>Tensorflow and python version I am using currently:-</p>
  <pre><code>&gt;&gt;&gt; import tensorflow as tf
  &gt;&gt;&gt; tf.__version__
  '2.3.0'
  
  Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  </code></pre>
  <p>System information: Windows 10 Home, 64-bit operating system, x64-based processor.</p>
  <p>Any help would be really appreciated. Thanks in advance.</p>