Hi! I recently bought a new laptop with a 4060 graphics card and I wanted to install the necessary things for tensorflow to use it. I have python 3.11, tensorflow 2.14 and CUDA 11.7. According to the internet, these versions should be compatible. I also installed the CUDNN package, but this step is the only one I’m not sure I did correctly. Also, the GPU drivers are up to date. When I run tf.test.is_built_with_cuda() it says false, and it says the number of available GPUs is 0. I am working on Windows 11 with an AMD Ryzen 7 processor. I think I have done all the steps correctly but can’t figure out what the problem is. My main priority when it comes to the versions is to have the latest version of python possible (changing tensorflow and CUDA is no problem), I also tried setting up a virtual environment but was having issues with that too.
I am also having the same problem did all the installation stuff you mentioned yet system is not detecting GPU’s and the accuracy % of algorithm dropped to 55
I just found out solution:
- Go to Anacoda Navigator , Environments , Create , with python version 3.8
- Open the windows terminal at the play button green , and run the below commands one by one:
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.9.0
python -m pip install “tensorflow<2.11”
python -c “import tensorflow as tf; print(tf.config.list_physical_devices(‘GPU’))”
I got like the below for the first time :
(wf_tf) C:\Users\nXXXXXX>python -c “import tensorflow as tf; print(tf.config.list_physical_devices(‘GPU’))”
[PhysicalDevice(name=‘/physical_device:GPU:0’, device_type=‘GPU’)]
Are you using 3.8.19? Because my env couldn’t find cudnn 8.9.0. How did you do it?
-
Make sure your GPU is one among the list in the link here: CUDA GPUs - Compute Capability | NVIDIA Developer
-
Choose ‘cudnn’ version accordingly mentioned in the above link.
And the python version of my Anacoda env is as below:
(wf_tf) C:\Users\pXXXXX>python --version
Python 3.8.19
(wf_tf) C:\Users\pXXXXX>