TensorFlow-GPU找不到GPU

时间:2020-04-25 21:06:10

标签: python tensorflow

我已经在Python 3.7 venv上安装了tensorflow-gpu 1.15.2。我没有安装tensorflow软件包。

我安装了CUDA 9.0(因为我正在使用tensorflow 1.15)和相应的CUDNN for CUDA 9.0。 当我运行张量流学习算法时,它使用我的CPU而不是我的GPU。我跑了:

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

它检测到我的GPU(1660 Ti),但是它说我缺少很多软件包:

2020-04-25 22:02:12.536321: 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.
2020-04-25 22:02:15.175536: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-04-25 22:02:15.188183: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-04-25 22:02:15.234070: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1639] Found device 0 with properties: 
name: GeForce GTX 1660 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.875
pciBusID: 0000:27:00.0
2020-04-25 22:02:15.239530: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2020-04-25 22:02:15.242919: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_100.dll'; dlerror: cublas64_100.dll not found
2020-04-25 22:02:15.251483: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_100.dll'; dlerror: cufft64_100.dll not found
2020-04-25 22:02:15.255358: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_100.dll'; dlerror: curand64_100.dll not found
2020-04-25 22:02:15.266446: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_100.dll'; dlerror: cusolver64_100.dll not found
ired libraries for your platform.
Skipping registering GPU devices...
2020-04-25 22:02:15.719511: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1180] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-25 22:02:15.721901: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1186]      0
2020-04-25 22:02:15.723610: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1199] 0:   N
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 524594082372294943
]

我在PC上进行了搜索,但确实找不到那些dll文件。

当我安装CUDA时,如果尝试重新安装,它会显示“图形驱动程序找不到兼容的图形硬件。” 我忽略了该错误并进行了安装。我的程序文件中的相关CUDA目录在那里。 但是cmd提示符中的nvcc -V确认已安装CUDA。

一个快速的Google似乎建议CUDA 10+版本具有这些库,但是安装后,我发现没有区别。

在哪里可以找到这些丢失的dll?我安装不正确吗?

1 个答案:

答案 0 :(得分:1)

哦,看来100代表CUDA 10.0,所以CUDA 9.0拥有*** 90.dll文件,而CUDA 10.2拥有*** 102.dll文件。

为此真的很烦,需要这么多不同的CUDA安装!