Tensorflow is not detecting the GPU in Jetson AGX Orin

Hi everybody,
I am newby with jetson and after installing jetpack I would like to know if tensorflow is able to detect the GPU.

Using command “tf.config.list_physical_devices” I obtain the following info:

desktop:/$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow as tf
tf.config.list_physical_devices(‘GPU’)

tf.config.list_physical_devices()
[PhysicalDevice(name=‘/physical_device:CPU:0’, device_type=‘CPU’)]

It seems that tensorflow is not detecting the GPU, only the CPU.

How could I detect the GPU from tensorflow?
Many thanks in advance.

These is the information about my system:
After launching the command: “python jetsonInfo.py” the output is this information:

NVIDIA Jetson AGX Orin Developer Kit
L4T 35.4.1 [ JetPack UNKNOWN ]
Ubuntu 20.04.6 LTS
Kernel Version: 5.10.120-tegra
CUDA 11.4.315
CUDA Architecture: 8.7
OpenCV version: 4.5.4
OpenCV Cuda: NO
CUDNN: 8.6.0.166
TensorRT: 8.5.2.2
Vision Works: NOT_INSTALLED
VPI: 2.3.9
Vulcan: 1.3.204

With the command: “sudo apt-cache show nvidia-jetpack” the output is

Package: nvidia-jetpack
Version: 5.1.2-b104
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 5.1.2-b104), nvidia-jetpack-dev (= 5.1.2-b104)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_5.1.2-b104_arm64.deb
Size: 29304

Hi,

If I follow these steps (on this topic “Tensorflow doesn't use GPU on Jetson Xavier AGX - #7 by Maddie264”)

$ cd /usr/local/cuda-11.4/samples/1_Utilities/deviceQuery
$ sudo make
$ ./deviceQuery

The output I get is these:
./deviceQuery Starting…

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: “Orin”
CUDA Driver Version / Runtime Version 11.4 / 11.4
CUDA Capability Major/Minor version number: 8.7
Total amount of global memory: 30593 MBytes (32078802944 bytes)
(016) Multiprocessors, (128) CUDA Cores/MP: 2048 CUDA Cores
GPU Max Clock rate: 1300 MHz (1.30 GHz)
Memory Clock rate: 1300 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 4194304 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total shared memory per multiprocessor: 167936 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: Yes
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Managed Memory: Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.4, CUDA Runtime Version = 11.4, NumDevs = 1
Result = PASS

Hi,

Other useful information is the version of tensorflow:
Launching this command I get the version:

tf. version
‘2.13.0’

Hi,

Please use our prebuilt instead. You can find the installation instructions in the below doc:

>>> import tensorflow as tf
>>> tf.__version__
'2.11.0'
>>> tf.config.list_physical_devices()
2023-09-27 05:51:22.011630: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:00:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-09-27 05:51:22.046032: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:00:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-09-27 05:51:22.046226: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:00:00.0/numa_node
Your kernel may have been built without NUMA support.
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

Thanks.

1 Like

Perfect, many thanks!! It is working now

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