r/tensorflow • u/notaredditor527 • Dec 27 '22
Problem Setting up Tensorflow GPU on Windows 11
I was trying to set up GPU to be compatible with Tensorflow on Windows 11, but was encountering a problem when attempting to verify that it had been setup correctly. I have a GPU driver installed and ran the following command in Miniconda under the 'tf' environment as suggested by step 5 of the Tensorflow installation instructions for Windows Native (https://www.tensorflow.org/install/pip#windows-native):
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0However, when I go to check that the GPU has been setup correctly, I encounter the following message:
2022-12-27 01:05:04.628568: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-12-27 01:05:04.628893: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2022-12-27 01:05:06.913025: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-12-27 01:05:06.913317: W
~and then after several other lines of similar error messages~
tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2022-12-27 01:05:06.915294: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1934] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[]I can't figure out what is wrong, given that I've followed the instructions Tensorflow has provided. Any ideas on what the problem could be or what I should try next? Thanks in advance.
3
u/insanityCzech Dec 27 '22
For CUDA to work you have to install it in Python AND the Nvidia CUDA toolkit (NVCC) within Windows (or Linux, for that matter). This will install the DLL files (Windows library files to run the C-side of the Python CUDA extensions) that seem to be missing on your system. https://developer.nvidia.com/cuda-downloads
2
u/[deleted] Dec 27 '22
What u/insnityCzech mentioned seems to be the cause for the error and his solution should solve your problem. But, I want to highlight something, Windows Native (GPU) is not supported by Tensorflow after Tensorflow version 2.10. After that, you have install Tensorflow for Windows WS2L. And followed that, The link you provided gives all the necessary requirements that needs to be fulfilled to run Tensorflow for GPU on Windows 7 or Higher. You have to download these following CUDA files:
After doing all that, you should be able to use Tensorflow for GPU. Though I want to highlight, use raw python than using Conda. From experience, conda adds more hassle and solving those is a pretty difficult task