解决Tensorflow:Could not load dynamic library ‘cudart64_101.dll‘;dynamic library ‘cublas64_10.dll‘;

Introduce

Tensorflow: 2.3.0
Cuda: 10.2 There was a process of installing pytorch before
VS Code
, but tensrflow was used for models in many articles. . I pip install tsnsorflowdownloaded the package, and reported an error of missing dll when running the environment test code

2020-09-06 09:45:01.361802: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found  
2020-09-06 09:45:01.367980: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2020-09-06 09:45:01.381555: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2020-09-06 09:45:01.397029: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2020-09-06 09:45:01.411172: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
2020-09-06 09:45:01.427179: 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-09-06 09:45:01.431474: 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-09-06 09:45:01.460437: 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-09-06 09:45:01.493733: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1a5bb817dd0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-09-06 09:45:01.498652: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-09-06 09:45:01.510107: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-09-06 09:45:01.513734: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
tf.Tensor(10.0, shape=(), dtype=float32)

Only DLL Method

Read some posts saying that tf2.3 requires cuda10.1. . . 10.2 and 10.0 are not easy to use. . . So I have to reinstall 10.1. . are u kidding me??? The next old version and does not support the new version? ? ? One 10.1 is 2.5g. . . I have not tried the one with 10.2

So I thought about it. Since the dll is true, can I just download the dll directly, so I downloaded cudart64_101.dll and followed the path " C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.x\bin" in other posts . The problem is that my cuda 10.2 did not find NVIDIA GPU Computing Toolkit this folder. . . So I put the ll just downloaded C:\Windows\System32and re-run the sample program, Yes! !
Insert picture description here
Attach download link here

cufft64_10.dll
curand64_10.dll
cusolver64_10.dll

  • cusparse64_10.dll

  • Several dlls of cudnn64_7.dll were not found. . . . This is the result after running. . . There are still a few dlls that have not been completed. . . So I looked for it and found that the 10.2 toolkit
    was still running after installation on the official website of n . . . . . Tired
2020-09-06 10:44:39.412824: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-09-06 10:44:42.847854: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2020-09-06 10:44:42.874234: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties: 
pciBusID: 0000:06:00.0 name: GeForce GTX 750 Ti computeCapability: 5.0
coreClock: 1.189GHz coreCount: 5 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 80.47GiB/s
2020-09-06 10:44:42.883963: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-09-06 10:44:42.890574: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
2020-09-06 10:44:42.896611: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2020-09-06 10:44:42.915975: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2020-09-06 10:44:42.923068: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2020-09-06 10:44:42.930074: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2020-09-06 10:44:42.945912: 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-09-06 10:44:42.958982: 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-09-06 10:44:42.979756: 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-09-06 10:44:43.020581: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x246feabe770 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-09-06 10:44:43.026014: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-09-06 10:44:43.029846: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-09-06 10:44:43.043218: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
tf.Tensor(10.0, shape=(), dtype=float32)

Last resort

Open my Anaconda Tensorflow environment, and it will run. . . . .
Insert picture description here

References

  • cuda10.1 download https://developer.nvidia.com/cuda-10.1-download-archive-base?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal
  • Installation 10.1 reference https://blog.csdn.net/qq_22016915/article/details/105267552
  • Install 10.1+10.2 reference https://learnku.com/articles/40393
  • Install dll directly https://blog.csdn.net/qq_41999081/article/details/104515513
  • DLL ps: //cn.dll-files.com/download/1d7955354884a9058e89bb8ea34415c9/cudart64_101.dll.html? C = SktCNWZLZkxRTG1Pemk1Y2hMUTBudz09

Guess you like

Origin blog.csdn.net/weixin_43031092/article/details/108428238