Nano
Nano

Reputation: 1159

Python3 cannot find CUDA dll files

I am having an issue that when I try to use tensorflow with my gpu it says none can be found. This is the code I am running to see how many GPUs I have available

import tensorflow as tf
import tensorflow_datasets as tfds
    
    
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

The messages I am getting when I run $ python3 main.pyare the following:

2021-09-04 16:52:04.477828: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-09-04 16:52:04.477963: 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.
2021-09-04 16:52:07.179742: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
...
2021-09-04 16:52:07.182033: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1835] 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...
Num GPUs Available:  0

Running $ nvcc -V gives me

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jul_14_19:47:52_Pacific_Daylight_Time_2021
Cuda compilation tools, release 11.4, V11.4.100
Build cuda_11.4.r11.4/compiler.30188945_0

I have followed the instructions on the tensorflow website and nvidia site. My path contains CUDA_PATH and CUDA_PATH_V11_4 both pointing to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4.The cudart64_110.dll filw which the error message says cannot be found is in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin.

I would like to know why I cannot use python3 to run my program. I have tried all sorts of stuff and can't figure out what I am missing. Any help would be appreciated.

Edit: It seems to work fine when I run it with $ python main.py or through a Jupyter notebook. It seems $ python3 main.py is the only case where it does not work.

Upvotes: 0

Views: 528

Answers (1)

Ahsan Akhtar
Ahsan Akhtar

Reputation: 41

Here is the list of CUDA versions working on Tensorflow-gpu versions. https://www.tensorflow.org/install/source#linux
Checking which is install and download that version.

Upvotes: 1

Related Questions