pythontensorflowgpunvidia

Use GPU for deeplearning with TensorFlow


I would like to be able to use my GPU for deeplearning with tensorflow, my graphics card is an NVIDIA GeForce GTX 1050 Ti, I am on Windows 11, the version of tensorflow that I am using is 2.18.0, the version of cuda that I have downloaded is 12.4.0, the version of cudnn that I have downloaded is 9.7.0, and as for the drivers, I have downloaded the ones from GeForce 10 Series GeForce GTX 1050 Ti, I don't know if you need more information

I have follow some steps, such as configuring environment variables, but I don't know if I'm doing it correctly

The thing is that im trying this code in VS code, in a notebook,

import tensorflow as tf
print("TensorFlow version:", tf.__version__)
print("Available GPUs:", tf.config.experimental.list_physical_devices('GPU'))

but the output is:

TensorFlow version: 2.18.0
Available GPUs: []

If someone can help me by giving me the steps, or maybe the compatibility errors, I would be really grateful


Solution

  • According to tensorflow's official documentation, GPU support on native-Windows is only available for 2.10 or earlier versions. You can try using docker containers etc. Alternatively, the recommended setup would be tensorflow=2.10 cudnn 8.6 cuda-toolkit=11.8