Python Tensorflow只能看到cpu

Python Tensorflow只能看到cpu,python,tensorflow,gpu,Python,Tensorflow,Gpu,我已经尝试了几乎所有的方法,但是tensorflow看不到gpu >>> tf.test.is_gpu_available() WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version. Instructions for up

我已经尝试了几乎所有的方法,但是tensorflow看不到gpu

>>> tf.test.is_gpu_available()
WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2020-10-08 16:57:31.356377: 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 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-10-08 16:57:31.408641: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2299965000 Hz
2020-10-08 16:57:31.409379: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5d51170 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-10-08 16:57:31.409459: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-10-08 16:57:31.425795: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1
2020-10-08 16:57:32.550621: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2020-10-08 16:57:32.550734: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (dmitry-pc): /proc/driver/nvidia/version does not exist
False
>>> tf.python.client.device_lib.list_local_devices()
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 15855895153430362166
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 2500413154884527026
physical_device_desc: "device: XLA_CPU device"
]
>>tf.test.gpu可用吗()
警告:tensorflow:From:1:U gpu是否可用(来自tensorflow.python.framework.test\u util)已被弃用,并将在将来的版本中删除。
更新说明:
改用'tf.config.list_物理_设备('GPU')`。
2020-10-08 16:57:31.356377:I tensorflow/core/platform/cpu_feature_guard.cc:142]此tensorflow二进制文件使用oneAPI深度神经网络库(oneDNN)进行优化,以便在性能关键操作中使用以下cpu指令:AVX2 FMA
要在其他操作中启用它们,请使用适当的编译器标志重新生成TensorFlow。
2020-10-08 16:57:31.408641:I tensorflow/core/platform/profile_utils/cpu_utils.cc:104]cpu频率:229996500Hz
2020 XLA XOR/XXL/Service/Service。CC:168)XLA服务0x5D5170初始化为平台主机(这不保证XLA将被使用)。设备:
2020-10-08 16:57:31.409459:I tensorflow/compiler/xla/service/service.cc:176]StreamExecutor设备(0):主机,默认版本
2020-10-08 16:57:31.425795:I tensorflow/stream_executor/platform/default/dso_loader.cc:48]已成功打开动态库libcuda.so.1
2020-10-08 16:57:32.550621:E tensorflow/stream\u executor/cuda/cuda\u driver.cc:314]调用cuInit失败:cuda\u错误\u无设备:未检测到支持cuda的设备
2020-10-08 16:57:32.550734:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156]内核驱动程序似乎未在此主机上运行(dmitry pc):/proc/driver/nvidia/版本不存在
假的
>>>tf.python.client.device_lib.list_local_devices()
[名称:“/设备:CPU:0”
设备类型:“CPU”
内存限制:268435456
地点{
}
化身:1585595153430362166
,名称:“/设备:XLA\U CPU:0”
设备类型:“XLA\U CPU”
内存限制:17179869184
地点{
}
化身:250041314884527026
物理设备描述:“设备:XLA\U CPU设备”
]
UBUNTU 20.04

GPU->geforce 940mx

CUDA->10.1

cudnn->7.6

tensorflow gpu->2.3.1

我试着重新安装tensorflow,cuda,cudnn。
此外,详细的建议也没有帮助()

/proc/driver/nvidia/version缺失意味着您没有一个工作的GPU驱动器。对于房间里的怀疑者来说,这是一个940MX运行CUDA代码的问题successfully@talonmies:官方列表适用于Windows和Linux、AFAICT支持的卡。其他卡可能在某些系统上工作,但不是全部。因此,您不能从一个940MX的工作模式推断出它们将与所有系统上的所有驱动程序一起工作。@MSalters:是的,您可以。这张名单已经过时,漏洞百出,而且是永久性的,尤其是OEM和笔记本电脑零件。自2008年以来,每一款GPU NVDIA都已与CUDA兼容。有一小部分云虚拟化部件没有,但quesiton ehre没有。有些人失去了支持,但他们都与CUDA合作。任何其他的建议都是完全错误的,比如现在删除的答案是在Windows上安装cuda等,一切都很好,tensorflow看到了GPU。可能不是这样安装cuda或cudnn:(