Tensorflow 2.3.0 does not detect GPU

2024/7/4 17:13:35

The tensorflow does not detect the GPU card. I have following the procedures suggest at Nvidia website and tensorflow/install/gpu.

How can I fix it?

I am using the following packages and drives:

NVIDIA

[nvcc: NVIDIA (R) Cuda compiler driverCopyright (c) 2005-2019 NVIDIA CorporationBuilt on Sun_Jul_28_19:12:52_Pacific_Daylight_Time_2019Cuda compilation tools, release 10.1, V10.1.243][1]

Cudnn Version 8.0.2

Tensor Flow

Name                      Version                   Build  Channel
tensorflow                2.3.0                    pypi_0    pypi
tensorflow-addons         0.11.1                   pypi_0    pypi
tensorflow-estimator      2.3.0                    pypi_0    pypi

I use the following code to check it;

Python 3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.IPython 7.17.0 -- An enhanced Interactive Python.from tensorflow.python.client import device_lib
device_lib.list_local_devices()

Result

2020-08-20 22:58:38.419555: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll 
Out[1]:  [name: "/device:CPU:0"  device_type: "CPU"  memory_limit: 268435456  locality {  }  incarnation: 12639439165040732604,  name: "/device:XLA_CPU:0"  device_type: "XLA_CPU"  memory_limit: 17179869184  locality {  }  incarnation: 2249215130251849864  physical_device_desc: "device: XLA_CPU device",  name: "/device:XLA_GPU:0"  device_type: "XLA_GPU"  memory_limit: 17179869184  locality {  }  incarnation: 7640064762024919839  physical_device_desc: "device: XLA_GPU device"]
2020-08-20 22:58:38.419555: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-08-20 22:58:40.332579: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-08-20 22:58:40.340307: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x22481a47710 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-20 22:58:40.341741: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-08-20 22:58:40.342711: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2020-08-20 22:58:40.362324: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:  pciBusID: 0000:01:00.0 name: GeForce GTX 1050 computeCapability: 6.1 coreClock: 1.493GHz coreCount: 5 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s 
2020-08-20 22:58:40.362354: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll 
2020-08-20 22:58:40.366447: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll 
2020-08-20 22:58:40.369790: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll 
2020-08-20 22:58:40.370968: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll 
2020-08-20 22:58:40.374957: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll 
2020-08-20 22:58:40.377382: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll 
2020-08-20 22:58:40.378955: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2020-08-20 22:58:40.378977: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] 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...
2020-08-20 22:58:40.455688: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-20 22:58:40.455717: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]      0
2020-08-20 22:58:40.455728: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1276] 0:   N
2020-08-20 22:58:40.458391: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x22490b5c830 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-20 22:58:40.458412: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): GeForce GTX 1050, Compute Capability 6.1
Answer

Check the software requirements:Here

It says cudnn version = 7.6

Make sure you have installed all the c++ redistributables - Here

Make sure you have the appropriate python version. - Here

Finally, make sure you have set the path to Cuda and cudnn in your system.

Make sure the installed NVIDIA software packages match the versions listed above. In particular, TensorFlow will not load without the cuDNN64_7.dll file. To use a different version, see the Windows build from source guide.

This is stated in TensorFlow documentation which seems to be your issue

https://en.xdnf.cn/q/73238.html

Related Q&A

How to create dict from class without None fields?

I have the following dataclass:@dataclass class Image:content_type: strdata: bytes = bid: str = ""upload_date: datetime = Nonesize: int = 0def to_dict(self) -> Dict[str, Any]:result = {}if…

Is sys.exit equivalent to raise SystemExit?

According to the documentation on sys.exit and SystemExit, it seems thatdef sys.exit(return_value=None): # or return_value=0raise SystemExit(return_value)is that correct or does sys.exit do something …

Vertical overflow of table in live display should scroll the content

Im using a Live display to show the content of a Table which grows over time. Eventually there is a vertical overflow and in that case Id like the oldest (i.e. topmost) rows to vanish while the most re…

Reading KML Files Using Fastkml

Ive searched around quite a bit for this specific Python module, and havent been able to find a source which points me in the right direction.Im trying to read a KML file and display all of the feature…

Adding extra fields to django-registration form

I have a model called "Organization" that Ive setup as a User profile and I would like to have the fields from the "Organization" model show up on the registration page. How do I go…

Need to do a daily log rotation (0utc) using Python

Im an admitted noob to Python. Ive written a little logger that takes data from the serial port and writes it to a log file. Ive got a small procedure that opens the file for append, writes, then close…

Save/Load a Dictionary

Ive found a couple of others asking for help with this, but not specifically what Im trying to do. I have a dictionary full of various formats (int, str, bool, etc) and Im trying to save it so I can lo…

py2exe error handling redirection and popup

Been trying to figure out how to get py2exe to handle errors more gracefully. There are basically 2 weird things happening:1) Popup message after shutting down the program => want to suppress (not …

SQL statement for CSV files on IPython notebook

I have a tabledata.csv file and I have been using pandas.read_csv to read or choose specific columns with specific conditions.For instance I use the following code to select all "name" where …

How to draw ellipsoid with plotly

Are there any way to plot a surface like ellipsoid with plotly 3D?Currently only surfaces of the form z=f(x,y) are discussed in the docs. There is also Mesh 3D, but I found no examples for it. It seem…