Tensorflow GPU Not working on Windows

I’m following the instructions exactly as provided on the “Install Tensorflow with pip” page at Install TensorFlow with pip. This is on Windows 10 Pro, using miniconda and python 3.9 (following the detailed instructions on the same page).

conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
python -m pip install tensorflow
# Verify install:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

The GPU list comes up empty. Not sure what I’m missing. Everything installs fine and there are no errors. Tensorflow seems to work fine in CPU mode. Any suggestions or ways to troubleshoot?

Thanks in advance!

Which is the tensorflow version and also gives details about the GPU card?

Note: TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. Starting with TensorFlow 2.11 , you will need to install TensorFlow in WSL2, or install tensorflow-cpu and, optionally, try the TensorFlow-DirectML-Plugin

Have you checked hardware_requirements?

Thank you!

TensorFlow 2.11 and up won’t have GPU support under Windows. If you change the second line to
python -m pip install tensorflow==2.10
then that will give you the last version with GPU support.

If you’re okay using Jupyter notebooks for development, I was able to get the latest-gpu-jupyter version of the Docker container running under Docker for Windows. I don’t think that I’ll be able to get Pycharm on Windows to see that as a development environment though.

Thank you, I was using 2.11. The page does mention the version requirement but I guess I was confused because the instructions still include installing cuda and stuff. My GPU is an RTX 2080 Super btw.

So, starting with 2.11 we can only use gpu under WSL, meaning a Linux environment? Not natively on Windows any more? That seems like a strange choice for Windows.

Thank you. I can run the Jupyter image and it works fine. I guess because it currently uses 2.10. I’d prefer not having to use docker, wsl, and all the other pieces if possible.

Btw, you can use Pycharm with the docker jupyter setup. You just have to run the container and configure the jupyter notebook server URL shown at startup and configure that s the notebook server url in pycharm. It has some quirks but works well.

I was confused because the instructions still include installing cuda and stuff

Sorry for the confusion, PR has been created to update the document as shown below

    conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
    python3 -m pip install tensorflow
    # Anything above 2.10 is not supported on the GPU on Windows Native
    python3 -m pip install "tensorflow<2.11"
    # Verify install:
    python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

So, starting with 2.11 we can only use gpu under WSL, meaning a Linux environment?

Yes, TF is still going to be available via windows based linux kernel.

Thank you!