ImportError_ Could not find 'nvcuda.dll' TensorFlow

ImportError: Could not find ‘nvcuda.dll’ TensorFlow : Step by Step Fix

Are you looking for the fix of ImportError: Could not find ‘nvcuda.dll’ TensorFlow? This is one of the very common errors on Importing TensorFlow GPU. In this article, We will see how can we fix this bug step by step.

 

Cause of the bug [ ImportError: Could not find ‘nvcuda.dll’ TensorFlow ]-

 

This bug occurs when we install the TensorFlow GPU version. There are some hardware and Software Requirements for the TensorFlow GPU version. In the Hardware side, It needs a graphic card like NVIDIA mainly (Full Hardware requirement for TensorFlow GPU). In the Software side, It needs a CUDA driver mainly ( Get detailed software requirements for TensorFlow GPU ). This bug occurs when we do not have a CUDA ToolKit installed. You need to also ensure that CuDNN should compatible with the TensorFlow Version.

CuDNN for 'nvcuda.dll' error
CuDNN for ‘nvcuda.dll’ error

 

Fix for [ ImportError: Could not find ‘nvcuda.dll’ TensorFlow ]-

Here are some steps to fix this bug.

Step 1:

Download the nvcuda.dll from here.

 

Step 2:

We need to register the nvcuda.dll Now. In order to register it, We will execute the below command.

regsvr32 C:\Windows\System32\nvcuda.dll

 

Step 3 :

After successfully registering the nvcuda.dll, We will uninstall TensorFlow and the protobuf module.

pip uninstall protobuf
pip uninstall tensorflow-gpu

 

Step 4 :

Now we need to reinstall both packages  TensorFlow and the protobuf module. Please use the below commands to install these package.

pip install protobuf
pip install tensorflow-gpu

 

Step 5:

Update the system also. Go to the system property -> Advance -> Environment Variables->System Variables. Here we need to add the below path also.

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp

step 6 (Optional):

We can also verify the installation of TensorFlow GPU using the below command. This will show the devices (GPU). This is an optional step to verify only. There is nothing to do with the bug fix here.

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

 

Here we go! I hope you find this solution helpful for fixing the above bug (ImportError: Could not find ‘nvcuda.dll’ TensorFlow). Please Lets us know if you are still stuck with this bug.

Thanks 

Data Science Learner Team

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.

 
Thank you For sharing.We appreciate your support. Don't Forget to LIKE and FOLLOW our SITE to keep UPDATED with Data Science Learner