I have tried to import tensorflow-gpu and I'm getting the same error with different versions of CUDA and cuDNN.
My GPU is compatible with CUDA and I have no problems installing but when I try to import tensorflow-gpu I got this:
ImportError: DLL load failed: No se puede encontrar el módulo especificado.
Failed to load the native TensorFlow runtime.
Tensorflow version: 1.11
CUDA version: 10
cudNN: 7.3.1
I also tried cudaNN 5.0 because I saw on a forum that worked for some people.
Assuming you have your nvidia drivers installed properly, refer to this table to check out which CUDA and cuDNN version you should be using for the tensorflow version you prefer.
Try running these commands in your cmd window
SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;%PATH%
SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\CUPTI\lib64;%PATH%
SET PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include;%PATH%
SET PATH=C:\tools\cuda\bin;%PATH%
also see the chart that Jialer Chew gave if you are now doing it use tf version 2.2.0 cuda version 10.1 and cudnn version 7.6.0.
Related
Hi I'm struggling to get Tensorflow V2.11 to find my eGPU (RTX 3060 Ti)
I am currently on Windows 11
CUDA version is 12
I am currently downloading CUDA 11 as well as CUDnn as I've heard it is recommended
I have tried the following code:
import tensorflow as tf
tf.config.list_physical_devices('GPU')
which outputs:
[]
any help would be great
Tensorflow 2.11 is not supporting GPU on Windows machine. TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. So you can try by installing Tensorflow 2.10 for the GPU setup.
Also you need to install the specific version of CUDA and cuDNN for GPU support in your system which is CUDA 11.2 and cuDNN 8.1 for Tensorflow 2.10(Tensorflow>=2.5).
Please check the Hardware/Software requirements as mentioned in the link and set the path to the bin directory after installing these software.
Now follow the step by step instructions mentioned in the same link and verify the GPU setup using below code.
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
I have encounter "I tensorflow/stream_executor/cuda/cuda_dnn.cc:368] Loaded cuDNN version 8400
Could not load library cudnn_cnn_infer64_8.dll. Error code 193"
will working with TensorFlow.
version:
TensorFlow 2.8
CUDA 11.6
CUDNN 8.4
The versions you installed for TensorFlow and NVIDIA CUDA probably don't match.
Try using one of the versions tested here: Tensorflow GPU Source Install
Don't forget to install "tensorflow-gpu" module instead of "tensorflow" in order to use NVIDIA GPU Acceleration.
i simply used conda insted pip to install cuda and cudnn. then used pip for the tensorflow gpu instalation. vrsions that worked with each other are cuda 11.2 and tensorflow2.10. anything above 2.10 not suport gpu
I am trying to use keras in tensorflow to train a CNN network for some image classification. Obviously, the training running on my CPU is incredibly slow and so I need to use my GPU to do the training. I've found many similar questions on StackOverflow, none of which have helped me get the GPU to work, hence I am asking this question separately.
I've got an NVIDIA GeForce GTX 1060 3GB and the 466.47 NVIDIA driver installed. I've installed the CUDA toolkit from the NVIDIA website (installation is confirmed with nvcc -V command outputting my version 11.3), and downloaded the CUDNN library. I unzipped the CUDNN file and copied the files to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3, as stated on the NVIDIA website. Finally, I've checked that it's on PATH (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin and C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\libnvvp are both in the environment variable 'Path').
I then set up an environment using conda, downloading some packages that I need, like scikit-learn, as well as tensorflow-gpu=2.3 After booting my environment into Jupyter Notebook, I run this code to check to see if it's picking up the GPU:
import tensorflow as tf
print(tf.__version__)
print(tf.config.list_physical_devices())
And get this:
2.3.0
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
I have tried literally everything I have come into contact with on this topic, but am not getting any success in getting it to work. Any help would be appreciated.
You, first, have to install all CUDA requirements. If you have Ubuntu 20.04, here is how you can install the requirements. Then it's the right time to install tensorflow. Asa you intended to utilize your GPU, you have install tensorflow-gpu library, not tensorflow alone.
I'm guessing you have installed TensorFlow correctly using pip install tensorflow.
NVIDIA GPU cards with CUDA architectures 3.5, 5.0, 6.0, 7.0, 7.5, 8.0 and higher than 8.0 are currently supported by TensorFlow. If you have the supported cards but TensorFlow cannot detect your GPU, you have to install the following software:
NVIDIA GPU drivers —CUDA 11.0 requires 450.x or higher.
CUDA Toolkit —TensorFlow supports CUDA 11 (TensorFlow >= 2.4.0)
cuDNN SDK 8.0.4
You can optionally install TensorRT 6.0 to improve latency and throughput for inference on some models.
For more info, please refer to the TensorFlow documentation: https://www.tensorflow.org/install/gpu
I recommend to use conda to install the CUDA Toolkit packages as well as CUDNN, which will avoid wasting time downloading the right packages (or making changes in the system folders)
conda install -c conda-forge cudatoolkit=11.0 cudnn=8.1
Then you can install keras and tensorflow-gpu by typing
conda install keras==2.7
pip install tensorflow-gpu==2.7
and it will work directly.
Based on this issue
This has been asked countless times here, but I could not find solution that fits my problem.
I am trying to install tensorflow-gpu on Windows 10, Anaconda. I downloaded CUDA (Version 10.2) and CuDNN, I have moved files from CuDNN library to CUDA folders and added following variables to PATH:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp
After running following code in anaconda, I get following response:
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
I am guessing the main problem is "Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found", so I went to my CUDA bin folder and there is no cudart64_101.dll, but there is cudart64_102.dll. What should I do to fix this?
The last three numbers in your .dll files should point you to a solution. TensorFlow is looking for CUDA 10.1, but you have installed CUDA 10.2.
Re-installing CUDA and the compatible cuDNN should fix your problem. See the TensorFlow installation tutorial for the exact versions of CUDA and cuDNN.
You'll probably have to reinstall TF as well, after installing the correct CUDA libraries.
Hope this helps.
After created tensorflow environment under anaconda, I installed tensorflow-gpu. Then I was trying to import tensorflow to verify if it's correctly installed, but got this error:
ImportError: Could not find 'cudnn64_7.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 7 from this URL: https://developer.nvidia.com/cudnn
Setup is:
NVIDIA GTX 1080
CUDA 9.0
cuDNN 6.0
tensorflow-gpu 1.5
Environment Variables are:
CUDA_PAT: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
CUDA_PATH_V9_0: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
The %Path% variables are:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp
C:\Users\yshen\AppData\Local\cudnn-8.0-windows10-x64-v6.0\cuda\bin
it is obvious that I installed cuDNN6.0, don't why the error shows "Could not find 'cudnn64_7.dll' ". Why it automatically searches cudnn64_7.dll instead of cudnn64_6.dll?
Also, I got below error when I installed TensorFlow 1.8. I have the Anaconda environment.
"ImportError: Could not find 'cudnn64_7.dll'"
But after I installed Nvidia cuDNN v7.1.3 (April 17, 2018), for CUDA 9.0, everything started to work.
Please note that one needs to sign up as a Nvidia developer to be able to download the installation package(s).
Then, just follow the instructions in the page : cudnn-install
For Windows:
3.3. Installing cuDNN on Windows
The following steps describe how to build a cuDNN dependent program. In the following sections:
-your CUDA directory path is referred to as C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
-your cuDNN directory path is referred to as <installpath>
Navigate to your <installpath> directory containing cuDNN.
Unzip the cuDNN package. -cudnn-9.0-windows7-x64-v7.zip or -cudnn-9.0-windows10-x64-v7.zip
Copy the following files into the CUDA Toolkit directory.
Copy <installpath>\cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin.
Copy <installpath>\cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include.
Copy <installpath>\cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64.
Set the following environment variables to point to where cuDNN is located. To access the value of the $(CUDA_PATH) environment variable, perform the following steps:
Open a command prompt from the Start menu.
Type Run and hit Enter.
Issue the control sysdm.cpl command.
Select the Advanced tab at the top of the window.
Click Environment Variables at the bottom of the window.
Ensure the following values are set:
Variable Name: CUDA_PATH
Variable Value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
Include cudnn.lib in your Visual Studio project.
Open the Visual Studio project and right-click on the project name.
Click Linker > Input > Additional Dependencies.
Add cudnn.lib and click OK.
According to you previous answer, you seem to find out prebuilt tensorflow-gpu 1.5 is not compatible with CUDA 9.0 + CudNN 6.0. There are two possible solutions for your answer, if you want to use tensorflow-gpu 1.5:
1, upgrade your CUDA tool chain to CUDA 9.0 +Cudnn 7.0 (currently Cudnn 7.0.5 for CUDA 9.0).
2, recompile the tensorflow-gpu 1.5 target for CUDA 9.0 + cudnn 6.0.
I suggest choosing the first option for ease. But the official webpage of tensorflow 1.5 dose not deny the possibility of option 2:
https://github.com/tensorflow/tensorflow/releases/tag/v1.5.0
In my case i needed to install old cuDNN libraries linked here
Just fould the solution:
I checked the \tensorflow\python\platform\build_info.py and found:
msvcp_dll_name = 'msvcp140.dll'
cudart_dll_name = 'cudart64_90.dll'
cuda_version_number = '9.0'
nvcuda_dll_name = 'nvcuda.dll'
cudnn_dll_name = 'cudnn64_7.dll'
cudnn_version_number = '7'
It assumes cudnn version is 7. So just need to correct it as:
cudnn_dll_name = 'cudnn64_6.dll'
cudnn_version_number = '6'