What should output of tf.test.is_built_with_cuda()?

Viewed 315

I installed tensorflow-gpu via conda install tensorflow-gpu.

However, the computer I installed on doesn't have a GPU. I did this b/c I'm porting a conda env to an offline computer.

When I import tensorflow as tf and call tf.test.is_built_with_cuda() the results is False. Even though the computer doesn't have a GPU, I was expecting the result to be True because I instal led tensorflow-gpu. What should output of tf.test.is_built_with_cuda() be in this case?

Why do I get False?

1 Answers

I just tested this with a server that previously was running a CUDA GPU, but then had the GPU removed - a fairly similar scenario to yours. I have tensorflow-gpu==2.5.0 installed.

>>> import tensorflow as tf
2021-07-28 18:42:44.236258: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
>>> tf.test.is_built_with_cuda()
True

A similar issue was documented here. Therefore, you are most likely lacking CUDA/CUDNN.

Related