You have come here because you want to install Tensorflow 2.9, and you want to get it right for the first time. Typically installing Tensorflow is hard work due to the number of dependencies. The good news is that since Tensorflow 2.5, the basic dependencies haven’t changed much, CUDA 11.2 and CuDNN 8.1 is still required except for the Python version required.
Which TensorFlow and CUDA version combinations are compatible?
Whenever you are in doubt on what version of CUDA and CuDNN you need, just check Tensorflow’s compatibility matrix available from this link.
Below you can see an extract of that table, with the versions of CUDA and cuDNN that are required if you are installing and compiling Tensorflow from the source:
|Version||Python version||Compiler||Build tools||cuDNN||CUDA|
|tensorflow-2.9.0||3.7-3.10||GCC 9.3.1||Bazel 5.0.0||8.1||11.2|
|tensorflow-2.8.0||3.7-3.10||GCC 7.3.1||Bazel 4.2.1||8.1||11.2|
|tensorflow-2.7.0||3.7-3.9||GCC 7.3.1||Bazel 3.7.2||8.1||11.2|
|tensorflow-2.6.0||3.6-3.9||GCC 7.3.1||Bazel 3.7.2||8.1||11.2|
|tensorflow-2.5.0||3.6-3.9||GCC 7.3.1||Bazel 3.7.2||8.1||11.2|
|tensorflow-2.4.0||3.6-3.8||GCC 7.3.1||Bazel 3.1.0||8.0||11.0|
|tensorflow-2.3.0||3.5-3.8||GCC 7.3.1||Bazel 3.1.0||7.6||10.1|
|tensorflow-2.2.0||3.5-3.8||GCC 7.3.1||Bazel 2.0.0||7.6||10.1|
|tensorflow-2.1.0||2.7, 3.5-3.7||GCC 7.3.1||Bazel 0.27.1||7.6||10.1|
|tensorflow-2.0.0||2.7, 3.3-3.7||GCC 7.3.1||Bazel 0.26.1||7.4||10.0|
|tensorflow_gpu-1.15.0||2.7, 3.3-3.7||GCC 7.3.1||Bazel 0.26.1||7.4||10.0|
This means that if you want to install Tensorflow manually, you can simply follow the steps outlined for Tensorflow 2.5. You can find that guide below:
If you don’t want to waste time installing each component by hand, there is no shame in just using a docker container with Tensorflow. I have created a very simple guide on how to install Tensorflow using docker: