Running Python codes in Nvidia TX2, with tensorflow gpu and cannot detect gpu.

Hi,

Currently, I am trying out a project from https://github.com/MaybeShewill-CV/attentive-gan-derainnet and unable to run the given test code due to not being able to detect GPU. Full error shown below.

VGG16 Network init complete
WARNING:tensorflow:From /home/oliver/Downloads/attentive-gan-derainnet-master/attentive_gan_model/derain_drop_net.py:84: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

WARNING:tensorflow:From /home/oliver/Downloads/attentive-gan-derainnet-master/attentive_gan_model/cnn_basenet.py:71: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.

WARNING:tensorflow:From /home/oliver/Downloads/attentive-gan-derainnet-master/attentive_gan_model/cnn_basenet.py:402: conv2d_transpose (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.keras.layers.Conv2DTranspose instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/layers/convolutional.py:1279: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use layer.__call__ method instead.
WARNING:tensorflow:From /home/oliver/Downloads/attentive-gan-derainnet-master/attentive_gan_model/cnn_basenet.py:167: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.

WARNING:tensorflow:From tools/test_model.py:87: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING:tensorflow:From tools/test_model.py:92: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2019-12-20 17:53:17.246953: W tensorflow/core/platform/profile_utils/cpu_utils.cc:98] Failed to find bogomips in /proc/cpuinfo; cannot determine CPU frequency
2019-12-20 17:53:17.247993: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1d0b5bf0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-12-20 17:53:17.248072: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2019-12-20 17:53:17.256615: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2019-12-20 17:53:17.364778: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:950] ARM64 does not support NUMA - returning NUMA node zero
2019-12-20 17:53:17.365080: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1d3f7b90 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2019-12-20 17:53:17.365128: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): NVIDIA Tegra X2, Compute Capability 6.2
2019-12-20 17:53:17.365675: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:950] ARM64 does not support NUMA - returning NUMA node zero
2019-12-20 17:53:17.365788: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: NVIDIA Tegra X2 major: 6 minor: 2 memoryClockRate(GHz): 1.02
pciBusID: 0000:00:00.0
2019-12-20 17:53:17.365984: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0
2019-12-20 17:53:17.397423: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0
2019-12-20 17:53:17.426466: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10.0
2019-12-20 17:53:17.465343: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10.0
2019-12-20 17:53:17.507393: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10.0
2019-12-20 17:53:17.532817: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10.0
2019-12-20 17:53:17.612222: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2019-12-20 17:53:17.612716: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:950] ARM64 does not support NUMA - returning NUMA node zero
2019-12-20 17:53:17.613058: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:950] ARM64 does not support NUMA - returning NUMA node zero
2019-12-20 17:53:17.613143: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2019-12-20 17:53:17.613381: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0
2019-12-20 17:53:20.302402: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-12-20 17:53:20.302484: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2019-12-20 17:53:20.302535: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2019-12-20 17:53:20.303093: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:950] ARM64 does not support NUMA - returning NUMA node zero
2019-12-20 17:53:20.303514: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:950] ARM64 does not support NUMA - returning NUMA node zero
2019-12-20 17:53:20.303735: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6281 MB memory) -> physical GPU (device: 0, name: NVIDIA Tegra X2, pci bus id: 0000:00:00.0, compute capability: 6.2)

I have installed tensorflow-gpu library and using a cuda 10-0.

After running the test code, my proccessing speed will be very slow and i was unable to achieve my results even though no error message was shown.

Please help ! thanks in advance

I would like to point out that it states that there re no visible GPU devices.

Adding visible gpu devices: 0

Hi,

Based on the log, TensorFlow can detect TX2 GPU correctly.

2019-12-20 17:53:17.365788: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: 
name: NVIDIA Tegra X2 major: 6 minor: 2 memoryClockRate(GHz): 1.02

It’s known that there are some performance issue when launching TensorFlow on Jetson system.
This is because TF doesn’t design for Jetson and the memory and scheduler is not optimal for Jetson.

Is our TensorRT an option for you?
We always recommend user to convert their model into TensorRT to have a better performance.
Here is a sample for your reference: /usr/src/tensorrt/samples/python/end_to_end_tensorflow_mnist/

Thanks.