Iʻd like to know what version of Tensorflow supports CUDA 12.2.1. I canʻt seem to find clear information in the TensorFlow documentation. Thanks in advance for your help.
I want to install a newer version of TensorFlow on my PC running Windows 11 Pro. My current version is 1.4.0, which is really outdated. I have an NVIDIA GeForce RTX 2060 GPU which only accepts CUDA 12.2.1, so I need a version of TensorFlow that is newer but which can support CUDA 12.2.1.
Even though the tensorflow docs say you need Cuda 11.8, it's possible to make it work with other Cuda versions. I use Cuda 12.3 with tensorflow 2.16.1, Python 3.9, nVidia driver 545, Linux Mint 21.3 (based on Ubuntu) with my RTX 4060 for training with Jupyter Notebooks. This is my install process:
Find out your Cuda version by running nvidia-smi in terminal. If that doesn't work, you need to install drivers for nVidia graphics card first.
Look up which versions of python, tensorflow, and cuDNN works for your Cuda version here.
Install the Cuda Toolkit for your Cuda version. Use the legacy kernel module flavor.
Install cuDNN.
Set up and activate a virtual/conda environment with the corresponding python version.
Install tensorflow with correct version in your virtual/conda environment, e.g. pip install "tensorflow[and-cuda]==2.16.1"
Set LD_LIBRARY_PATH env variable to include the path to your tensorflow library. In your .bashrc or .zshrc file, it might look like this (replace the path): export LD_LIBRARY_PATH=~/miniconda3/envs/hslu-dpl/lib/python3.9/site-packages/nvidia/cudnn/lib/:$LD_LIBRARY_PATH. If you use Jupyter Notebooks in PyCharm, you need to set LD_LIBRARY_PATH there as well:

To verify that your GPU works, run this in your terminal:
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
To verify that your GPU works in a Jupyter notebook, add a cell with this content:
import tensorflow as tf
tf.config.list_physical_devices('GPU')
Here's the website with all the corresponding versions, https://www.tensorflow.org/install/source?hl=en#gpu, but it seems like you really need to downgrade because the highest compatible version is 11.8, but you can still try with cuda 12.2 and the corresponding cudnn version but I'm not sure it will work. Having a dual boot with ubuntu (event with a 50 gb partition ) will really help you out because there is more documentation for ubuntu than windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With