关于“忽略可见gpu设备并添加可见gpu设备”的问题

2024-06-23 03:26:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我以两种方式运行tf

首先,我在tf1.12.0中使用python3.5,当我运行tf.Session()时,python3.5的输出如下:

2020-07-16 16:40:36.993973: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-07-16 16:40:37.191067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: 
name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235
pciBusID: 0000:07:00.0
totalMemory: 11.92GiB freeMemory: 11.85GiB
2020-07-16 16:40:37.191124: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2020-07-16 16:40:37.606605: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-07-16 16:40:37.606665: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0 
2020-07-16 16:40:37.606676: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N 
2020-07-16 16:40:37.607545: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 11489 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:07:00.0, compute capability: 3.7)
*********************************************************************************************************

然后,我将C_API与tf 1.12.0以及libtensorflow.so和libtensorflow_框架一起使用。因此as copy form python3.5 packages. When I runtf_SessionRun()`,输出为:

TF VERSION:1.12.0
2020-07-16 15:49:22.423989: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2020-07-16 15:49:22.631974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: 
name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235
pciBusID: 0000:07:00.0
totalMemory: 11.92GiB freeMemory: 11.85GiB
2020-07-16 15:49:22.632046: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1482] Ignoring visible gpu device (device: 0, name: Tesla K80, pci bus id: 0000:07:00.0, compute capability: 3.7) with Cuda compute capability 3.7. The minimum required Cuda capability is 6.0.
2020-07-16 15:49:22.632067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-07-16 15:49:22.632082: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0 
2020-07-16 15:49:22.632095: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N 

为什么带有tf gpu 1.12.0的python3.5可以使用k80 gpu,而带有tf gpu 1.12.0的c_api不能与k80一起使用


Tags: namecoregpudevicetftensorflowwithcommon
1条回答
网友
1楼 · 发布于 2024-06-23 03:26:13

您可以在错误消息中看到,您需要一个计算能力为6.0的GPU。您的GPU的计算能力是3.7

Ignoring visible GPU device (device: 0, name: Tesla K80, pci bus id: 0000:07:00.0, compute capability: 3.7) with Cuda compute capability 3.7. The minimum required Cuda capability is 6.0.

作为这个link的解决方案,一个人建议降级到1.11.0,这解决了他的问题

相关问题 更多 >

    热门问题