The tensorflow which I was using , is not utilizing gpu now, after it has been changed accidentally by other person. I remember that i installed my tensorflow using wheel. Currently, the version of Cuda is 10.2, python version is 3.7 and tensorflow version is 2.6.0.
The output of the following code gives me:
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
tf.debugging.set_log_device_placement(True)
# Create some tensors
a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
c = tf.matmul(a, b)
print(c)
**Num GPUs Available: 0
Executing op _EagerConst in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op _EagerConst in device /job:localhost/replica:0/task:0/device:CPU:0
Executing op MatMul in device /job:localhost/replica:0/task:0/device:CPU:0
tf.Tensor(
[[22. 28.]
[49. 64.]], shape=(2, 2), dtype=float32)**
I have attached images of my nvidia-smi command output
$ nvidia-smi
Sat Aug 28 14:05:15 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 2060 Off | 00000000:21:00.0 Off | N/A |
| 32% 43C P8 9W / 160W | 92MiB / 5934MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 13060 C /home/hemapriya/anaconda3/bin/python 81MiB |
+-----------------------------------------------------------------------------+
!conda list cudatoolkit
!conda list cudnn
Output:
# packages in environment at /home/hemapriya/anaconda3:
#
# Name Version Build Channel
cudatoolkit 10.0.130 0 anaconda
# packages in environment at /home/hemapriya/anaconda3:
#
# Name Version Build Channel
cudnn 7.6.5 cuda10.0_0 anaconda
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
output:
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 15409823727920383739
]
Also, now after that incident, my tf.keras.optimizers.Adam is not working now.
Could you please let me know, how I should rectify, so that my tensorflow should include GPU.