Not 100% certain what you have going on but in short no Tensorflow does not require a GPU and you shouldn’t have to build it from source unless you just feel like it. Might I suggest you try uninstalling whatever version of Tenforflow you might have, and then reinstall it.
While researching we ran into the question “How do I run TensorFlow on a GPU?”.
Some sources claimed uninstall tensorflow and install only tensorflow-gpu; this should be sufficient. By default, this should run on the GPU and not the CPU. However, further you can do the following to specify which GPU you want it to run on. If you have an nvidia GPU, find out your GPU id using the command nvidia-smi on the terminal.
Yes it is possible to run tensorflow on AMD GPU’s but it would be one heck of a problem. As tensorflow uses CUDA which is proprietary it can’t run on AMD GPU’s so you need to use OPENCL for that and tensorflow isn’t written in that.
Strangely, even though the tensorflow website 1 mentions that CUDA 10.1 is compatible with tensorflow-gpu-1.13.1, it doesn’t work so far. Tensorflow-gpu gets installed properly though but it throws out weird errors when running. So far, the best configuration to run tensorflow with GPU is CUDA 9.0 with tensorflow_gpu-1.12.0 under python3.6.
What are the system requirements to run TensorFlow?
You can enable compute capabilities by building Tensor. Flow from source. The following NVIDIA® software must be installed on your system: NVIDIA® GPU drivers —CUDA® 11.2 requires 450.80.02 or higher.
What is the latest version of TensorFlow?
Note: The latest version of tensorflow is 2.4 (as of writing this article), which is installed directly when we run ‘pip install tensorflow’, which may or may not work for GPU. But when we run the above command it installs tensorflow-gpu 2.2 version. This version allows tensorflow to detect GPU and use it.
How to hide GPU from Tensorflow when running graph?
You specifically state in your code that the graph should run on CPU with something like with tf. Device (‘/cpu:0’), You hide your GPU from tensorflow with os.