Tensorflow is not running on GPU

Hi, i’m trying to run TF 2.4.1 as a python3.8 module on Jetson Nano. I’ve build a python module on x86_64 machine using qemu-user-static emulation. But as long as i see, it gives me no logging device placement:
I did:

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices(‘GPU’)))
Num GPUs Available: 1

tf.debugging.set_log_device_placement(True)
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)
Tensor(“MatMul_5:0”, shape=(2, 2), dtype=float32)

So, as you can see no such messages i can see:

Executing op _EagerConst in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op _EagerConst in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op MatMul in device /job:localhost/replica:0/task:0/device:GPU:0
tf.Tensor(
[[22. 28.]
[49. 64.]], shape=(2, 2), dtype=float32)

Hi,

Do you want to enable the log for device placement?
If yes, would you mind checking the below document to enable it?

Thanks.

Hi, thanks for the help! I tried to, but it looks like something i still miss:

root@jetson-nano:/fr# python3
Python 3.8.0 (default, Dec 9 2021, 17:53:27)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import tensorflow as tf
2022-04-13 11:48:56.873596: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.2
2022-04-13 11:49:01.917924: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.2

tf.debugging.set_log_device_placement(
… enabled
… )
Traceback (most recent call last):
File “”, line 2, in
NameError: name ‘enabled’ is not defined

This one works well

tf.debugging.set_log_device_placement(
enabled=True
)

Good to know this.
Do you get the device placement log after applying the API?

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.